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

Only lead climbs #60

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f24cb45
carnet outdoor - liste seulement les croix en tête
pectum83 Sep 19, 2023
06370da
carnet outdoor - liste seulement les croix en tête
pectum83 Sep 19, 2023
8a84414
carnet outdoor - liste seulement les croix en tête - ajout d'une chec…
pectum83 Sep 30, 2023
aae75f3
extension de la modif aux autres graphes et a la vue analytik
pectum83 Sep 30, 2023
639d7b9
Remove package.json file
pectum83 Dec 8, 2024
a4d8b2a
Merge branch 'refs/heads/master' into onlyLeadClimbs
pectum83 Dec 8, 2024
8f602ab
fix(icon type and color) in CragRouteSmallLine when several ascent on…
pectum83 Dec 11, 2024
bc6a550
Refactor filters for outdoor ascents and analytics
pectum83 Dec 11, 2024
60bbf84
Revert bugfix icon - a remettre dans une autre PR
pectum83 Dec 12, 2024
23ed5ee
add AscentFiltersToggleBtn.vue input component
pectum83 Dec 12, 2024
1bf8531
fix to adapt other user outdoor vue to backend filters (but did not i…
pectum83 Dec 12, 2024
57ae19e
Add multi-filter functionality for ascents and climbing types
pectum83 Dec 24, 2024
3ace689
Refactor filter handling for ascended crag routes.
pectum83 Dec 24, 2024
5635633
Refactor filter handling for ascended crag routes.
pectum83 Dec 27, 2024
eb27516
remove package.json
pectum83 Dec 27, 2024
659c230
suppress otherFilters. Replaced by boolean no_double
pectum83 Dec 31, 2024
7f53ecd
lists in snakecase
pectum83 Dec 31, 2024
91e9ddf
suppress no_double filter
pectum83 Jan 1, 2025
9c62971
factorize stats api
pectum83 Jan 2, 2025
3edb896
POST pour les nested params et factorisation user et currentuser api …
pectum83 Jan 2, 2025
7ca72a4
call stats with GET and parse nested params in api
pectum83 Jan 5, 2025
d1f2ddc
reverse package.json
pectum83 Jan 7, 2025
850b170
several PR comments applied
pectum83 Jan 7, 2025
6dda412
camelcase objects filters et stats
pectum83 Jan 7, 2025
c7bb4d0
Revert "camelcase objects filters et stats"
pectum83 Jan 7, 2025
79aa86a
revert package.json
pectum83 Jan 7, 2025
fb751ff
revert package.json
pectum83 Jan 7, 2025
c820bcc
revert package.json
pectum83 Jan 7, 2025
35a6319
camelcase et filters à la racine
pectum83 Jan 8, 2025
aa553c7
revert lang files reformat
pectum83 Jan 8, 2025
0a349a0
suppress lead et onsight
pectum83 Jan 8, 2025
30214e2
no request until applyu filters
pectum83 Jan 8, 2025
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
40 changes: 36 additions & 4 deletions components/forms/AscentStatusInput.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div>
<v-input
class="required-field"
:class="required ? 'required-field' : ''"
hide-details
>
<fieldset class="full-width custom-fieldset border rounded mt-n1 pb-0 px-2">
Expand All @@ -13,6 +13,7 @@
v-model="ascentStatus"
active-class="primary--text"
column
:multiple="multiple"
@change="onChange"
>
<v-chip
Expand All @@ -33,7 +34,11 @@
</v-chip-group>
</div>
</fieldset>
<v-chip v-if="multiple" class="ml-1" @click="selectAll()">
{{ $t('common.seeAll') }}
</v-chip>
</v-input>

<div class="mb-3">
<div class="text-right pr-1">
<span
Expand Down Expand Up @@ -90,15 +95,23 @@
</template>

<script>
import { mdiCropSquare, mdiCheckboxMarkedCircle, mdiRecordCircle, mdiFlash, mdiEye, mdiAutorenew, mdiChevronUp } from '@mdi/js'
import {
mdiCropSquare,
mdiCheckboxMarkedCircle,
mdiRecordCircle,
mdiFlash,
mdiEye,
mdiAutorenew,
mdiChevronUp
} from '@mdi/js'
import { InputHelpers } from '@/mixins/InputHelpers'

export default {
name: 'AscentStatusInput',
mixins: [InputHelpers],
props: {
value: {
type: String,
type: [String, Array], // array if multipleChoices true
default: null
},
withProject: {
Expand All @@ -112,12 +125,20 @@ export default {
withRepetition: {
type: Boolean,
default: true
},
multiple: {
type: Boolean,
default: false
},
required: { // required input of the form and display the red * on top of the component
type: Boolean,
default: true
}
},

data () {
return {
ascentStatus: this.value,
ascentStatus: this.value, // string or array according to multipleChoices false or true
showLegend: false,

mdiChevronUp
Expand All @@ -143,9 +164,20 @@ export default {
}
},

mounted () {
// for multiple choices select all at mount if no list passed in initial v-model
if (this.multiple && this.value.length === 0) {
pectum83 marked this conversation as resolved.
Show resolved Hide resolved
this.selectAll()
}
},

methods: {
onChange () {
this.$emit('input', this.ascentStatus)
},
selectAll () {
this.ascentStatus = this.ascentStatuses.map(status => status.value)
this.onChange()
}
}
}
Expand Down
57 changes: 56 additions & 1 deletion components/forms/ClimbingTypeInput.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<v-select
v-if="inputType === 'select'"
v-model="climbingTypes"
:items="climbByEnvironment()"
item-text="text"
Expand All @@ -13,13 +14,52 @@
outlined
@change="onChange"
/>
<v-input v-else-if="inputType === 'chips'">
pectum83 marked this conversation as resolved.
Show resolved Hide resolved
<fieldset class="full-width custom-fieldset border rounded mt-n1 pb-0 px-2">
<legend class="v-label custom-fieldset-label">
{{ $t('components.input.climbing_type') }}
</legend>
<div>
<v-chip-group
v-model="climbingTypes"
active-class="primary--text"
column
:multiple="multiple"
@change="onChange"
>
<v-chip
v-for="(item, itemIndex) in climbByEnvironment()"
:key="`item-index-${itemIndex}`"
:value="item.value"
outlined
>
<v-icon
:class="`climbs-pastille ${item.value} mr-3`"
:color="climbingTypes === item.value ? 'green' : null"
small
left
>
{{ item.icon }}
</v-icon>
{{ item.text }}
</v-chip>
</v-chip-group>
</div>
</fieldset>
<v-chip v-if="multiple" class="ml-1" @click="selectAll()">
{{ $t('common.seeAll') }}
</v-chip>
</v-input>
</template>

<script>
export default {
name: 'ClimbingTypeInput',
props: {
value: [Array, String],
value: {
type: [Array, String],
default: null
},
environment: {
type: String,
default: 'crag'
Expand All @@ -43,6 +83,10 @@ export default {
clearable: {
type: Boolean,
default: false
},
inputType: { // possible values: 'select', 'chips'
type: String,
default: 'select'
}
},

Expand Down Expand Up @@ -78,6 +122,13 @@ export default {
}
},

mounted () {
// for inputType=chips et multiple choices, select all at mount if no list passed in initial v-model
if (this.inputType === 'chips' && this.multiple && this.value.length === 0) {
pectum83 marked this conversation as resolved.
Show resolved Hide resolved
this.selectAll()
}
},

methods: {
onChange () {
this.$emit('input', this.climbingTypes)
Expand All @@ -91,6 +142,10 @@ export default {
} else if (this.environment === 'user') {
return this.climbingUserList
}
},
selectAll () {
this.climbingTypes = this.climbByEnvironment().map(climb => climb.value)
this.onChange()
}
}
}
Expand Down
59 changes: 52 additions & 7 deletions components/forms/RopingStatusInput.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<template>
<v-input class="required-field">
<v-input
:class="required ? 'required-field' : ''"
>
<fieldset class="full-width custom-fieldset border rounded mt-n1 pb-0 px-2">
<legend class="v-label custom-fieldset-label">
{{ $t('components.input.ropingStatusQuestion') }}
Expand All @@ -9,6 +11,7 @@
v-model="ropingStatus"
active-class="primary--text"
column
:multiple="multiple"
@change="onChange"
>
<v-chip
Expand All @@ -29,6 +32,9 @@
</v-chip-group>
</div>
</fieldset>
<v-chip v-if="multiple" class="ml-1" @click="selectAll()">
{{ $t('common.seeAll') }}
</v-chip>
</v-input>
</template>

Expand All @@ -45,7 +51,7 @@ export default {
mixins: [InputHelpers],
props: {
value: {
type: String,
type: [String, Array],
default: null
},
sportClimbingRopingStatuses: {
Expand All @@ -55,6 +61,14 @@ export default {
multiPithRopingStatuses: {
type: Boolean,
default: true
},
multiple: {
type: Boolean,
default: false
},
required: { // required input of the form and display the red * on top of the component
type: Boolean,
default: true
}
},

Expand All @@ -68,21 +82,52 @@ export default {
ropingStatuses () {
const statuses = []
if (this.sportClimbingRopingStatuses) {
statuses.push({ text: this.$t('models.ropingStatus.lead_climb'), value: 'lead_climb', icon: oblykRopingStatusLeadClimb })
statuses.push({ text: this.$t('models.ropingStatus.top_rope'), value: 'top_rope', icon: oblykRopingStatusTopRope })
statuses.push({
text: this.$t('models.ropingStatus.lead_climb'),
value: 'lead_climb',
icon: oblykRopingStatusLeadClimb
})
statuses.push({
text: this.$t('models.ropingStatus.top_rope'),
value: 'top_rope',
icon: oblykRopingStatusTopRope
})
}
if (this.multiPithRopingStatuses) {
statuses.push({ text: this.$t('models.ropingStatus.multi_pitch_leader'), value: 'multi_pitch_leader', icon: oblykRopingStatusMultiPitchLeader })
statuses.push({ text: this.$t('models.ropingStatus.multi_pitch_second'), value: 'multi_pitch_second', icon: oblykRopingStatusMultiPitchSecond })
statuses.push({ text: this.$t('models.ropingStatus.multi_pitch_alternate_lead'), value: 'multi_pitch_alternate_lead', icon: oblykRopingStatusLeadClimbMultiPitchAlternateLead })
statuses.push({
text: this.$t('models.ropingStatus.multi_pitch_leader'),
value: 'multi_pitch_leader',
icon: oblykRopingStatusMultiPitchLeader
})
statuses.push({
text: this.$t('models.ropingStatus.multi_pitch_second'),
value: 'multi_pitch_second',
icon: oblykRopingStatusMultiPitchSecond
})
statuses.push({
text: this.$t('models.ropingStatus.multi_pitch_alternate_lead'),
value: 'multi_pitch_alternate_lead',
icon: oblykRopingStatusLeadClimbMultiPitchAlternateLead
})
}
return statuses
}
},

mounted () {
// for multiple choices select all at mount if no list passed in initial v-model
if (this.multiple && this.value.length === 0) {
pectum83 marked this conversation as resolved.
Show resolved Hide resolved
this.selectAll()
}
},

methods: {
onChange () {
this.$emit('input', this.ropingStatus)
},
selectAll () {
this.ropingStatus = this.ropingStatuses.map(status => status.value)
this.onChange()
}
}
}
Expand Down
Loading
Loading