Skip to content

Commit

Permalink
Merge pull request #48 from source-data/EEB17/better-item-layout
Browse files Browse the repository at this point in the history
EEB 17: Better item layout
  • Loading branch information
eidens authored Dec 15, 2023
2 parents 36d5956 + f16878c commit b2457ac
Show file tree
Hide file tree
Showing 7 changed files with 202 additions and 133 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/filtering/by-reviewing-service.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ v-card(flat)
v-card-text
v-chip-group(v-model="selectedReviewers" mandatory column multiple)
span(v-for="service in this.reviewing_services" :key="`${service.id}-chip`")
v-chip(:value="service.id" :disabled="loadingRecords" filter filter-icon="mdi-check"
v-chip(:value="service.id" :disabled="loadingRecords" filter filter-icon="mdi-check" outlined
active-class="active-chip" text-color="black")
img(v-if="imageFileName(service.id)" :src="require(`@/assets/partner-logos/` + imageFileName(service.id))" height="24px" :alt="serviceId2Name(service.id)").pa-1
| {{ serviceId2Name(service.id) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ v-card(flat).flex-grow-1
v-card-text.d-flex.d-flex-row.align-center
v-text-field(
:value="currentQuery" v-on:keyup.enter="currentQuery = $event.target.value"
:loading="loadingRecords"
placeholder="keywords, authors, doi"
prepend-icon="mdi-magnify"
hide-details
Expand Down
17 changes: 5 additions & 12 deletions frontend/src/components/highlights/article.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template lang="pug">
v-container(fluid)
v-row(v-if="article")
v-col
HighlightedListItem(:article="article" :expandedReview="expandedReview")
v-col.d-flex.align-center
HighlightedListItem(:article="article" :expandedReview="expandedReview" :open-preprint-boxes=[0, 1, 2] :open-reviewed-boxes=[0, 1, 2]).ml-auto.mr-auto
v-row(v-else)
v-col
v-card
Expand Down Expand Up @@ -95,25 +95,18 @@ export default {
let url = null;
if (params.slug) {
this.article_slug = params.slug
url = `/api/v1/slug/${params.slug}`
url = `/api/v2/paper/?slug=${params.slug}`
} else if (params.doi) {
this.article_doi = params.doi
url = `/api/v1/doi/${params.doi}`
url = `/api/v2/paper/?doi=${params.doi}`
}
httpClient.get(url).then((response) => {
let article = response.data[0]
let article = response.data
if (article.doi) { // if the backend doesn't find the article it
// returns an article with all its properties set to null
this.article = article
// return httpClient.get(`/api/v1/review/${doi}`)
}
})
// .then((response) => {
// if (response.data[0]) {
// let review_process = response.data[0].review_process
// this.article.review_process = review_process
// }
// })
},
generateMyUrl () {
if (this.article_slug) {
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/components/highlights/index.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<template lang="pug">
div.d-flex.mr-auto.ml-auto
div(style="max-width: 100%;").d-flex.mr-auto.ml-auto
v-container(v-if="loadingRecords").mt-6
v-progress-circular(:size="70" :width="7" color="primary" indeterminate).ml-auto

span(v-else).mt-3
span(v-else style="max-width:100%;").mt-3
v-container(fluid v-if="paging.totalItems > 0" :class="{'highlights-loading': loadingRecords}")
h2 {{ paging.totalItems }} reviewed preprints found {{ query != '' ? `for search term "${query}" ` : '' }} in the selected sources
v-container(fluid v-if="paging.totalItems == 0")
Expand All @@ -20,7 +20,7 @@ div.d-flex.mr-auto.ml-auto
)
v-row(v-if="paging.totalItems > 0")
v-col.d-flex
v-btn-toggle(v-model="sortBy")
v-btn-toggle(v-model="sortBy" mandatory)
v-tooltip(bottom transition="fade-transition")
template(v-slot:activator="{ on, hover, attrs }")
v-btn(x-small v-bind="attrs" v-on="on" outlined value="preprint-date")
Expand All @@ -45,8 +45,8 @@ div.d-flex.mr-auto.ml-auto
span Sort earliest first

v-row(v-for="article in records" :key="article.id")
v-col
HighlightedListItem(:article="article")
v-col(cols=12)
HighlightedListItem(:article="article" :open-preprint-boxes="[]" :open-reviewed-boxes="[0]")
v-row(v-if="paging.totalItems > 0" justify="start")
v-col(cols=6).px-0.d-flex
v-pagination(
Expand Down
Loading

0 comments on commit b2457ac

Please sign in to comment.