Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add new sorting possibilities on gym routes #112

Merged
merged 2 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 57 additions & 2 deletions components/gymRoutes/partial/GymSpaceRouteSort.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,56 @@
{{ $t('components.gymRoute.sorts.grade') }}
</v-list-item>
</v-list-item>

<v-divider v-if="sortsAvailable.ascents_count || sortsAvailable.likes_count || sortsAvailable.comments_count" />

<v-list-item
v-if="sortsAvailable.ascents_count"
:class="column === 'grade' && !dismounted ? 'v-list-item--active' : null"
@click="sorting('ascents_count')"
>
<v-list-item-icon class="mr-1">
<v-icon>
{{ sortIcon.ascents_count }}
</v-icon>
</v-list-item-icon>
<v-list-item>
{{ $t('components.gymRoute.sorts.ascents_count') }}
</v-list-item>
</v-list-item>

<v-list-item
v-if="sortsAvailable.likes_count"
:class="column === 'grade' && !dismounted ? 'v-list-item--active' : null"
@click="sorting('likes_count')"
>
<v-list-item-icon class="mr-1">
<v-icon>
{{ sortIcon.likes_count }}
</v-icon>
</v-list-item-icon>
<v-list-item>
{{ $t('components.gymRoute.sorts.likes_count') }}
</v-list-item>
</v-list-item>

<v-list-item
v-if="sortsAvailable.comments_count"
:class="column === 'grade' && !dismounted ? 'v-list-item--active' : null"
@click="sorting('comments_count')"
>
<v-list-item-icon class="mr-1">
<v-icon>
{{ sortIcon.comments_count }}
</v-icon>
</v-list-item-icon>
<v-list-item>
{{ $t('components.gymRoute.sorts.comments_count') }}
</v-list-item>
</v-list-item>

<v-divider />

<v-list-item
:class="column === 'opened_at' && dismounted ? 'v-list-item--active' : null"
@click="sorting('opened_at', true)"
Expand Down Expand Up @@ -116,7 +165,10 @@ import {
mdiTextureBox,
mdiSortNumericAscending,
mdiMenuDown,
mdiEyeOff
mdiEyeOff,
mdiCheckAll,
mdiHeart,
mdiComment
} from '@mdi/js'

export default {
Expand Down Expand Up @@ -147,7 +199,10 @@ export default {
opened_at: mdiCalendar,
grade: mdiSortNumericAscending,
level: mdiTag,
opened_at_dismounted: mdiEyeOff
opened_at_dismounted: mdiEyeOff,
ascents_count: mdiCheckAll,
likes_count: mdiHeart,
comments_count: mdiComment
},

mdiSortAscending,
Expand Down
5 changes: 4 additions & 1 deletion lang/en-US.js
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,10 @@ export default {
grade: 'Sort by grade',
level: 'Sort by level',
point: 'Sort by point',
opened_at_dismounted: 'Taken down routes'
opened_at_dismounted: 'Taken down routes',
ascents_count: 'Sort by number of ascents',
likes_count: 'Sort by number of likes',
comments_count: 'Sort by number of comments'
}
},
gymGrade: {
Expand Down
9 changes: 6 additions & 3 deletions lang/fr-FR.js
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,10 @@ export default {
grade: 'Trier par cotation',
level: 'Trier par niveau',
point: 'Trier par point',
opened_at_dismounted: 'Les lignes démontées'
opened_at_dismounted: 'Les lignes démontées',
ascents_count: 'Trier par nombre de réalisations',
likes_count: 'Trier par nombre de likes',
comments_count: 'Trier par nombre de commentaires'
}
},
gymGrade: {
Expand Down Expand Up @@ -2319,7 +2322,7 @@ export default {
subscribe_to_video_feed: "M'avertir des nouvelles vidéos"
},
gymOpener: {
name: 'Nom / Pseudonyme',
name: 'Nom / pseudonyme',
first_name: 'Prénom',
last_name: 'Nom de famille',
email: 'email',
Expand Down Expand Up @@ -2467,7 +2470,7 @@ export default {
styles: 'Styles',
grade_by_section: 'Cotation L.%{index}',
anchor_number: 'Relais n°',
fixedPoints: 'Donner un nombre de point fixe'
fixedPoints: 'Donner un nombre de points fixe'
},
gymGrade: {
name: 'Nom du système',
Expand Down
Loading