From 10c86197f1f63e222dfc9e937911e35ab500a208 Mon Sep 17 00:00:00 2001 From: Jonathan Tschanter Date: Sat, 22 Jan 2022 21:24:24 +0100 Subject: Adds edit cards and templates to include --- templates/artwork/artwork_template.twig | 54 +++++++++++++++++ templates/artwork/artwork_view.twig | 10 ++++ templates/base.twig | 30 +++++++--- templates/card/card.twig | 13 ++-- templates/card/card_add.twig | 43 ++++--------- templates/card/card_display.twig | 48 --------------- templates/card/card_edit.twig | 30 +++------- templates/card/card_list.twig | 43 ++++--------- templates/card/card_meta_template.twig | 21 +++++++ templates/card/card_template.twig | 103 ++++++++++++++++++++++++++++++++ templates/card/card_view.twig | 11 ++++ templates/dashboard.twig | 58 +++++++++--------- templates/root.twig | 11 ++-- 13 files changed, 293 insertions(+), 182 deletions(-) create mode 100644 templates/artwork/artwork_template.twig create mode 100644 templates/artwork/artwork_view.twig delete mode 100644 templates/card/card_display.twig create mode 100644 templates/card/card_meta_template.twig create mode 100644 templates/card/card_template.twig create mode 100644 templates/card/card_view.twig (limited to 'templates') diff --git a/templates/artwork/artwork_template.twig b/templates/artwork/artwork_template.twig new file mode 100644 index 0000000..fe55f6a --- /dev/null +++ b/templates/artwork/artwork_template.twig @@ -0,0 +1,54 @@ +{% if artworkSettings.isPreview == true %} +
+ {% if artworkSettings.artworkHeader != "" %} +

{{ artworkSettings.artworkHeader }}

+ {% endif %} + +
+
+ {% if artworkSettings.isVotable == true %} + + + {{ artwork.getVotesTotal() }} + + {% endif %} +
+
+
+ +
+
+ +
+
+
+
+{% else %} +
+

Artwork

+
+ +
+ + + +
+ +
+
+
+ {% if artworkSettings.isVotable == true %} + + + {{ artwork.getVotesTotal() }} + + {% endif %} +
+
+
+ +
+
+
+
+{% endif %} diff --git a/templates/artwork/artwork_view.twig b/templates/artwork/artwork_view.twig new file mode 100644 index 0000000..3eb1c65 --- /dev/null +++ b/templates/artwork/artwork_view.twig @@ -0,0 +1,10 @@ +{% extends 'card/card.twig' %} + +{% block pagecontent %} + {% set artworkSettings = { + "artworkHeader": "", + "isPreview": false, + "isVotable": true + } %} + {{ include('artwork/artwork_template.twig') }} +{% endblock %} \ No newline at end of file diff --git a/templates/base.twig b/templates/base.twig index 758b6f8..825c09c 100644 --- a/templates/base.twig +++ b/templates/base.twig @@ -4,21 +4,37 @@ {{ parent() }} + + + + + +{% endblock %} - - +{% block js %} + {{ parent() }} + + + + + + {% endblock %} {% block body %}

Elements

{% block subtitle %}{% endblock %}

@@ -27,6 +43,6 @@ {% block main %}{% endblock %} {% endblock %} diff --git a/templates/card/card.twig b/templates/card/card.twig index fcf6bd0..211f6e3 100644 --- a/templates/card/card.twig +++ b/templates/card/card.twig @@ -4,13 +4,14 @@ Cards {% endblock %} {% block main %} -
- +
+ + -
-
-

{% block pagetitle %}{% endblock %}

-
+
{% block pagecontent %}{% endblock %} diff --git a/templates/card/card_add.twig b/templates/card/card_add.twig index db91fc4..0a90aea 100644 --- a/templates/card/card_add.twig +++ b/templates/card/card_add.twig @@ -1,47 +1,24 @@ {% extends 'card/card.twig' %} {% block pagetitle %} - Edit Card + Add Card {% endblock %} {% block pagecontent %}
-
- {% for meta in card.meta %} + + {% for key, field in fields %}

-
- +
+

{% endfor %} - + +

Artworks

+ + +
{% endblock %} -{% block pagetitle %} - Add Card -{% endblock %} -{% block pagecontent %} -
- {% for key, field in fields %} -

-
- -

- {% endfor %} - - - -

Artworks

- - - -
-{% endblock %} diff --git a/templates/card/card_display.twig b/templates/card/card_display.twig deleted file mode 100644 index 7b2ed3e..0000000 --- a/templates/card/card_display.twig +++ /dev/null @@ -1,48 +0,0 @@ -{% extends 'card/card.twig' %} - -{% block pagetitle %} - Show Card -{% endblock %} -{% block pagecontent %} -
- -
- -
-
-
- - {{ card.getVotesTotal() }} - -
-
- {% for meta in card.meta %} -

-
- -

- {% endfor %} -
-
-
- -
-

Artworks

-
- - {% for artwork in card.artworks %} -
-
-
- - {{ artwork.getVotesTotal() }} - -
-
- - -
-
-
- {% endfor %} -{% endblock %} diff --git a/templates/card/card_edit.twig b/templates/card/card_edit.twig index b066437..4d13efa 100644 --- a/templates/card/card_edit.twig +++ b/templates/card/card_edit.twig @@ -1,36 +1,24 @@ {% extends 'card/card.twig' %} -{% block pagetitle %} - Edit Card -{% endblock %} {% block pagecontent %} +
+

