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/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 ++++ 8 files changed, 172 insertions(+), 140 deletions(-) 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/card') 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 %} -- cgit v1.2.3