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: Print version on document #2485

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion src/views/document/BookView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<loading-notification :promise="promise" />
<document-view-header v-if="document" :document="document" :version="version" />
<div v-if="document" class="columns is-block-print">
<div class="column is-3">
<div class="column is-3 is-12-print">
<div class="box">
<activities-field :document="document" />
<field-view :document="document" :field="fields.author" />
Expand Down
2 changes: 1 addition & 1 deletion src/views/document/OutingView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<images-box v-if="document" :document="document" />

<div v-if="document" class="columns is-multiline is-block-print">
<div class="column is-3 no-print">
<div class="column is-3 is-12-print">
<map-box :document="document" />
<tool-box :document="document" v-if="!$screen.isMobile" />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/views/document/RouteView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<loading-notification :promise="promise" />
<document-view-header v-if="document" :document="document" :version="version" />
<div v-if="document" class="columns is-block-print">
<div class="column is-3 no-print">
<div class="column is-3 is-12-print">
<map-box :document="document" @has-protection-area="hasProtectionArea = true" />
<tool-box :document="document" v-if="!$screen.isMobile" />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/views/document/WaypointView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</document-view-header>

<div v-if="document" class="columns">
<div class="column is-3 no-print">
<div class="column is-3">
<map-box :document="document" />
<tool-box :document="document" v-if="!$screen.isMobile" />
</div>
Expand Down
107 changes: 58 additions & 49 deletions src/views/document/utils/boxes/LicenseBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,62 +6,64 @@
target="_blank"
rel="noreferer"
>
<icon-creative-commons />
CC
<span
:title="
$gettext(
'Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made.'
)
"
>
BY
</span>
<span
:title="
$gettext(
'ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.'
)
"
>
SA
</span>
3.0
<br />
<span v-translate> This content is licensed under Creative Commons BY-SA 3.0 </span>
<div>
<icon-creative-commons />
CC
<span
:title="
$gettext(
'Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made.'
)
"
>
BY
</span>
<span
:title="
$gettext(
'ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.'
)
"
>
SA
</span>
3.0
</div>
<div v-translate>This content is licensed under Creative Commons BY-SA 3.0</div>
</a>
<a
v-else-if="license == 'by-nc-nd'"
:href="'https://creativecommons.org/licenses/by-nc-nd/3.0/deed.' + $language.current"
target="_blank"
rel="noreferer"
>
<icon-creative-commons />
CC
<span
:title="
$gettext(
'Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made.'
)
"
>
BY
</span>
<span :title="$gettext('NonCommercial — You may not use the material for commercial purposes.')"> NC </span>
<span
:title="
$gettext(
'NoDerivatives — If you remix, transform, or build upon the material, you may not distribute the modified material.'
)
"
>
ND
</span>
3.0
<br />
<span v-translate> This content is licensed under Creative Commons BY-NC-ND 3.0 </span>
<div>
<icon-creative-commons />
CC
<span
:title="
$gettext(
'Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made.'
)
"
>
BY
</span>
<span :title="$gettext('NonCommercial — You may not use the material for commercial purposes.')"> NC </span>
<span
:title="
$gettext(
'NoDerivatives — If you remix, transform, or build upon the material, you may not distribute the modified material.'
)
"
>
ND
</span>
3.0
</div>
<div v-translate>This content is licensed under Creative Commons BY-NC-ND 3.0</div>
</a>
<span
<div
v-else-if="license == 'copyright'"
:title="
$gettext(
Expand All @@ -71,7 +73,7 @@
>
<fa-icon icon="ban" />
<span v-translate> This book cover is the property of its editor and/or author </span>
</span>
</div>
</div>
</template>

Expand Down Expand Up @@ -121,3 +123,10 @@ export default {
},
};
</script>
<style scoped lang="scss">
@media print {
div {
display: inline-block;
}
}
</style>
22 changes: 22 additions & 0 deletions src/views/document/utils/boxes/RevisionBox.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<template>
<div class="has-text-centered">
<span v-translate>Revision</span><span>&nbsp;: n° {{ version }}</span>
</div>
</template>

<script>
import { requireDocumentProperty } from '@/js/properties-mixins';

export default {
mixins: [requireDocumentProperty],
computed: {
version() {
if (this.document.locales[0].version > this.document.version) {
return this.document.locales[0].version;
} else {
return this.document.version;
}
},
},
};
</script>
Loading