Skip to content

Commit

Permalink
feat: c2corg#3697 add waypoints external resources section
Browse files Browse the repository at this point in the history
  • Loading branch information
florentcadot committed Feb 18, 2024
1 parent 50c6883 commit 0a14e4a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/js/constants/documentsProperties.json
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,8 @@
{ "id": "books", "properties": { "url": "b", "associationEditorOrder": 2 } },
{ "id": "images", "properties": { "associationEditorOrder": 4 } },
{ "id": "waypoints", "properties": { "url": "w", "associationEditorOrder": 1 } },
{ "id": "waypoints", "properties": { "name": "waypoint_children", "url": "w", "associationEditorOrder": 1 } }
{ "id": "waypoints", "properties": { "name": "waypoint_children", "url": "w", "associationEditorOrder": 1 } },
{ "id": "external_resources" }
]
},

Expand Down
7 changes: 6 additions & 1 deletion src/views/document/WaypointView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
</div>
</div>

<div class="box" v-if="locale.summary || locale.access_period || locale.description || locale.access">
<div class="box" v-if="showMainBox">
<markdown-section :document="document" :field="fields.summary" />
<markdown-section :document="document" :field="fields.access_period" :title="accessPeriodTitle" />
<template v-if="document.waypoint_type == 'access'">
Expand All @@ -126,6 +126,7 @@
<markdown-section :document="document" :field="fields.description" :title="descriptionTitle" />
<markdown-section :document="document" :field="fields.access" :title="accessTitle" />
</template>
<markdown-section :document="document" :field="fields.external_resources" />
<div style="clear: both" />
</div>

Expand Down Expand Up @@ -157,6 +158,10 @@ export default {
capacityContext() {
return this.document.waypoint_type === 'bivouac' ? this.document.waypoint_type : null;
},
showMainBox() {
const { summary, access_period, description, access, external_resources } = this.locale;
return summary || access_period || description || access || external_resources;
},
},
};
</script>
7 changes: 7 additions & 0 deletions src/views/wiki/edition/WaypointEditionView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@
:label="accessTitle"
/>

<form-field
class="is-12"
:document="document"
:field="fields.external_resources"
:placeholder="$gettext('Books and websites not already associated to this route')"
/>

<quality-field class="is-4" :document="document" />
</div>
</form-section>
Expand Down

0 comments on commit 0a14e4a

Please sign in to comment.