diff --git a/common/locales/de.json b/common/locales/de.json
index 69d1817126..cdc41afcfc 100644
--- a/common/locales/de.json
+++ b/common/locales/de.json
@@ -117,7 +117,8 @@
"day": {
"fields": {
"dayResponsibles": "Tagesverantwortliche"
- }
+ },
+ "name": "Tag | Tage"
},
"materialList": {
"name": "Materialliste"
@@ -139,5 +140,22 @@
},
"name": "Zeitplaneintrag"
}
+ },
+ "print": {
+ "toc": {
+ "title": "Inhaltsverzeichnis"
+ },
+ "cover": {
+ "title": "Titelseite"
+ },
+ "program": {
+ "title": "Detailprogramm"
+ },
+ "story": {
+ "title": "Roter Faden"
+ },
+ "picasso": {
+ "title": "Grobprogramm für {period}"
+ }
}
}
\ No newline at end of file
diff --git a/common/locales/en.json b/common/locales/en.json
index afa49cddba..cd181f88e1 100644
--- a/common/locales/en.json
+++ b/common/locales/en.json
@@ -125,7 +125,8 @@
"day": {
"fields": {
"dayResponsibles": "Responsible of the day"
- }
+ },
+ "name": "Day | Days"
},
"materialItem": {
"fields": {
@@ -157,5 +158,22 @@
},
"name": "Activity scheduled"
}
+ },
+ "print": {
+ "toc": {
+ "title": "Table of content"
+ },
+ "cover": {
+ "title": "Cover page"
+ },
+ "program": {
+ "title": "Program"
+ },
+ "story": {
+ "title": "Storyline"
+ },
+ "picasso": {
+ "title": "Program overview for {period}"
+ }
}
}
\ No newline at end of file
diff --git a/frontend/src/App.vue b/frontend/src/App.vue
index 8ddc108e41..e9b99102b7 100644
--- a/frontend/src/App.vue
+++ b/frontend/src/App.vue
@@ -119,7 +119,7 @@ export default {
}
@media #{map-get($display-breakpoints, 'xs-only')}{
- .v-main .container {
+ .v-main > .v-main__wrap > .container {
min-height: 100%;
display: flex;
@@ -137,6 +137,7 @@ export default {
}
@media #{map-get($display-breakpoints, 'sm-and-down')}{
+ // TODO: this changes look & feel of all v-containers. Do we really want this?
.container.container--fluid {
padding: 0;
diff --git a/frontend/src/components/print/PrintConfigurator.vue b/frontend/src/components/print/PrintConfigurator.vue
index 1eb672990d..d831eb236e 100644
--- a/frontend/src/components/print/PrintConfigurator.vue
+++ b/frontend/src/components/print/PrintConfigurator.vue
@@ -2,11 +2,9 @@
-
{{ $tc('components.camp.campPrint.selectPrintPreview') }}
-
-
+
@@ -15,9 +13,9 @@
- {{ content.type }}
+ {{ $tc('components.print.printConfigurator.config.' + content.type) }}
-
@@ -32,51 +30,56 @@
-
- Add
-
+ v-on="on" />
- {{ component.name }}
+ {{ $tc('components.print.printConfigurator.config.' + idx) }}
-
-
-
- {{ $tc('components.camp.campPrint.openPrintPreview') }}
-
-
-
-
-
-
- View Print-Config
-
- {{ cnf }}
-
-
-
-
+
+
+
+ View Print-Config
+
+ {{ cnf }}
+
+
+
+
+
+
+
+
+ Print with Nuxt
+ Print with React
+
+
+
+
+
+
+
@@ -85,28 +88,28 @@
+
+
diff --git a/frontend/src/components/print/print-nuxt/PrintPreviewNuxt.vue b/frontend/src/components/print/print-nuxt/PrintPreviewNuxt.vue
new file mode 100644
index 0000000000..3e44d3add2
--- /dev/null
+++ b/frontend/src/components/print/print-nuxt/PrintPreviewNuxt.vue
@@ -0,0 +1,68 @@
+
+
+
+
+
+ mdi-open-in-new
+ {{ $tc('components.print.printPreviewNuxt.openPreview') }}
+
+
+
+
+
+
+ {{ $tc('views.camp.print.previewError') }}
+
+
+
+
+
+
+
+
+
diff --git a/frontend/src/components/print/print-react/LocalPdfDownloadButton.vue b/frontend/src/components/print/print-react/PdfDownloadButtonReact.vue
similarity index 91%
rename from frontend/src/components/print/print-react/LocalPdfDownloadButton.vue
rename to frontend/src/components/print/print-react/PdfDownloadButtonReact.vue
index bf91d8d118..6514fe40d3 100644
--- a/frontend/src/components/print/print-react/LocalPdfDownloadButton.vue
+++ b/frontend/src/components/print/print-react/PdfDownloadButtonReact.vue
@@ -1,7 +1,6 @@
-
@@ -10,7 +9,7 @@
mdi-react
- {{ $tc('components.camp.print.localPdfDownloadButton.error') }}
+ {{ $tc('components.print.localPdfDownloadButton.error') }}
{ addKeys(children) }
}
},
+ {
+ replaceChildren: true,
+ shouldProcessNode: function (node) {
+ return node.type === 'tag' && (node.name === 'h1' || node.name === 'h2' || node.name === 'h3')
+ },
+ processNode: function (node, children) {
+ return { addKeys(children) }
+ }
+ },
+ {
+ replaceChildren: true,
+ shouldProcessNode: function (node) {
+ return node.type === 'tag' && node.name === 'em'
+ },
+ processNode: function (node, children) {
+ return { addKeys(children) }
+ }
+ },
+ {
+ replaceChildren: true,
+ shouldProcessNode: function (node) {
+ return node.type === 'tag' && node.name === 'u'
+ },
+ processNode: function (node, children) {
+ return { addKeys(children) }
+ }
+ },
+ {
+ replaceChildren: true,
+ shouldProcessNode: function (node) {
+ return node.type === 'tag' && node.name === 's'
+ },
+ processNode: function (node, children) {
+ return { addKeys(children) }
+ }
+ },
{
replaceChildren: true,
shouldProcessNode: function (node) {
@@ -61,6 +97,18 @@ const richTextRules = [
return • {children}
}
},
+
+ // fall back tag --> print as plain text
+ {
+ replaceChildren: true,
+ shouldProcessNode: function (node) {
+ return node.type === 'tag'
+ },
+ processNode: function (node, children) {
+ console.log('unknown HTML node tag', node, children)
+ return { addKeys(children) }
+ }
+ },
{
replaceChildren: true,
shouldProcessNode: function (node) {
diff --git a/frontend/src/components/print/print-react/components/picasso/Picasso.jsx b/frontend/src/components/print/print-react/components/picasso/Picasso.jsx
index 286726f694..786cb82821 100644
--- a/frontend/src/components/print/print-react/components/picasso/Picasso.jsx
+++ b/frontend/src/components/print/print-react/components/picasso/Picasso.jsx
@@ -50,7 +50,7 @@ function Picasso ({ period, orientation, $tc }) {
]
return
- {$tc('components.print.picasso.title', { period: period.description })}
+ {$tc('print.picasso.title', { period: period.description })}
{period.days().items.map(day => )}
diff --git a/frontend/src/components/print/print-react/documents/pdfDocument/Component.jsx b/frontend/src/components/print/print-react/documents/pdfDocument/Component.jsx
index e40dbb2927..620267fa36 100644
--- a/frontend/src/components/print/print-react/documents/pdfDocument/Component.jsx
+++ b/frontend/src/components/print/print-react/documents/pdfDocument/Component.jsx
@@ -6,8 +6,11 @@ import Picasso from '../../components/picasso/Picasso.jsx'
import ScheduleEntry from '../../components/scheduleEntry/ScheduleEntry.jsx'
import styles from '../../components/styles.js'
import OpenSans from '@/assets/fonts/OpenSans/OpenSans-Regular.ttf'
+import OpenSansItalic from '@/assets/fonts/OpenSans/OpenSans-Italic.ttf'
import OpenSansSemiBold from '@/assets/fonts/OpenSans/OpenSans-SemiBold.ttf'
+import OpenSansSemiBoldItalic from '@/assets/fonts/OpenSans/OpenSans-SemiBoldItalic.ttf'
import OpenSansBold from '@/assets/fonts/OpenSans/OpenSans-Bold.ttf'
+import OpenSansBoldItalic from '@/assets/fonts/OpenSans/OpenSans-BoldItalic.ttf'
function PDFDocument (props) {
return
@@ -53,14 +56,20 @@ const registerFonts = async () => {
// For now it seems that only ttf is supported, not woff or woff2
{ src: OpenSans },
{ src: OpenSansSemiBold, fontWeight: 'semibold' },
- { src: OpenSansBold, fontWeight: 'bold' }
+ { src: OpenSansBold, fontWeight: 'bold' },
+ { src: OpenSansItalic, fontStyle: 'italic' },
+ { src: OpenSansSemiBoldItalic, fontWeight: 'semibold', fontStyle: 'italic' },
+ { src: OpenSansBoldItalic, fontWeight: 'bold', fontStyle: 'italic' }
]
})
return await Promise.all([
Font.load({ fontFamily: 'OpenSans' }),
Font.load({ fontFamily: 'OpenSans', fontWeight: 600 }),
- Font.load({ fontFamily: 'OpenSans', fontWeight: 700 })
+ Font.load({ fontFamily: 'OpenSans', fontWeight: 700 }),
+ Font.load({ fontFamily: 'OpenSans', fontStyle: 'italic' }),
+ Font.load({ fontFamily: 'OpenSans', fontWeight: 600, fontStyle: 'italic' }),
+ Font.load({ fontFamily: 'OpenSans', fontWeight: 700, fontStyle: 'italic' })
])
}
diff --git a/frontend/src/components/print/print-react/documents/pdfDocument/prepareInMainThread.js b/frontend/src/components/print/print-react/documents/pdfDocument/prepareInMainThread.js
index af6c367c54..5583ad761c 100644
--- a/frontend/src/components/print/print-react/documents/pdfDocument/prepareInMainThread.js
+++ b/frontend/src/components/print/print-react/documents/pdfDocument/prepareInMainThread.js
@@ -2,10 +2,13 @@ const picassoData = (config) => {
if (!config.contents.some(c => c.type === 'Picasso')) {
return []
}
+
+ const camp = config.apiGet(config.camp)
+
return [
- config.camp()._meta.load,
- config.camp().categories().$loadItems(),
- config.camp().activities().$loadItems().then(activities => {
+ camp._meta.load,
+ camp.categories().$loadItems(),
+ camp.activities().$loadItems().then(activities => {
return Promise.all(activities.items.map(activity => {
return Promise.all([
activity.activityResponsibles().$loadItems(),
@@ -13,10 +16,10 @@ const picassoData = (config) => {
])
}))
}),
- config.camp().campCollaborations().$loadItems().then(campCollaboration => {
+ camp.campCollaborations().$loadItems().then(campCollaboration => {
return campCollaboration.user ? campCollaboration.user()._meta.load : Promise.resolve()
}),
- config.camp().periods().$loadItems().then(periods => {
+ camp.periods().$loadItems().then(periods => {
return Promise.all(periods.items.map(period => {
return period.scheduleEntries().$loadItems()
}))
@@ -28,10 +31,13 @@ const activityData = (config) => {
if (!config.contents.some(c => ['Program', 'Activity'].includes(c.type))) {
return []
}
+
+ const camp = config.apiGet(config.camp)
+
return [
- config.camp()._meta.load,
- config.camp().categories().$loadItems(),
- config.camp().activities().$loadItems().then(activities => {
+ camp._meta.load,
+ camp.categories().$loadItems(),
+ camp.activities().$loadItems().then(activities => {
return Promise.all(activities.items.map(activity => {
return Promise.all([
activity.activityResponsibles().$loadItems(),
@@ -39,15 +45,15 @@ const activityData = (config) => {
])
}))
}),
- config.camp().campCollaborations().$loadItems().then(campCollaboration => {
+ camp.campCollaborations().$loadItems().then(campCollaboration => {
return campCollaboration.user ? campCollaboration.user()._meta.load : Promise.resolve()
}),
- config.camp().periods().$loadItems().then(periods => {
+ camp.periods().$loadItems().then(periods => {
return Promise.all(periods.items.map(period => {
return period.scheduleEntries().$loadItems()
}))
}),
- config.camp().materialLists().$loadItems(),
+ camp.materialLists().$loadItems(),
config.apiGet().contentTypes().$loadItems()
]
}
diff --git a/frontend/src/components/print/print-react/generatePdf.js b/frontend/src/components/print/print-react/generatePdf.js
index de8ea3caea..6ea9b8547b 100644
--- a/frontend/src/components/print/print-react/generatePdf.js
+++ b/frontend/src/components/print/print-react/generatePdf.js
@@ -4,7 +4,7 @@ import Worker from 'worker-iife:./renderPdf.worker.js'
import * as Comlink from 'comlink'
// During prod build, force vite to bundle the required fonts
-const fonts = import.meta.glob('../../assets/fonts/OpenSans/*.ttf') // eslint-disable-line no-unused-vars
+const fonts = import.meta.glob('../../../assets/fonts/OpenSans/*.ttf') // eslint-disable-line no-unused-vars
export const generatePdf = async (data) => {
const prepareInMainThread = await mainThreadLoaderFor(data.config)
diff --git a/frontend/src/components/story/StoryDay.vue b/frontend/src/components/story/StoryDay.vue
index 6445dea141..ae5f5b5f53 100644
--- a/frontend/src/components/story/StoryDay.vue
+++ b/frontend/src/components/story/StoryDay.vue
@@ -44,7 +44,7 @@
- {{ $tc('components.camp.storyDay.noStory') }}
+ {{ $tc('components.story.storyDay.noStory') }}
diff --git a/frontend/src/locales/de-CH-scout.json b/frontend/src/locales/de-CH-scout.json
index bf574c627e..243c4b827b 100644
--- a/frontend/src/locales/de-CH-scout.json
+++ b/frontend/src/locales/de-CH-scout.json
@@ -1,11 +1,4 @@
{
- "components": {
- "camp": {
- "campPrint": {
- "picasso": "Grobprogramm"
- }
- }
- },
"entity": {
"user": {
"fields": {
@@ -16,4 +9,4 @@
"global": {
"language": "Deutsch (Pfadi)"
}
-}
+}
\ No newline at end of file
diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json
index 89de21c10f..fbcc8a5e51 100644
--- a/frontend/src/locales/de.json
+++ b/frontend/src/locales/de.json
@@ -99,18 +99,6 @@
"deleteWarning": "Möchtest du diese Periode wirklich löschen?",
"lastPeriodNotDeletable": "Die letzte Periode kann nicht gelöscht werden."
},
- "campPrint": {
- "activities": "Aktivitäten",
- "dailySummary": "Tagesübersicht",
- "frontpage": "Deckblatt",
- "openPrintPreview": "Druckvorschau öffnen",
- "picasso": "Grobprogramm",
- "printNow": "Jetzt drucken",
- "selectPrintPreview": "Druckvorschau zeigen",
- "storyline": "Roter Faden",
- "title": "Drucken",
- "toc": "Inhaltsverzeichnis"
- },
"campSettings": {
"fields": {
"motto": "Motto",
@@ -126,20 +114,38 @@
"datetime": {
"date": "dd. D.MM | D. MMM | DD. MMM YYYY"
}
+ }
+ },
+ "print": {
+ "documents": {
+ "pdfDocument": {
+ "filename": {
+ "activitiesOnly": "Aktivitäten {camp}",
+ "picassoOnly": "Grobprogramm {camp}"
+ }
+ }
},
- "print": {
- "documents": {
- "pdfDocument": {
- "filename": {
- "activitiesOnly": "Aktivitäten {camp}",
- "picassoOnly": "Grobprogramm {camp}"
- }
+ "localPdfDownloadButton": {
+ "error": "Etwas hat nicht geklappt. Probiere es nochmals, oder lade die Seite neu."
+ },
+ "printConfigurator": {
+ "config": {
+ "Activity": "Einzelaktivität",
+ "Cover": "Titelseite",
+ "Picasso": "Grobprogramm",
+ "Story": "Roter Faden",
+ "Program": "Programm",
+ "Toc": "Inhaltsverzeichnis",
+ "ProgramConfig": {
+ "dayOverview": "Tagesübersicht drucken"
}
- },
- "localPdfDownloadButton": {
- "error": "Etwas hat nicht geklappt. Probiere es nochmals, oder lade die Seite neu."
}
},
+ "printPreviewNuxt": {
+ "openPreview": "Vorschau in neuem Fenster öffnen"
+ }
+ },
+ "story": {
"storyDay": {
"noStory": "Kein roter Faden an diesem Tag gefunden…"
}
@@ -174,11 +180,6 @@
"myCamps": "Mein Lager | Meine Lager",
"profile": "Profil"
}
- },
- "print": {
- "picasso": {
- "title": "Grobprogramm {period}"
- }
}
},
"entity": {
diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json
index 2d4b31f697..092c41c991 100644
--- a/frontend/src/locales/en.json
+++ b/frontend/src/locales/en.json
@@ -147,18 +147,6 @@
"deleteWarning": "Do you really want to delete this period?",
"lastPeriodNotDeletable": "Last period is not deletable."
},
- "campPrint": {
- "activities": "Activities",
- "dailySummary": "Daily summary",
- "frontpage": "Front page",
- "openPrintPreview": "Open print preview",
- "picasso": "Picasso",
- "printNow": "Print now",
- "selectPrintPreview": "Select print sections:",
- "storyline": "Storyline",
- "title": "Print",
- "toc": "Table of content"
- },
"campSettings": {
"fields": {
"motto": "motto",
@@ -184,20 +172,38 @@
"datetime": {
"date": "dd. D.MM | D. MMM | DD. MMM YYYY"
}
+ }
+ },
+ "print": {
+ "documents": {
+ "pdfDocument": {
+ "filename": {
+ "activitiesOnly": "Activities {camp}",
+ "picassoOnly": "Picasso {camp}"
+ }
+ }
},
- "print": {
- "documents": {
- "pdfDocument": {
- "filename": {
- "activitiesOnly": "Activities {camp}",
- "picassoOnly": "Picasso {camp}"
- }
+ "localPdfDownloadButton": {
+ "error": "Something did not work. Please try again, or try reloading the page."
+ },
+ "printConfigurator": {
+ "config": {
+ "Activity": "Single activity",
+ "Cover": "Cover page",
+ "Picasso": "Picasso",
+ "Story": "Story summary",
+ "Program": "Program",
+ "Toc": "Table of contents",
+ "ProgramConfig": {
+ "dayOverview": "print day overview"
}
- },
- "localPdfDownloadButton": {
- "error": "Something did not work. Please try again, or try reloading the page."
}
},
+ "printPreviewNuxt": {
+ "openPreview": "Open preview in new window"
+ }
+ },
+ "story": {
"storyDay": {
"noStory": "No story content found on this day..."
}
diff --git a/frontend/src/locales/fr.json b/frontend/src/locales/fr.json
index 96b2f4c89f..b783de262a 100644
--- a/frontend/src/locales/fr.json
+++ b/frontend/src/locales/fr.json
@@ -95,18 +95,6 @@
"campPeriodsListItem": {
"deleteWarning": "Voulez-vous vraiment le supprimer ?"
},
- "campPrint": {
- "activities": "Activités",
- "dailySummary": "Résumé quotidien",
- "frontpage": "Page de garde",
- "openPrintPreview": "Ouvrir l'aperçu avant impression",
- "picasso": "Picasso",
- "printNow": "Imprimer maintenant",
- "selectPrintPreview": "Sélectionnez les sections à imprimer :",
- "storyline": "Aperçu de l'histoire",
- "title": "Imprimer",
- "toc": "Table des matières"
- },
"campSettings": {
"fields": {
"motto": "Devise",
@@ -117,7 +105,9 @@
},
"collaboratorListItem": {
"remove": "Supprimer"
- },
+ }
+ },
+ "story": {
"storyDay": {
"noStory": "Aucun contenu d'histoire trouvé ce jour-là..."
}
diff --git a/frontend/src/locales/it.json b/frontend/src/locales/it.json
index f3fa2ea307..ed45b6a043 100644
--- a/frontend/src/locales/it.json
+++ b/frontend/src/locales/it.json
@@ -95,18 +95,6 @@
"campPeriodsListItem": {
"deleteWarning": "Volete davvero cancellarlo?"
},
- "campPrint": {
- "activities": "Attività",
- "dailySummary": "Panoramica giornaliera",
- "frontpage": "Pagina della copertina",
- "openPrintPreview": "Aprire l'anteprima di stampa",
- "picasso": "Picasso",
- "printNow": "Stampa ora",
- "selectPrintPreview": "Selezionare le sezioni di stampa:",
- "storyline": "Panoramica giornaliera",
- "title": "Stampare",
- "toc": "Tabella dei contenuti"
- },
"campSettings": {
"fields": {
"motto": "Motto",
@@ -117,7 +105,9 @@
},
"collaboratorListItem": {
"remove": "Rimuovere"
- },
+ }
+ },
+ "story": {
"storyDay": {
"noStory": "Nessun contenuto di storia trovato in questo giorno..."
}
diff --git a/frontend/src/router.js b/frontend/src/router.js
index cb394dd4d4..045ea890b3 100644
--- a/frontend/src/router.js
+++ b/frontend/src/router.js
@@ -173,32 +173,14 @@ export default new Router({
},
{
path: 'print',
+ name: 'camp/print',
component: () => import(/* webpackChunkName: "campPrint" */ './views/camp/Print.vue'),
- children: [
- {
- path: '',
- name: 'camp/print',
- component: () => import(/* webpackChunkName: "printCamp" */ './views/camp/PrintCamp.vue'),
- props: route => ({ camp: campFromRoute(route) })
- },
- {
- path: 'activity/:scheduleEntryId/:activityName?',
- name: 'camp/print/activity',
- component: () => import(/* webpackChunkName: "printActivity" */ './views/camp/PrintActivity.vue'),
- props: route => ({ scheduleEntry: scheduleEntryFromRoute(route) })
- },
- {
- path: 'period/:periodId/:periodTitle?',
- name: 'camp/print/period',
- component: () => import(/* webpackChunkName: "printActivity" */ './views/camp/PrintPeriod.vue'),
- props: route => ({ period: periodFromRoute(route) })
- }
- ]
+ props: route => ({ camp: campFromRoute(route) })
},
{
path: 'story',
name: 'camp/story',
- component: () => import(/* webpackChunkName: "campPrint" */ './views/camp/Story.vue')
+ component: () => import(/* webpackChunkName: "campStory" */ './views/camp/Story.vue')
},
{
path: 'material',
diff --git a/frontend/src/views/activity/Activity.vue b/frontend/src/views/activity/Activity.vue
index be9a150e2f..d1d7cd740b 100644
--- a/frontend/src/views/activity/Activity.vue
+++ b/frontend/src/views/activity/Activity.vue
@@ -73,22 +73,8 @@ Displays a single activity
{{ $tc('views.activity.activity.back') }}
-
-
-
-
- mdi-printer
-
-
- {{ $tc('views.activity.printPreview') }}
-
-
+
+
@@ -156,7 +142,8 @@ import RootNode from '@/components/activity/RootNode.vue'
import ActivityResponsibles from '@/components/activity/ActivityResponsibles.vue'
import { rangeShort } from '@/common/helpers/dateHelperUTCFormatted.js'
import { campRoleMixin } from '@/mixins/campRoleMixin'
-import LocalPdfDownloadButton from '@/components/print/print-react/LocalPdfDownloadButton.vue'
+import PdfDownloadButtonReact from '@/components/print/print-react/PdfDownloadButtonReact.vue'
+import PdfDownloadButtonNuxt from '@/components/print/print-nuxt/PdfDownloadButtonNuxt.vue'
export default {
name: 'Activity',
@@ -165,7 +152,8 @@ export default {
ApiTextField,
RootNode,
ActivityResponsibles,
- LocalPdfDownloadButton
+ PdfDownloadButtonReact,
+ PdfDownloadButtonNuxt
},
mixins: [campRoleMixin],
props: {
@@ -226,7 +214,7 @@ export default {
},
printConfig () {
return {
- camp: () => this.camp,
+ camp: this.camp._meta.self,
language: this.$store.state.lang.language,
documentName: this.activity.title + '.pdf',
contents: [
diff --git a/frontend/src/views/camp/CampProgram.vue b/frontend/src/views/camp/CampProgram.vue
index f2efab4802..49c2b32e62 100644
--- a/frontend/src/views/camp/CampProgram.vue
+++ b/frontend/src/views/camp/CampProgram.vue
@@ -21,16 +21,9 @@ Show all activity schedule entries of a single period.
{{ $tc('views.camp.picasso.guestsCannotEdit') }}
-
- mdi-printer
-
+
-
+
@@ -57,16 +50,14 @@ import ContentCard from '@/components/layout/ContentCard.vue'
import Picasso from '@/components/program/picasso/Picasso.vue'
import ScheduleEntries from '@/components/program/ScheduleEntries.vue'
import PeriodSwitcher from '@/components/program/PeriodSwitcher.vue'
-import LocalPdfDownloadButton from '@/components/print/print-react/LocalPdfDownloadButton.vue'
-
-import axios from 'axios'
-
-const PRINT_SERVER = window.environment.PRINT_SERVER
+import PdfDownloadButtonReact from '@/components/print/print-react/PdfDownloadButtonReact.vue'
+import PdfDownloadButtonNuxt from '@/components/print/print-nuxt/PdfDownloadButtonNuxt.vue'
export default {
name: 'CampProgram',
components: {
- LocalPdfDownloadButton,
+ PdfDownloadButtonReact,
+ PdfDownloadButtonNuxt,
PeriodSwitcher,
ContentCard,
Picasso,
@@ -90,7 +81,7 @@ export default {
methods: {
printConfig () {
return {
- camp: () => this.period().camp(),
+ camp: this.period().camp()._meta.self,
language: this.$store.state.lang.language,
documentName: this.camp.title + '-picasso.pdf',
contents: [
@@ -105,40 +96,6 @@ export default {
}
]
}
- },
- async print () {
- console.log('Printing now')
-
- const title = 'PrintedByBrowserless.pdf'
-
- this.isPrinting = true
-
- try {
- const response = await axios({
- method: 'get',
- url: `${PRINT_SERVER}/server/pdf?period=${this.period()._meta.self}`,
- responseType: 'arraybuffer',
- withCredentials: true,
- headers: {
- 'Cache-Control': 'no-cache',
- Pragma: 'no-cache',
- Expires: '0'
- }
- })
- this.forceFileDownload(response, title)
- } catch (error) {
- console.log(error)
- } finally {
- this.isPrinting = false
- }
- },
- forceFileDownload (response, title) {
- const url = window.URL.createObjectURL(new Blob([response.data]))
- const link = document.createElement('a')
- link.href = url
- link.setAttribute('download', title)
- document.body.appendChild(link)
- link.click()
}
}
}
diff --git a/frontend/src/views/camp/Print.vue b/frontend/src/views/camp/Print.vue
index 9acdf8eb41..0ead9c5618 100644
--- a/frontend/src/views/camp/Print.vue
+++ b/frontend/src/views/camp/Print.vue
@@ -5,18 +5,23 @@ Basic layout for print preview
-
+
-
-
diff --git a/frontend/src/views/camp/PrintCamp.vue b/frontend/src/views/camp/PrintCamp.vue
deleted file mode 100644
index 136165c4a8..0000000000
--- a/frontend/src/views/camp/PrintCamp.vue
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/frontend/src/views/camp/PrintPeriod.vue b/frontend/src/views/camp/PrintPeriod.vue
deleted file mode 100644
index f688bfd8b6..0000000000
--- a/frontend/src/views/camp/PrintPeriod.vue
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
- print Period
- {{ period().id }}
-
-
-
-
-
-
diff --git a/print/assets/tailwind.css b/print/assets/tailwind.css
new file mode 100644
index 0000000000..6cd9a458d2
--- /dev/null
+++ b/print/assets/tailwind.css
@@ -0,0 +1 @@
+/* global css styling */
\ No newline at end of file
diff --git a/print/assets/toc.css b/print/assets/toc.css
new file mode 100644
index 0000000000..fc8207f0d4
--- /dev/null
+++ b/print/assets/toc.css
@@ -0,0 +1,60 @@
+/* mostly copied from https://gitlab.coko.foundation/pagedjs/pagedjs-documentation/-/blob/master/Part09_Table-of-content.md */
+
+ul.toc {
+ list-style: none;
+}
+
+ul.toc .toc-element a::after {
+ content: target-counter(attr(href url), page);
+ float: right;
+}
+
+ul.toc .toc-element-level-1 {
+ margin-top: 25px;
+ font-weight: bold;
+}
+
+
+ul.toc .toc-element-level-2 {
+ margin-left: 25px;
+}
+
+/* leader() doesn't work for now, replace with the hack bellow */
+
+/* ul.toc .toc-element a::after{
+ content: leader('.') " p. " target-counter(attr(href), page);
+ float: right;
+} */
+
+/* hack for leaders */
+
+/* stylelint-disable no-duplicate-selectors */
+ul.toc {
+ overflow: visible;
+}
+
+ul.toc .toc-element::after {
+ content: " ";
+ flex: 1;
+ border-bottom: 0.1em dotted rgb(156 163 175);
+}
+
+ul.toc .toc-element {
+ display: flex;
+ margin-bottom: 0.4em;
+}
+
+ul.toc .toc-element a::after {
+ position: absolute;
+ right: 0;
+ background-color: white;
+ padding-left: 6px;
+}
+
+ul.toc .toc-element a {
+ right: 0;
+ height: 1.05em;
+ margin-right: 0.2em;
+}
+
+/* stylelint-enable no-duplicate-selectors */
\ No newline at end of file
diff --git a/print/assets/typography.css b/print/assets/typography.css
new file mode 100644
index 0000000000..ec307fde82
--- /dev/null
+++ b/print/assets/typography.css
@@ -0,0 +1,3 @@
+html {
+ font-size: 10pt !important
+}
\ No newline at end of file
diff --git a/print/components/FrontPage.vue b/print/components/FrontPage.vue
deleted file mode 100644
index 2839aa14f5..0000000000
--- a/print/components/FrontPage.vue
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
{{ $tc('welcome.print') }}
-
-
{{ $tc('welcome.common') }}
-
-
Title page
-
-
Name: {{ camp.name }}
-
Title: {{ camp.title }}
-
Motto: {{ camp.motto }}
-
-
- {{ period.id }} // {{ period.description }}
-
-
-
-
-
-
-
-
-
diff --git a/print/components/Picasso.vue b/print/components/Picasso.vue
index b4c9186644..36a9db574b 100644
--- a/print/components/Picasso.vue
+++ b/print/components/Picasso.vue
@@ -3,7 +3,13 @@
- Picasso
+
+ {{ $tc('print.picasso.title') }}: {{ $tc('entity.period.name') }}
+ {{ period.description }}
+
({
today: '2019-01-08',
diff --git a/print/components/Program.vue b/print/components/Program.vue
deleted file mode 100644
index 170808ef62..0000000000
--- a/print/components/Program.vue
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
Detail program
-
-
-
-
-
-
-
-
-
-
diff --git a/print/components/ProgramDay.vue b/print/components/ProgramDay.vue
index 62939d6b78..b328802190 100644
--- a/print/components/ProgramDay.vue
+++ b/print/components/ProgramDay.vue
@@ -1,27 +1,33 @@
-
-
-
-
Daily summary of day {{ day.dayOffset }}
-
+
+
+
+ {{ $tc('entity.day.name') }} {{ day.number }} ({{
+ dateLong(day.start)
+ }})
+
+
-
-
-
+
+
+
+
-
-
diff --git a/print/components/ProgramPeriod.vue b/print/components/ProgramPeriod.vue
index 5c507e77c0..88ba3600f7 100644
--- a/print/components/ProgramPeriod.vue
+++ b/print/components/ProgramPeriod.vue
@@ -1,19 +1,21 @@
-
-
-
-
Period {{ period.description }}
-
+
+
+
+ {{ $tc('print.program.title') }}: {{ $tc('entity.period.name') }}
+ {{ period.description }}
+
+
-
-
-
+
+
-
-
diff --git a/print/components/ProgramScheduleEntry.vue b/print/components/ProgramScheduleEntry.vue
deleted file mode 100644
index a344f3c2a3..0000000000
--- a/print/components/ProgramScheduleEntry.vue
+++ /dev/null
@@ -1,96 +0,0 @@
-
-
-
- {{ $fetchState.error.message }}
-
-
- {{ scheduleEntry.number }}
- {{ category.short }}
- {{ activity.title }}
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/print/components/RichText.vue b/print/components/RichText.vue
index 1e9503b0e1..40e39f7819 100644
--- a/print/components/RichText.vue
+++ b/print/components/RichText.vue
@@ -1,4 +1,5 @@
+
diff --git a/print/components/Story.vue b/print/components/Story.vue
new file mode 100644
index 0000000000..f03129cd38
--- /dev/null
+++ b/print/components/Story.vue
@@ -0,0 +1,24 @@
+
+
+
+ {{ $tc('print.story.title') }}: {{ $tc('entity.period.name') }}
+ {{ period.description }}
+
+
+
+
+
diff --git a/print/components/Storyline.vue b/print/components/Storyline.vue
deleted file mode 100644
index 124bdca9a4..0000000000
--- a/print/components/Storyline.vue
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
Story line
-
-
-
-
-
-
-
-
diff --git a/print/components/TableOfContent.vue b/print/components/TableOfContent.vue
deleted file mode 100644
index 94b6387bbf..0000000000
--- a/print/components/TableOfContent.vue
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/print/components/Toc/TocActivity.vue b/print/components/Toc/TocActivity.vue
new file mode 100644
index 0000000000..a2685d22b4
--- /dev/null
+++ b/print/components/Toc/TocActivity.vue
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
diff --git a/print/components/Toc/TocCover.vue b/print/components/Toc/TocCover.vue
new file mode 100644
index 0000000000..8286011caa
--- /dev/null
+++ b/print/components/Toc/TocCover.vue
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
diff --git a/print/components/Toc/TocPicasso.vue b/print/components/Toc/TocPicasso.vue
new file mode 100644
index 0000000000..c54bdfd47f
--- /dev/null
+++ b/print/components/Toc/TocPicasso.vue
@@ -0,0 +1,39 @@
+
+
+
+ {{ $tc('print.picasso.title') }}
+
+
+
+
+
+
diff --git a/print/components/Toc/TocProgram.vue b/print/components/Toc/TocProgram.vue
new file mode 100644
index 0000000000..556603f7aa
--- /dev/null
+++ b/print/components/Toc/TocProgram.vue
@@ -0,0 +1,38 @@
+
+
+
+ {{ $tc('print.program.title') }}
+
+
+
+
+
+
diff --git a/print/components/Toc/TocProgramDay.vue b/print/components/Toc/TocProgramDay.vue
new file mode 100644
index 0000000000..9db305f8fa
--- /dev/null
+++ b/print/components/Toc/TocProgramDay.vue
@@ -0,0 +1,37 @@
+
+
+ {{ $tc('entity.day.name') }} {{ day.number }} ({{ dateLong(day.start) }})
+
+
+
+
+
+
diff --git a/print/components/Toc/TocProgramPeriod.vue b/print/components/Toc/TocProgramPeriod.vue
new file mode 100644
index 0000000000..74ae51c7af
--- /dev/null
+++ b/print/components/Toc/TocProgramPeriod.vue
@@ -0,0 +1,32 @@
+
+
+ {{ $tc('entity.period.name') }} {{ period.description }}
+
+
+
+
+
+
diff --git a/print/components/Toc/TocScheduleEntry.vue b/print/components/Toc/TocScheduleEntry.vue
new file mode 100644
index 0000000000..b18946567a
--- /dev/null
+++ b/print/components/Toc/TocScheduleEntry.vue
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
diff --git a/print/components/Toc/TocStory.vue b/print/components/Toc/TocStory.vue
new file mode 100644
index 0000000000..04aa0eb346
--- /dev/null
+++ b/print/components/Toc/TocStory.vue
@@ -0,0 +1,39 @@
+
+
+
+ {{ $tc('print.story.title') }}
+
+
+
+
+
+
diff --git a/print/components/Toc/TocToc.vue b/print/components/Toc/TocToc.vue
new file mode 100644
index 0000000000..621ad9b832
--- /dev/null
+++ b/print/components/Toc/TocToc.vue
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
diff --git a/print/components/config/Activity.vue b/print/components/config/Activity.vue
new file mode 100644
index 0000000000..17e074245e
--- /dev/null
+++ b/print/components/config/Activity.vue
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
diff --git a/print/components/config/Cover.vue b/print/components/config/Cover.vue
new file mode 100644
index 0000000000..e06ed057d7
--- /dev/null
+++ b/print/components/config/Cover.vue
@@ -0,0 +1,31 @@
+
+
+
+ {{ camp.name }}
+
+
+
+ {{ $tc('entity.camp.fields.title') }}:
+ {{ camp.title }}
+
+
+ {{ $tc('entity.camp.fields.motto') }}:
+ {{ camp.motto }}
+
+
+
+
+
diff --git a/print/components/config/Picasso.vue b/print/components/config/Picasso.vue
new file mode 100644
index 0000000000..fa36573f09
--- /dev/null
+++ b/print/components/config/Picasso.vue
@@ -0,0 +1,35 @@
+
+
+
+
+
diff --git a/print/components/config/Program.vue b/print/components/config/Program.vue
new file mode 100644
index 0000000000..fdb10957ac
--- /dev/null
+++ b/print/components/config/Program.vue
@@ -0,0 +1,36 @@
+
+
+
+
+
diff --git a/print/components/config/Story.vue b/print/components/config/Story.vue
new file mode 100644
index 0000000000..add71e7917
--- /dev/null
+++ b/print/components/config/Story.vue
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
diff --git a/print/components/config/Toc.vue b/print/components/config/Toc.vue
new file mode 100644
index 0000000000..68b96d5e79
--- /dev/null
+++ b/print/components/config/Toc.vue
@@ -0,0 +1,35 @@
+
+
+
+ {{ $tc('print.toc.title') }}
+
+
+
+
+
+
diff --git a/print/components/scheduleEntry/ScheduleEntry.vue b/print/components/scheduleEntry/ScheduleEntry.vue
index 1bf86e650c..1c54a10373 100644
--- a/print/components/scheduleEntry/ScheduleEntry.vue
+++ b/print/components/scheduleEntry/ScheduleEntry.vue
@@ -1,13 +1,19 @@
-
-
-
+
+
+
{{ scheduleEntry.number }}
{{ scheduleEntry.activity().title }}
-