Skip to content

Commit 7a483ee

Browse files
authored
Merge pull request #6212 from LibreSign/backport/6210/stable32
[stable32] feat: add Twig documentation links to template editors
2 parents 74ec606 + b4c18b5 commit 7a483ee

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

src/components/FooterTemplateEditor.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
-->
55
<template>
66
<div class="footer-template-section">
7+
<p v-linkify="{ linkify: true, text: footerDescription }" class="footer-template-description" />
78
<div class="footer-template-header">
89
<NcButton type="tertiary"
910
:aria-label="t('libresign', 'Show available variables')"
@@ -142,6 +143,7 @@ import NcDialog from '@nextcloud/vue/components/NcDialog'
142143
import NcFormBoxButton from '@nextcloud/vue/components/NcFormBoxButton'
143144
import NcLoadingIcon from '@nextcloud/vue/components/NcLoadingIcon'
144145
import NcTextField from '@nextcloud/vue/components/NcTextField'
146+
import Linkify from '@nextcloud/vue/directives/Linkify'
145147
// eslint-disable-next-line import/default
146148
import VuePdfEditor from '@libresign/vue-pdf-editor'
147149
@@ -156,6 +158,9 @@ import Undo from 'vue-material-design-icons/UndoVariant.vue'
156158
157159
export default {
158160
name: 'FooterTemplateEditor',
161+
directives: {
162+
Linkify,
163+
},
159164
components: {
160165
Check,
161166
CodeEditor,
@@ -177,6 +182,7 @@ export default {
177182
return {
178183
DEFAULT_PREVIEW_WIDTH,
179184
DEFAULT_PREVIEW_HEIGHT,
185+
footerDescription: t('libresign', 'Configure the content displayed at the footer of the PDF. The text template uses Twig syntax: https://twig.symfony.com/'),
180186
footerTemplate: '',
181187
pdfPreviewFile: null,
182188
loadingPreview: false,
@@ -314,6 +320,10 @@ export default {
314320
flex-direction: column;
315321
gap: 16px;
316322
323+
.footer-template-description {
324+
color: var(--color-text-lighter);
325+
}
326+
317327
.footer-template-header {
318328
display: flex;
319329
gap: 8px;

src/views/Settings/SignatureStamp.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
- SPDX-License-Identifier: AGPL-3.0-or-later
44
-->
55
<template>
6-
<NcSettingsSection :name="name" :description="description">
6+
<NcSettingsSection :name="name">
7+
<p v-linkify="{ linkify: true, text: description }" class="settings-section__description" />
78
<fieldset class="settings-section__row">
89
<legend>{{ t('libresign', 'Display signature mode') }}</legend>
910
<NcCheckboxRadioSwitch v-model="renderMode"
@@ -349,11 +350,15 @@ import NcNoteCard from '@nextcloud/vue/components/NcNoteCard'
349350
import NcSettingsSection from '@nextcloud/vue/components/NcSettingsSection'
350351
import NcTextField from '@nextcloud/vue/components/NcTextField'
351352
import { useIsDarkTheme } from '@nextcloud/vue/composables/useIsDarkTheme'
353+
import Linkify from '@nextcloud/vue/directives/Linkify'
352354
353355
import CodeEditor from '../../components/CodeEditor.vue'
354356
355357
export default {
356358
name: 'SignatureStamp',
359+
directives: {
360+
Linkify,
361+
},
357362
components: {
358363
Check,
359364
CodeEditor,
@@ -384,7 +389,7 @@ export default {
384389
const backgroundType = loadState('libresign', 'signature_background_type')
385390
return {
386391
name: t('libresign', 'Signature stamp'),
387-
description: t('libresign', 'Configure the content displayed with the signature. The text template uses Twig syntax.'),
392+
description: t('libresign', 'Configure the content displayed with the signature. The text template uses Twig syntax: https://twig.symfony.com/'),
388393
showLoadingBackground: false,
389394
backgroundType,
390395
acceptMime: ['image/png'],
@@ -696,6 +701,10 @@ export default {
696701
.settings-section{
697702
display: flex;
698703
flex-direction: column;
704+
&__description {
705+
color: var(--color-text-lighter);
706+
margin-bottom: 8px;
707+
}
699708
&:deep(.settings-section__name) {
700709
justify-content: unset;
701710
}

0 commit comments

Comments
 (0)