,
title: TagRenderingOptions | UIElement,
@@ -41,14 +45,28 @@ export class FeatureInfoBox extends UIElement {
this._userDetails = userDetails;
this.ListenTo(userDetails);
- const deps = {tags:this._tagsES , changes:this._changes}
-
+ const deps = {tags: this._tagsES, changes: this._changes}
+
this._infoboxes = [];
elementsToShow = elementsToShow ?? []
+
+ const self = this;
for (const tagRenderingOption of elementsToShow) {
- this._infoboxes.push(
+ self._infoboxes.push(
tagRenderingOption.construct(deps));
}
+ function initTags() {
+ self._infoboxes = []
+ for (const tagRenderingOption of elementsToShow) {
+ self._infoboxes.push(
+ tagRenderingOption.construct(deps));
+ }
+ self.Update();
+ }
+
+ this._someSkipped.onClick(initTags)
+ this._oneSkipped.onClick(initTags)
+
title = title ?? new TagRenderingOptions(
{
@@ -71,13 +89,16 @@ export class FeatureInfoBox extends UIElement {
const info = [];
- const questions : TagDependantUIElement[] = [];
-
+ const questions: TagDependantUIElement[] = [];
+ let skippedQuestions = 0;
for (const infobox of this._infoboxes) {
if (infobox.IsKnown()) {
info.push(infobox);
} else if (infobox.IsQuestioning()) {
questions.push(infobox);
+ } else {
+ // This question is neither known nor questioning -> it was skipped
+ skippedQuestions++;
}
}
@@ -97,6 +118,10 @@ export class FeatureInfoBox extends UIElement {
}
questionsHtml = mostImportantQuestion.Render();
+ } else if (skippedQuestions == 1) {
+ questionsHtml = this._oneSkipped.Render();
+ } else if (skippedQuestions > 0) {
+ questionsHtml = this._someSkipped.Render();
}
return "" +
diff --git a/UI/i18n/Translation.ts b/UI/i18n/Translation.ts
index 2ed7484..c02f842 100644
--- a/UI/i18n/Translation.ts
+++ b/UI/i18n/Translation.ts
@@ -36,4 +36,8 @@ export default class Translation extends UIElement {
return new Translation(this.translations).Render();
}
+ public Clone(){
+ return new Translation(this.translations)
+ }
+
}
diff --git a/UI/i18n/Translations.ts b/UI/i18n/Translations.ts
index b22dd25..b954ac5 100644
--- a/UI/i18n/Translations.ts
+++ b/UI/i18n/Translations.ts
@@ -372,6 +372,14 @@ export default class Translations {
skip: new T({
en: "Skip this question",
nl: "Vraag overslaan"
+ }),
+ oneSkippedQuestion: new T({
+ en: "One question is skipped",
+ nl: "Een vraag is overgeslaan"
+ }),
+ skippedQuestions: new T({
+ en: "Some questions are skipped",
+ nl: "Sommige vragen zijn overgeslaan"
})
}
}
diff --git a/docs/Create a theme.md b/docs/Create a theme.md
new file mode 100644
index 0000000..778b98a
--- /dev/null
+++ b/docs/Create a theme.md
@@ -0,0 +1,14 @@
+# Create a theme
+
+
+
+A _layer_ is a set of features of a single kind, e.g. 'bookcases'.
+A _layout_ is a set of layers, e.g. 'bookcases' + 'nature reserves'. They are shown together with some text on the left. They can be switched with the query parameter 'layout' in the url (thus by going to 'index.html?layout=bookcases')
+
+If you want to make your own version of MapComplete, you create your own layout
+
+- Clone the repo
+- Build it
+- Go into 'Customazations/Layouts' and copy a file there (e.g. bookcases)
+- Change the text and layer selection
+- Create you layers
\ No newline at end of file