diff --git a/src/components/CompareProject.vue b/src/components/CompareProject.vue index 6aa64a2..59aa847 100644 --- a/src/components/CompareProject.vue +++ b/src/components/CompareProject.vue @@ -1,7 +1,9 @@ diff --git a/src/components/DigitizeProject.vue b/src/components/DigitizeProject.vue index f1b790e..38a4fee 100644 --- a/src/components/DigitizeProject.vue +++ b/src/components/DigitizeProject.vue @@ -1,10 +1,12 @@ diff --git a/src/components/FindProject.vue b/src/components/FindProject.vue index 8bcd938..53140f0 100644 --- a/src/components/FindProject.vue +++ b/src/components/FindProject.vue @@ -1,10 +1,12 @@ diff --git a/src/components/MediaProject.vue b/src/components/MediaProject.vue index 2e25fee..ba78897 100644 --- a/src/components/MediaProject.vue +++ b/src/components/MediaProject.vue @@ -1,7 +1,9 @@ diff --git a/src/components/ProjectInfo.vue b/src/components/ProjectInfo.vue new file mode 100644 index 0000000..55b1f64 --- /dev/null +++ b/src/components/ProjectInfo.vue @@ -0,0 +1,138 @@ + + + + + diff --git a/src/components/ValidateProject.vue b/src/components/ValidateProject.vue index f5e5640..87768cc 100644 --- a/src/components/ValidateProject.vue +++ b/src/components/ValidateProject.vue @@ -1,10 +1,12 @@ diff --git a/src/i18n/locales/de.json b/src/i18n/locales/de.json index 9e47122..a993c8d 100644 --- a/src/i18n/locales/de.json +++ b/src/i18n/locales/de.json @@ -141,26 +141,35 @@ "resetView": "Ansicht zurücksetzen", "close": "Schließen" }, + "projectInstructions": { + "classifyTitle": "Klicke oder tippe, um zu klassifizieren", + "classifyInstruction": "Klicke oder tippe auf jede Bildkachel, bis die passende Antwort erscheint", + "imageCredits": "Bildnachweis", + "move": "Zurück und weiter bewegen", + "resetTitle": "Ansicht zurücksetzen", + "resetInstruction": "Zoom auf die aktuelle Geometrie", + "saveYourAnswers": "Speichere deine Antworten", + "seenAll": "sobald du alle Bildkacheln gesehen und klassifiziert hast", + "toggleOpacityTitle": "Transparenz umschalten", + "toggleOpacityInstruction": "Schalte die Transparenz der oberen Schicht für eine bessere Sicht auf die Bildkacheln um", + "useButtonsToNavigate": "Navigationstasten", + "whereIamTitle": "Wo bin ich?", + "whereIamInstruction": "Öffne eine Karte, um zu sehen wo du gerade beiträgst" + }, "findProjectInstructions": { "howToContribute": "Wie kann ich beitragen?", - "classifyInstruction": "Klicke oder tippe auf jede Bildkachel, bis die passende Antwort erscheint", - "classifyTitle": "Klicke oder tippe, um zu klassifizieren", "close": "Schließen", "moreInfo": "Mehr Info", + "moveLeft": "Vorherige Seite", + "moveRight": "Nächste Seite", "selectionTitle": "Mehrere Bildkacheln auswählen", "selectTile": "... oder Rechtsklick/Halten, um die Bildkachel der Auswahl hinzuzufügen. Wiederholen, um sie von der Auswahl zu entfernen", "selectAll": "Alle Bildkacheln der aktuellen Ansicht auswählen. Wiederholen, um die Auswahl zu leeren", "selectionInstruction": "Jeder Klick zur Klassifizierung wird auf alle Bildkacheln in der Auswahl angewandt", - "useButtonsToNavigate": "Navigationstasten", "moveColumn": "Spaltenweise links/rechts bewegen", "movePage": "Seitenweise links/rechts bewegen", - "toggleOpacityTitle": "Transparenz umschalten", - "toggleOpacityInstruction": "Schalte die Transparenz der oberen Schicht für eine bessere Sicht auf die Bildkacheln um", "haveCloserLook": "Schau genauer hin", - "magnifyInstruction": "Klicke das Symbol in der oberen rechten Ecke der Bildkachel, um das Bild zu vergrößern", - "saveYourAnswers": "Speichere deine Antworten", - "seenAll": ", sobald du alle Bildkacheln gesehen und klassifiziert hast", - "imageCredits": "Bildnachweis" + "magnifyInstruction": "Klicke das Symbol in der oberen rechten Ecke der Bildkachel, um das Bild zu vergrößern" }, "validateProject": { "doesTheShapeOutline": "Ist der Umriss ein {feature}?", @@ -168,14 +177,13 @@ "moveRight": "Weiter zum nächsten Umriss" }, "validateProjectInstructions": { - "resetTitle": "Ansicht zurücksetzen", - "resetInstruction": "Zoom auf die aktuelle Geometrie", "seenAll": "sobald du alle Umrisse gesehen und klassifiziert hast.", "classifyInstruction": "Benutze die Buttons, um deine Antwort zu geben" }, "compareProject": { "before": "Vorher", - "after": "Nachher" + "after": "Nachher", + "lookForChange": "Vergleiche {lookFor}" }, "digitizeProject": { "moveLeft": "Zurück", @@ -184,10 +192,6 @@ "modify": "Bearbeiten", "delete": "Löschen" }, - "compareProjectInstructions": { - "whereIamTitle": "Wollen Sie wissen, wo Sie kartieren?", - "whereIamInstruction": "Öffne eine Karte wo du gerade beiträgst" - }, "mediaProject": { "moveLeft": "Zurück", "moveRight": "Weiter" @@ -196,7 +200,6 @@ "switchMode": "Editiermodus umschalten", "drawNewFeature": "Neue Objekte einzeichnen", "modifyFeature": "Objekte bearbeiten", - "deleteFeature": "Objekte löschen", - "move": "Zurück und weiter bewegen" + "deleteFeature": "Objekte löschen" } } diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 2c16633..df70037 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -141,26 +141,36 @@ "resetView": "Reset view", "close": "Close" }, + "projectInstructions": { + "classifyTitle": "Click or tap to classify", + "classifyInstruction": "Use buttons to provide your answers", + "imageCredits": "Image credits", + "move": "Move back and forward", + "resetInstruction": "Zoom to the current shape", + "resetTitle": "Reset the view", + "saveYourAnswers": "Save your answers", + "seenAll": "as soon as you have seen and classified all images", + "toggleOpacityTitle": "Toggle the overlay opacity", + "toggleOpacityInstruction": "For a clearer view of the underlying imagery, toggle the opacity of the overlay", + "useButtonsToNavigate": "Use buttons to navigate", + "whereIamTitle": "Where am I mapping?", + "whereIamInstruction": "Open a map of where you are currently contributing" + }, "findProjectInstructions": { "howToContribute": "How to Contribute?", - "classifyTitle": "Click or tap to classify", "classifyInstruction": "Click or tap each image tile, until the appropriate answer appears", "close": "Close", "moreInfo": "More Info", + "moveLeft": "Back to previous page", + "moveRight": "Go to next page", "selectionTitle": "Select multiple tiles", "selectTile": "... or right click/hold touch to add a tile to the selection. Repeat to remove the tile from the selection", "selectAll": "Select all tiles in view. Repeat to clear selection", "selectionInstruction": "Any click to classify applies to all selected tiles", - "useButtonsToNavigate": "Use buttons to navigate", "moveColumn": "Move left/right by column", "movePage": "Move left/right by page", - "toggleOpacityTitle": "Toggle the overlay opacity", - "toggleOpacityInstruction": "For a clearer view of the underlying imagery, toggle the opacity of the overlay", "haveCloserLook": "Have a closer look", - "magnifyInstruction": "Click this icon in the upper right corner of a tile to magnify the image", - "saveYourAnswers": "Save your answers", - "seenAll": "as soon as you have seen and classified all images", - "imageCredits": "Image credits" + "magnifyInstruction": "Click this icon in the upper right corner of a tile to magnify the image" }, "validateProject": { "doesTheShapeOutline": "Does the shape outline a {feature}?", @@ -168,10 +178,7 @@ "moveRight": "Forward to next feature" }, "validateProjectInstructions": { - "resetTitle": "Reset the view", - "resetInstruction": "Zoom to the current shape", - "seenAll": "as soon as you have seen and classified all the features.", - "classifyInstruction": "Use buttons to provide your answers" + "seenAll": "as soon as you have seen and classified all the features." }, "compareProject": { "before": "Before", @@ -185,10 +192,6 @@ "modify": "Modify", "delete": "Delete" }, - "compareProjectInstructions": { - "whereIamTitle": "Where am I mapping?", - "whereIamInstruction": "Open a map of where you are currently contributing" - }, "mediaProject": { "moveLeft": "Back", "moveRight": "Forward" @@ -197,7 +200,6 @@ "switchMode": "Switch editing mode", "drawNewFeature": "Draw new features", "modifyFeature": "Modify features", - "deleteFeature": "Delete features", - "move": "Move back and forward" + "deleteFeature": "Delete features" } } diff --git a/src/utils/createInformationPages.ts b/src/utils/createInformationPages.ts new file mode 100644 index 0000000..e858400 --- /dev/null +++ b/src/utils/createInformationPages.ts @@ -0,0 +1,14 @@ +const createInformationPages = (tutorial, project, fallbackFn) => { + let informationPages = [] + if (tutorial) { + // We want to show the information pages for a project + informationPages = tutorial.informationPages || fallbackFn(tutorial) + } else { + // We want to show the information pages for a tutorial. + informationPages = project.informationPages || fallbackFn(project) + } + informationPages?.sort((a, b) => a.pageNumber - b.pageNumber) + return informationPages +} + +export default createInformationPages diff --git a/src/views/ProjectView.vue b/src/views/ProjectView.vue index 81ca8ca..1392524 100644 --- a/src/views/ProjectView.vue +++ b/src/views/ProjectView.vue @@ -43,6 +43,7 @@ export default defineComponent({ project: null, projectContributions: [], tasks: null, + tutorial: null, to: null, } }, @@ -116,6 +117,9 @@ export default defineComponent({ onValue(getProjectRef(this.projectId), (snapshot) => { const data = snapshot.val() || {} this.project = data + if (this.project?.tutorialId) { + this.bindTutorial() + } }) }, bindProjectContributions() { @@ -157,6 +161,12 @@ export default defineComponent({ this.tasks = tasks }) }, + bindTutorial() { + onValue(getProjectRef(this.project?.tutorialId), (snapshot) => { + const data = snapshot.val() || {} + this.tutorial = data + }) + }, completeOptions(option, index) { option.title ??= option.label option.iconColor ??= option.color || '#d1dad1' @@ -243,6 +253,7 @@ export default defineComponent({ :options="options" :project="project" :tasks="tasks" + :tutorial="tutorial" @created="handleTaskComponentCreated" />