diff --git a/core/static/core/accordion.scss b/core/static/core/accordion.scss new file mode 100644 index 00000000..4a80d1dd --- /dev/null +++ b/core/static/core/accordion.scss @@ -0,0 +1,39 @@ +details.accordion summary { + margin: 2px 0 0 0; + padding: .5em .5em .5em .7em; + cursor: pointer; + user-select: none; + + border-top-right-radius: 3px; + border-top-left-radius: 3px; + +} + +details[open].accordion summary { + border: 1px solid #003eff; + background: #007fff; + color: #ffffff; +} + + +details:not([open]).accordion summary { + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; + + border: 1px solid #c5c5c5; + background: #f6f6f6; + color: #454545; +} + + +// ::details-content isn't available on firefox yet +// we use .accordion-content as a workaround +details.accordion>.accordion-content { + background: #ffffff; + color: #333333; + padding: 1em 2.2em; + overflow: auto; + border: 1px solid #dddddd; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} \ No newline at end of file diff --git a/core/templates/core/base.jinja b/core/templates/core/base.jinja index 6479e833..e132699a 100644 --- a/core/templates/core/base.jinja +++ b/core/templates/core/base.jinja @@ -12,6 +12,7 @@ + {% block jquery_css %} {# Thile file is quite heavy (around 250kb), so declaring it in a block allows easy removal #} diff --git a/core/templates/core/user_account.jinja b/core/templates/core/user_account.jinja index 467f864a..a54c9bef 100644 --- a/core/templates/core/user_account.jinja +++ b/core/templates/core/user_account.jinja @@ -1,7 +1,7 @@ {% extends "core/base.jinja" %} {% macro monthly(objects) %} -
+
@@ -37,22 +37,28 @@ {% if customer %}

{% trans %}User account{% endtrans %}

{% trans %}Amount: {% endtrans %}{{ customer.amount }} €

-
- {% if buyings_month %} -
{% trans %}Account purchases{% endtrans %}
+ {% if buyings_month %} +
+ {% trans %}Account purchases{% endtrans %} {{ monthly(buyings_month) }} - {% endif %} - {% if refilling_month %} -
{% trans %}Reloads{% endtrans %}
+
+ {% endif %} + {% if refilling_month %} +
+ {% trans %}Reloads{% endtrans %} {{ monthly(refilling_month) }} - {% endif %} - {% if invoices_month %} -
{% trans %}Eboutic invoices{% endtrans %}
+
+ {% endif %} + {% if invoices_month %} +
+ {% trans %}Eboutic invoices{% endtrans %} {{ monthly(invoices_month) }} - {% endif %} - {% if etickets %} -

{% trans %}Etickets{% endtrans %}

-
+
+ {% endif %} + {% if etickets %} +
+ {% trans %}Etickets{% endtrans %} +
    {% for s in etickets %}
  • @@ -63,22 +69,9 @@ {% endfor %}
- {% endif %} -
+ + {% endif %} {% else %}

{% trans %}User has no account{% endtrans %}

{% endif %} {% endblock %} - -{% block script %} - {{ super() }} - -{% endblock %} - - diff --git a/core/templates/core/user_detail.jinja b/core/templates/core/user_detail.jinja index 4ad1f5d9..57eb3bf7 100644 --- a/core/templates/core/user_detail.jinja +++ b/core/templates/core/user_detail.jinja @@ -254,13 +254,5 @@ keys.shift(); } }); - - $(function () { - $("#drop_gifts").accordion({ - heightStyle: "content", - collapsible: true, - active: false - }); - }); {% endblock %} \ No newline at end of file diff --git a/counter/static/bundled/counter/counter-click-index.ts b/counter/static/bundled/counter/counter-click-index.ts index 5b593532..296c6003 100644 --- a/counter/static/bundled/counter/counter-click-index.ts +++ b/counter/static/bundled/counter/counter-click-index.ts @@ -103,7 +103,7 @@ document.addEventListener("alpine:init", () => { this.customerBalance += Number.parseFloat( (event.detail.target.querySelector("#id_amount") as HTMLInputElement).value, ); - document.getElementById("selling-accordion").click(); + document.getElementById("selling-accordion").setAttribute("open", ""); this.codeField.widget.focus(); }, @@ -139,12 +139,6 @@ document.addEventListener("alpine:init", () => { }); $(() => { - /* Accordion UI between basket and refills */ - // biome-ignore lint/suspicious/noExplicitAny: dealing with legacy jquery - ($("#click-form") as any).accordion({ - heightStyle: "content", - activate: () => $(".focus").focus(), - }); // biome-ignore lint/suspicious/noExplicitAny: dealing with legacy jquery ($("#products") as any).tabs(); }); diff --git a/counter/templates/counter/counter_click.jinja b/counter/templates/counter/counter_click.jinja index 0054f35d..24e1c6ae 100644 --- a/counter/templates/counter/counter_click.jinja +++ b/counter/templates/counter/counter_click.jinja @@ -51,185 +51,192 @@
-
{% trans %}Selling{% endtrans %}
-
- {% set counter_click_url = url('counter:click', counter_id=counter.id, user_id=customer.user_id) %} +
+ {% trans %}Selling{% endtrans %} +
+ {% set counter_click_url = url('counter:click', counter_id=counter.id, user_id=customer.user_id) %} -
+ - - - - - - - {% for category in categories.keys() %} - - {% for product in categories[category] %} - - {% endfor %} + + + + + - {% endfor %} - + {% for category in categories.keys() %} + + {% for product in categories[category] %} + + {% endfor %} + + {% endfor %} + - - + + - {% for error in form.non_form_errors() %} -
- {{ error }} -
- {% endfor %} -

{% trans %}Basket: {% endtrans %}

+ {% for error in form.non_form_errors() %} +
+ {{ error }} +
+ {% endfor %} +

{% trans %}Basket: {% endtrans %}

-
+ -
+
+
+
+ + {% csrf_token %} +
+ {{ form.management_form }} +
+
    +
  • {% trans %}This basket is empty{% endtrans %}
  • + +
+ +

+ Total: + + +

+ +
+ + +
+ +
+
+
+ {% trans %}Refilling{% endtrans %} + {% if object.type == "BAR" %} + {% if refilling_fragment %}
-
+ class="accordion-content" + @htmx:after-request="onRefillingSuccess" + > + {{ refilling_fragment }} +
+ {% else %} +
+

+ {% trans trimmed %} + As a barman, you are not able to refill any account on your own. + An admin should be connected on this counter for that. + The customer can refill by using the eboutic. + {% endtrans %} +

+
+ {% endif %} + + {% if student_card_fragment %} +
+ {% trans %}Student card{% endtrans %} +
+ {{ student_card_fragment }} +
+
+ {% endif %} - {% csrf_token %} -
- {{ form.management_form }} -
- - -

- Total: - - -

- -
- - -
- + {% endif %} - {% if object.type == "BAR" %} -
{% trans %}Refilling{% endtrans %}
- {% if refilling_fragment %} -
- {{ refilling_fragment }} + +
+ {% if not products %} +
+ {% trans %}No products available on this counter for this user{% endtrans %}
{% else %} -
-

- {% trans trimmed %} - As a barman, you are not able to refill any account on your own. - An admin should be connected on this counter for that. - The customer can refill by using the eboutic. - {% endtrans %} -

-
- {% endif %} - {% if student_card_fragment %} -
{% trans %}Student card{% endtrans %}
-
- {{ student_card_fragment }} -
- {% endif %} - - {% endif %} -
- -
- {% if not products %} -
- {% trans %}No products available on this counter for this user{% endtrans %} -
- {% else %} -
    +
      + {% for category in categories.keys() -%} +
    • {{ category }}
    • + {%- endfor %} +
    {% for category in categories.keys() -%} -
  • {{ category }}
  • - {%- endfor %} -
- {% for category in categories.keys() -%} -
-
{{ category }}
-
- {% for product in categories[category] -%} - - {%- endfor %} +
+
{{ category }}
+
+ {% for product in categories[category] -%} + + {%- endfor %} +
-
- {%- endfor %} - {% endif %} + {%- endfor %} + {% endif %} +
-
{% endblock content %} {% block script %} diff --git a/pedagogy/static/pedagogy/css/pedagogy.scss b/pedagogy/static/pedagogy/css/pedagogy.scss index 51656615..ae09b122 100644 --- a/pedagogy/static/pedagogy/css/pedagogy.scss +++ b/pedagogy/static/pedagogy/css/pedagogy.scss @@ -17,6 +17,7 @@ $large-devices: 992px; margin-bottom: 0; margin-top: 0; } + &.star-checked { color: $pedagogy-orange; margin-bottom: 0; @@ -32,6 +33,7 @@ $large-devices: 992px; margin-left: 5px; margin-right: 5px; } + &.star-checked { margin-left: 5px; margin-right: 5px; @@ -42,6 +44,7 @@ $large-devices: 992px; &.grade-without-star { display: block; } + &.grade-with-star { display: none; } @@ -51,10 +54,12 @@ $large-devices: 992px; font-size: 1.1em; overflow-wrap: break-word; + .closed td.title { color: lighten($black-color, 10%); font-style: italic; } + td { text-align: center; border: none; @@ -131,10 +136,12 @@ $large-devices: 992px; input[type="checkbox"] { display: none; } + .radio-guide { margin-top: 10px; color: white; } + .radio-guide label { display: inline-block; background-color: $pedagogy-blue; @@ -143,12 +150,15 @@ $large-devices: 992px; font-size: 16px; border-radius: 4px; } - .radio-guide input[type="radio"]:checked + label { + + .radio-guide input[type="radio"]:checked+label { background-color: $pedagogy-orange; } - .radio-guide input[type="checkbox"]:checked + label { + + .radio-guide input[type="checkbox"]:checked+label { background-color: $pedagogy-orange; } + .radio-guide label:hover { background-color: $pedagogy-hover-blue; } @@ -219,12 +229,7 @@ $large-devices: 992px; "stars" "comment"; } - } - .ui-accordion-content { - background-color: $white-color; - border-color: $pedagogy-orange; - border-right: none; } .form-stars { @@ -235,16 +240,6 @@ $large-devices: 992px; grid-area: comment; } - .ui-accordion-header { - background-color: $pedagogy-orange; - color: $pedagogy-white-text; - clip-path: polygon(0 0%, 0 100%, 30% 100%, 33% 0); - - @media screen and (max-width: $large-devices) { - clip-path: none; - } - } - .ui-accordion-header-icon { color: $pedagogy-white-text; margin-right: 10px; @@ -282,7 +277,7 @@ $large-devices: 992px; background-color: $pedagogy-blue; padding-right: 10px; - > p { + >p { text-align: right; font-weight: bold; } @@ -356,7 +351,7 @@ $large-devices: 992px; .grade-type { grid-area: grade-type; - > p { + >p { color: $pedagogy-white-text; font-weight: bold; text-align: right; @@ -512,3 +507,20 @@ $large-devices: 992px; } } } + +details.accordion summary { + + background: $pedagogy-orange !important; + color: $pedagogy-white-text !important; + clip-path: polygon(0 0%, 0 100%, 30% 100%, 33% 0); + + @media screen and (max-width: $large-devices) { + clip-path: none; + } +} + +details.accordion>.accordion-content { + background-color: $white-color; + border-color: $pedagogy-orange; + border-right: none; +} \ No newline at end of file diff --git a/pedagogy/templates/pedagogy/uv_detail.jinja b/pedagogy/templates/pedagogy/uv_detail.jinja index a5b07f68..9b164583 100644 --- a/pedagogy/templates/pedagogy/uv_detail.jinja +++ b/pedagogy/templates/pedagogy/uv_detail.jinja @@ -90,9 +90,9 @@

{% trans %}You already posted a comment on this UV. If you want to comment again, please modify or delete your previous comment.{% endtrans %}

{% elif user.has_perm("pedagogy.add_uvcomment") %} -
-

{% trans %}Leave comment{% endtrans %}

-
+
+ {% trans %}Leave comment{% endtrans %} +
{% csrf_token %}
@@ -142,7 +142,7 @@

-
+
{% endif %}
@@ -221,21 +221,5 @@ {% endblock %}