From 46dbedbd451217cd22d10e9d8cd208d4706771b8 Mon Sep 17 00:00:00 2001 From: WriterV2 Date: Sat, 28 Jan 2023 11:50:37 +0100 Subject: Remove story-type attribute and filter --- docs/stories.html | 71 ++++++++++++-------------------------------------- docs/stories.js | 10 ++----- src/works/stories.rs | 1 - stories.json | 11 -------- templates/stories.html | 26 +++++++----------- 5 files changed, 28 insertions(+), 91 deletions(-) diff --git a/docs/stories.html b/docs/stories.html index 6f2a47c..0f1c88a 100644 --- a/docs/stories.html +++ b/docs/stories.html @@ -21,74 +21,37 @@
- + - -
-
-

Mit gutem Gewissen

-

Lorem ipsum dolor sit amet, officia excepteur.

-
-
- 7 Pages - German - Shortstory -
+
+

Mit gutem Gewissen

+

Lorem ipsum dolor sit amet, officia excepteur.

+
+
+ 7 Pages + German +
-
-

Das schweigende Spiegelbild

-

Em pariatur mollit ex esse exercitation amet. Nisi anim cupidatat excepteur officia.

-
-
- 2 Pages - German - Shortstory -
-
- - -
-

Hubristic Failures

-

Ui minim labore adipisicing minim sint cillum sint consectetur cupidatat.ex esse exercitation idatat excepteur officia.

-
-
- 2 Pages - English - Screenplay -
-
- - -
-

Hubristic Failures

-

Ui minim labore adipisicing minim sint cillum sint consectetur cupidatat.ex esse exercitation idatat excepteur officia.

-
-
- 2 Pages - English - Screenplay -
+
+

Das schweigende Spiegelbild

+

Em pariatur mollit ex esse exercitation amet. Nisi anim cupidatat excepteur officia.

+
+
+ 2 Pages + German +
diff --git a/docs/stories.js b/docs/stories.js index e5a57ec..cb39b0c 100644 --- a/docs/stories.js +++ b/docs/stories.js @@ -1,14 +1,12 @@ // every story card const workCards = document.querySelectorAll(".work-card"); -// story type select input -const storyTypeSelect = document.querySelector("#story-type-select"); // language select input const languageSelect = document.querySelector("#language-select"); // copy of works with all work cards const works = Array.from(document.querySelector(".works").children); -// filter cards based on storytype and language filter +// filter cards based on language filter function filterWorkCards() { // restore initial state with all cards // (TODO: Explore more efficient solutions without another loop) @@ -17,18 +15,14 @@ function filterWorkCards() { document.querySelector(".works").appendChild(card); }) - // filter card if language or story type filter doesn't match + // filter card if language doesn't match workCards.forEach((card) => { if (languageSelect.value != "*" && card.querySelector(".story-language").innerHTML != languageSelect.value) { document.querySelector(".works").removeChild(card); - } else if (storyTypeSelect.value != "*" && card.querySelector(".story-type").innerHTML != storyTypeSelect.value) { - document.querySelector(".works").removeChild(card); } }) } // filter cards when -// story type selection changes -storyTypeSelect.addEventListener("change", filterWorkCards); // language selection changes languageSelect.addEventListener("change", filterWorkCards); diff --git a/src/works/stories.rs b/src/works/stories.rs index 11a32e0..bca5909 100644 --- a/src/works/stories.rs +++ b/src/works/stories.rs @@ -13,7 +13,6 @@ pub struct Story { pub description: String, pub path_to_document: String, pub number_of_pages: u16, - pub story_type: String, pub language: Language, } diff --git a/stories.json b/stories.json index af73d96..e4e9192 100644 --- a/stories.json +++ b/stories.json @@ -5,7 +5,6 @@ "description": "Lorem ipsum dolor sit amet, officia excepteur.", "path_to_document": "./stories/mit_gutem_gewissen.pdf", "number_of_pages": 7, - "story_type": "Shortstory", "language": "German" }, { @@ -14,16 +13,6 @@ "description": "Em pariatur mollit ex esse exercitation amet. Nisi anim cupidatat excepteur officia.", "path_to_document": "./stories/das_schweigende_spiegelbild.pdf", "number_of_pages": 2, - "story_type": "Shortstory", "language": "German" - }, - { - "id": 3, - "title": "Hubristic Failures", - "description": "Ui minim labore adipisicing minim sint cillum sint consectetur cupidatat.ex esse exercitation idatat excepteur officia.", - "path_to_document": "./stories/hubristic_failures.pdf", - "number_of_pages": 2, - "story_type": "Screenplay", - "language": "English" } ] diff --git a/templates/stories.html b/templates/stories.html index 46c0698..9097ba0 100644 --- a/templates/stories.html +++ b/templates/stories.html @@ -3,34 +3,26 @@ {% block content %}
- + - -
{% for work in works %} -
-

{{work.title}}

-

{{work.description}}

-
-
- {{work.number_of_pages}} Pages - {{work.language}} - {{work.story_type}} -
+
+

{{work.title}}

+

{{work.description}}

+
+
+ {{work.number_of_pages}} Pages + {{work.language}} +
{% endfor %}
-- cgit v1.2.3