Compare commits
3 Commits
5622dc6b28
...
28d29f8054
Author | SHA1 | Date | |
---|---|---|---|
28d29f8054 | |||
03a295140c | |||
ff8182d9c3 |
@ -31,7 +31,7 @@
|
|||||||
{% set reaction_iterations = namespace(value=0) %}
|
{% set reaction_iterations = namespace(value=0) %}
|
||||||
{% for reaction, reaction_count in this.reactions|dictsort(by="value") %}
|
{% for reaction, reaction_count in this.reactions|dictsort(by="value") %}
|
||||||
{# Don't render reaction if we've reached the max number, or its counter is 0 (or lower) #}
|
{# Don't render reaction if we've reached the max number, or its counter is 0 (or lower) #}
|
||||||
{% if reaction_iterations != gallery.max_reactions_per_card|int and reaction_count >= 1 %}
|
{% if reaction_iterations.value|int != gallery.max_reactions_per_card|int and reaction_count|int >= 1 %}
|
||||||
|
|
||||||
<button class="btn btn-link btn-sm disabled text-body position-relative">
|
<button class="btn btn-link btn-sm disabled text-body position-relative">
|
||||||
{# TODO: Enable the button, and make clicking it toggle adding/removing that reaction to the counter, also color reaction button #}
|
{# TODO: Enable the button, and make clicking it toggle adding/removing that reaction to the counter, also color reaction button #}
|
||||||
|
42
test.py
42
test.py
@ -65,26 +65,52 @@ template_vars = {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
"gallery": {
|
"gallery": {
|
||||||
"max_reactions_per_card": 10,
|
"max_reactions_per_card": 9,
|
||||||
},
|
},
|
||||||
"gallery_items": [
|
"gallery_items": [
|
||||||
{
|
{
|
||||||
"src": "https://files.c0defox.es/Pictures/arctic-fox.jpg",
|
"src": "https://files.c0defox.es/Pictures/arctic-fox.jpg",
|
||||||
"description": "An arctic fox :3",
|
"description": "An arctic fox :3",
|
||||||
"title": "fox",
|
"title": "fox",
|
||||||
"reactions": {"heart-fill":4, "backpack4":1, "balloon-fill":45, "bag-x-fill":0},
|
"reactions": {
|
||||||
|
"0-circle": 1,
|
||||||
|
"1-circle": 2,
|
||||||
|
"2-circle": 3,
|
||||||
|
"3-circle": 4,
|
||||||
|
"4-circle": 5,
|
||||||
|
"5-circle": 6,
|
||||||
|
"6-circle": 7,
|
||||||
|
"7-circle": 8,
|
||||||
|
"8-circle": 9,
|
||||||
|
"9-circle": 10,
|
||||||
|
"0-circle-fill": 11,
|
||||||
|
"1-circle-fill": 12,
|
||||||
|
"2-circle-fill": 13,
|
||||||
|
"3-circle-fill": 14,
|
||||||
|
"4-circle-fill": 15,
|
||||||
|
"5-circle-fill": 16,
|
||||||
|
"6-circle-fill": 17,
|
||||||
|
"7-circle-fill": 18,
|
||||||
|
"8-circle-fill": 19,
|
||||||
|
"9-circle-fill": 20,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "https://files.c0defox.es/Pictures/arctic-fox.jpg",
|
"src": "https://files.c0defox.es/Pictures/20150825_114759.jpg",
|
||||||
"description": "An arctic fox :3",
|
"description": "The inside of a Data Center",
|
||||||
"title": "fox",
|
"title": "Data Center",
|
||||||
"reactions": {"heart-fill": 1024, "bag-x-fill": 50},
|
"reactions": {"heart-fill": 1024, "bag-x-fill": 50},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "https://files.c0defox.es/Pictures/arctic-fox.jpg",
|
"src": "https://secure.gravatar.com/avatar/1e346a54257cf0a9932fcfc1e61c015d?s=200",
|
||||||
"description": "An arctic fox :3",
|
"description": "",
|
||||||
"title": "fox",
|
"title": "",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"src": "https://c0defox.es/paw-tail.svg",
|
||||||
|
"alt_text": "a fox tail next to a paw print",
|
||||||
|
"title": ""
|
||||||
|
}
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user