Edit Card

+
+ +
+ +
+
{% for meta in card.meta %}


- +

{% endfor %}
- -
-

Edit Artworks

-
- -
- -
- - {% for artwork in card.artworks %} -
- - - -
- {% endfor %} - {% endblock %} \ No newline at end of file diff --git a/templates/card/card_list.twig b/templates/card/card_list.twig index b6d8bbe..a233df9 100644 --- a/templates/card/card_list.twig +++ b/templates/card/card_list.twig @@ -1,38 +1,17 @@ {% extends 'card/card.twig' %} -{% block pagetitle %} -List -{% endblock %} {% block pagecontent %} +
+

Cards

+
+ {% for card in cards %} -
-
-
- - {{ card.getVotesTotal() }} - -
-
- - - - {% for meta in card.getAllMeta() %} - - {% endfor %} - - - - - {% for meta in card.getAllMeta() %} - - {% endfor %} - - -
{{ meta.key }}
{{ meta.value }}
- - -
-
-
+ {% set cardSettings = { + "cardHeader": "", + "isPreview": true, + "isVotable": true, + "showArtworks": true + } %} + {{ include('card/card_template.twig') }} {% endfor %} {% endblock %} diff --git a/templates/card/card_meta_template.twig b/templates/card/card_meta_template.twig new file mode 100644 index 0000000..d57cdd8 --- /dev/null +++ b/templates/card/card_meta_template.twig @@ -0,0 +1,21 @@ +
+
+
+ + +
+ {{ card.getVotesTotal() }} +
+ + +
+
+
+ {% for meta in card.meta %} +

+
+ +

+ {% endfor %} +
+
\ No newline at end of file diff --git a/templates/card/card_template.twig b/templates/card/card_template.twig new file mode 100644 index 0000000..411ec2f --- /dev/null +++ b/templates/card/card_template.twig @@ -0,0 +1,103 @@ +{% if cardSettings.isPreview == true %} +
+ {% if cardSettings.cardHeader != "" %} +

{{ cardSettings.cardHeader }}

+ {% endif %} + +
+
+ {% if cardSettings.isVotable == true %} +
+ + +
+ {{ card.getVotesTotal() }} +
+ + +
+ {% endif %} +
+
+ {% for meta in card.meta %} +

+
+ +

+ {% endfor %} + + {% if cardSettings.showArtworks == true %} + {% if card.artworks|length > 0 %} +
+
+
    + {% for artwork in card.artworks %} +
  • + +
  • + {% endfor %} +
+
+
+ {% endif %} + {% endif %} + + +
+
+
+{% else %} +
+

Card

+
+ +
+ +
+ +
+
+
+ {% if cardSettings.isVotable == true %} +
+ + +
+ {{ card.getVotesTotal() }} +
+ + +
+ {% endif %} +
+
+ {% for meta in card.meta %} +

+
+ +

+ {% endfor %} +
+
+
+ + {% if cardSettings.showArtworks == true %} +
+

Artworks

+
+ +
+ + +
+ + {% for artwork in card.artworks %} + {% set artworkSettings = { + "artworkHeader": "", + "isPreview": true, + "isVotable": true + } %} + {{ include('artwork/artwork_template.twig') }} + {% endfor %} + {% endif %} +{% endif %} diff --git a/templates/card/card_view.twig b/templates/card/card_view.twig new file mode 100644 index 0000000..3b84b26 --- /dev/null +++ b/templates/card/card_view.twig @@ -0,0 +1,11 @@ +{% extends 'card/card.twig' %} + +{% block pagecontent %} + {% set cardSettings = { + "cardHeader": "", + "isPreview": false, + "isVotable": true, + "showArtworks": true + } %} + {{ include('card/card_template.twig') }} +{% endblock %} diff --git a/templates/dashboard.twig b/templates/dashboard.twig index 97534bf..0e10193 100644 --- a/templates/dashboard.twig +++ b/templates/dashboard.twig @@ -4,39 +4,41 @@ Dashboard {% endblock %} {% block main %} -
+

Hello World

-
-
+ + +

Cards

-
-
-

Card of the day

-
-
- - {{ cardOfTheDay.getVotesTotal() }} - -
-
- {% for meta in cardOfTheDay.meta %} -

-
- -

- {% endfor %} -
- - -
-
+ + + {% set card = cardOfTheDay %} + {% set cardSettings = { + "cardHeader": "Card Of The Day", + "isPreview": true, + "isVotable": true, + "showArtworks": true + } %} + {{ include('card/card_template.twig') }} + + + + + + {% endblock %} diff --git a/templates/root.twig b/templates/root.twig index 9c3534e..8be64dd 100644 --- a/templates/root.twig +++ b/templates/root.twig @@ -1,14 +1,11 @@ - + + Elements - {% block css %}{% endblock %} -{% block body %}{% endblock %} - -{% block js %}{% endblock %} + {% block body %}{% endblock %} + {% block js %}{% endblock %} \ No newline at end of file -- cgit v1.2.3