diff --git a/apps/member/templates/member/user_list.html b/apps/member/templates/member/user_list.html index d605c492..66aecf3a 100644 --- a/apps/member/templates/member/user_list.html +++ b/apps/member/templates/member/user_list.html @@ -1,71 +1,75 @@ {% extends "base.html" %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} {% load render_table from django_tables2 %} -{% load crispy_forms_tags %} -{% load i18n %} -{% load perms %} +{% load i18n crispy_forms_tags perms %} +{% block contenttitle %}{% endblock %} {% block content %} - +{% if "member.change_profile_registration_valid"|has_perm:user %} + + {% trans "Registrations" %} + +{% endif %} -
- -
- {% if table.data %} +
+

+ {{ title }} +

+
+ +
+
+
+ {% if table.data %} {% render_table table %} - {% else %} + {% else %}
{% trans "There is no user with this pattern." %}
- {% endif %} + {% endif %} +
- -
- - {% if "member.change_profile_registration_valid"|has_perm:user %} - - {% trans "Registrations" %} - - {% endif %} +
{% endblock %} {% block extrajavascript %} -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/apps/note/templates/note/conso_form.html b/apps/note/templates/note/conso_form.html index 18cac578..b59bcd98 100644 --- a/apps/note/templates/note/conso_form.html +++ b/apps/note/templates/note/conso_form.html @@ -14,7 +14,7 @@
{# User details column #}
-
+
@@ -27,7 +27,7 @@ {# User selection column #}
-
+

{% trans "Consum" %} @@ -47,7 +47,7 @@

{# Summary of consumption and consume button #}
-
+

{% trans "Select consumptions" %} @@ -70,7 +70,7 @@ {# Buttons column #}

{# Show last used buttons #} -
+

{% trans "Highlighted buttons" %} @@ -92,7 +92,7 @@ {# Regroup buttons under categories #} -

+
{# Tabs for button categories #}
- {# Preview note profile (picture, username and balance) #} + {# Preview note profile (picture, username and balance) #}
-
+
@@ -45,9 +45,10 @@ SPDX-License-Identifier: GPL-2.0-or-later
- {# list of emitters #} + + {# list of emitters #}
-
+

{% trans "Select emitters" %} @@ -66,9 +67,10 @@ SPDX-License-Identifier: GPL-2.0-or-later

-{# list of receiver #} + + {# list of receiver #}
-
+

{% trans "Select receivers" %} @@ -83,9 +85,10 @@ SPDX-License-Identifier: GPL-2.0-or-later

-{# Information on transaction (amount, reason, name,...) #} + + {# Information on transaction (amount, reason, name,...) #}
-
+

{% trans "Action" %} diff --git a/apps/registration/static/registration/login.css b/apps/registration/static/registration/login.css index 744e8485..77a2f007 100644 --- a/apps/registration/static/registration/login.css +++ b/apps/registration/static/registration/login.css @@ -4,11 +4,15 @@ Font-Awesome attribution is already done inside SVG files */ #login-form input[type="text"] { - background: right 1rem top 50% / 5% no-repeat url('fa-user.svg'); + background: #fff right 1rem top 50% / 5% no-repeat url('fa-user.svg'); padding-right: 3rem; } #login-form input[type="password"] { - background: right 1rem top 50% / 5% no-repeat url('fa-lock.svg'); + background: #fff right 1rem top 50% / 5% no-repeat url('fa-lock.svg'); padding-right: 3rem; +} + +#login-form select { + -moz-appearance: none; } \ No newline at end of file diff --git a/note_kfet/static/css/custom.css b/note_kfet/static/css/custom.css new file mode 100644 index 00000000..6ad67d9b --- /dev/null +++ b/note_kfet/static/css/custom.css @@ -0,0 +1,56 @@ +.validate:hover { + cursor: pointer; + text-decoration: underline; +} + +/* Opaque tooltip with white background */ +.tooltip.show { + opacity: 1; +} +.tooltip-inner { + background-color: #fff; + box-shadow: 0 .5rem 1rem rgba(0,0,0,.15); + border: 1px solid rgba(0,0,0,.250); + color: #000; + margin: 0 .5rem .25rem .5rem; + padding: 0; +} +.bs-tooltip-bottom .arrow::before { + border-bottom-color: rgba(0,0,0,.250); +} + +/* Limit fluid container to a max size */ +.container-fluid { + max-width: 1600px; +} + +/* Apply Bootstrap table-responsive to all Django tables */ +.table-container { + display: block; + width: 100%; + overflow-x: auto; + -webkit-overflow-scrolling: touch; +} + +/* Smaller language selector */ +select.language { + padding: 0; + background: transparent; + border: none; + height: calc(1.5em + .5rem); + color: #6c757d; + -moz-appearance: none; + width: auto; +} + +/* Last BDE colors */ +.bg-primary { + background-color: rgb(0, 119, 139) !important; +} +html { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); +} +body { + background-color: rgba(64, 64, 64, 1); + background-image: url(../img/background-texture.png); +} diff --git a/note_kfet/static/img/background-texture.png b/note_kfet/static/img/background-texture.png new file mode 100644 index 00000000..12bae83a Binary files /dev/null and b/note_kfet/static/img/background-texture.png differ diff --git a/note_kfet/static/js/base.js b/note_kfet/static/js/base.js index 347696ea..3863dac1 100644 --- a/note_kfet/static/js/base.js +++ b/note_kfet/static/js/base.js @@ -7,7 +7,7 @@ * @param value the balance, in cents * @returns {string} */ -function pretty_money(value) { +function pretty_money (value) { if (value % 100 === 0) return (value < 0 ? "- " : "") + Math.floor(Math.abs(value) / 100) + " €"; else @@ -21,7 +21,7 @@ function pretty_money(value) { * @param alert_type The type of the alert. Choices: info, success, warning, danger * @param timeout The delay (in millis) after that the message is auto-closed. If negative, then it is ignored. */ -function addMsg(msg, alert_type, timeout = -1) { +function addMsg (msg, alert_type, timeout = -1) { let msgDiv = $("#messages"); let html = msgDiv.html(); let id = Math.floor(10000 * Math.random() + 1); @@ -42,7 +42,7 @@ function addMsg(msg, alert_type, timeout = -1) { * @param errs_obj [{error_code:erro_message}] * @param timeout The delay (in millis) after that the message is auto-closed. If negative, then it is ignored. */ -function errMsg(errs_obj, timeout = -1) { +function errMsg (errs_obj, timeout = -1) { for (const err_msg of Object.values(errs_obj)) { addMsg(err_msg, 'danger', timeout); } @@ -51,9 +51,9 @@ function errMsg(errs_obj, timeout = -1) { var reloadWithTurbolinks = (function () { var scrollPosition; - function reload() { + function reload () { scrollPosition = [window.scrollX, window.scrollY]; - Turbolinks.visit(window.location.toString(), {action: 'replace'}) + Turbolinks.visit(window.location.toString(), { action: 'replace' }) } document.addEventListener('turbolinks:load', function () { @@ -69,7 +69,7 @@ var reloadWithTurbolinks = (function () { /** * Reload the balance of the user on the right top corner */ -function refreshBalance() { +function refreshBalance () { $("#user_balance").load("/ #user_balance"); } @@ -78,14 +78,14 @@ function refreshBalance() { * @param pattern The pattern that is queried * @param fun For each found note with the matched alias `alias`, fun(note, alias) is called. */ -function getMatchedNotes(pattern, fun) { +function getMatchedNotes (pattern, fun) { $.getJSON("/api/note/alias/?format=json&alias=" + pattern + "&search=user|club&ordering=normalized_name", fun); } /** * Generate a

  • entry with a given id and text */ -function li(id, text, extra_css) { +function li (id, text, extra_css) { return "
  • " + text + "
  • \n"; } @@ -94,7 +94,7 @@ function li(id, text, extra_css) { * Return style to apply according to the balance of the note and the validation status of the email address * @param note The concerned note. */ -function displayStyle(note) { +function displayStyle (note) { if (!note) return ""; let balance = note.balance; @@ -120,7 +120,7 @@ function displayStyle(note) { * @param user_note_field * @param profile_pic_field */ -function displayNote(note, alias, user_note_field = null, profile_pic_field = null) { +function displayNote (note, alias, user_note_field = null, profile_pic_field = null) { if (!note.display_image) { note.display_image = '/media/pic/default.png'; } @@ -152,7 +152,7 @@ function displayNote(note, alias, user_note_field = null, profile_pic_field = nu * (useful in consumptions, put null if not used) * @returns an anonymous function to be compatible with jQuery events */ -function removeNote(d, note_prefix = "note", notes_display, note_list_id, user_note_field = null, profile_pic_field = null) { +function removeNote (d, note_prefix = "note", notes_display, note_list_id, user_note_field = null, profile_pic_field = null) { return (function () { let new_notes_display = []; let html = ""; @@ -199,8 +199,8 @@ function removeNote(d, note_prefix = "note", notes_display, note_list_id, user_n * the associated note is not displayed. * Useful for a consumption if the item is selected before. */ -function autoCompleteNote(field_id, note_list_id, notes, notes_display, alias_prefix = "alias", - note_prefix = "note", user_note_field = null, profile_pic_field = null, alias_click = null) { +function autoCompleteNote (field_id, note_list_id, notes, notes_display, alias_prefix = "alias", + note_prefix = "note", user_note_field = null, profile_pic_field = null, alias_click = null) { let field = $("#" + field_id); // Configure tooltip @@ -348,7 +348,7 @@ function autoCompleteNote(field_id, note_list_id, notes, notes_display, alias_pr // When a validate button is clicked, we switch the validation status -function de_validate(id, validated, resourcetype) { +function de_validate (id, validated, resourcetype) { let validate_obj = $("#validate_" + id); if (validate_obj.data("pending")) @@ -392,3 +392,17 @@ function de_validate(id, validated, resourcetype) { } }); } + +/** + * Simple debouncer + * @param callback Function to call + * @param wait Debounced milliseconds + */ +function debounce (callback, wait) { + let timeout; + return (...args) => { + const context = this; + clearTimeout(timeout); + timeout = setTimeout(() => callback.apply(context, args), wait); + }; +} diff --git a/note_kfet/templates/base.html b/note_kfet/templates/base.html index 52c48b1b..e2457041 100644 --- a/note_kfet/templates/base.html +++ b/note_kfet/templates/base.html @@ -22,13 +22,15 @@ SPDX-License-Identifier: GPL-3.0-or-later - {# Bootstrap CSS #} + + {# Bootstrap, Font Awesome and custom CSS #} + {# JQuery, Bootstrap and Turbolinks JavaScript #} - + {# Si un formulaire requiert des données supplémentaires (notamment JS), les données sont chargées #} {% if form.media %} {{ form.media }} {% endif %} - - {% block extracss %}{% endblock %}
    -
    @@ -181,7 +155,7 @@ SPDX-License-Identifier: GPL-3.0-or-later {% trans "Your e-mail address is not validated. Please check your mail inbox and click on the validation link." %}
    {% endif %} - {% block contenttitle %}

    {{ title }}

    {% endblock %} + {% block contenttitle %}

    {{ title }}

    {% endblock %}
    Attention : la Note Kfet 2020 est en phase de beta. Des fonctionnalités pourront être rajoutées d'ici à la version @@ -196,23 +170,22 @@ SPDX-License-Identifier: GPL-3.0-or-later
    {% block content %}

    Default content...

    - {% endblock content %} + {% endblock %}
    -