From 0f5856d2b996e2ed4672a19c85c0d07a90013425 Mon Sep 17 00:00:00 2001 From: Niklas Mohrin <dev@niklasmohrin.de> Date: Mon, 20 Dec 2021 22:49:41 +0100 Subject: [PATCH] `sed -i 's/cssClass/css_class/g' evap/**/*.{py, html}` --- evap/evaluation/models.py | 10 +++++----- evap/results/templates/distribution_with_grade.html | 2 +- .../templates/student_vote_questionnaire_group.html | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/evap/evaluation/models.py b/evap/evaluation/models.py index ddb924827..6029639ca 100644 --- a/evap/evaluation/models.py +++ b/evap/evaluation/models.py @@ -1184,7 +1184,7 @@ class Question(models.Model): Choices = NamedTuple( "Choices", [ - ("cssClass", str), + ("css_class", str), ("values", Tuple[Number]), ("colors", Tuple[str]), ("grades", Tuple[Number]), @@ -1194,7 +1194,7 @@ Choices = NamedTuple( BipolarChoices = NamedTuple( "BipolarChoices", [ - ("cssClass", str), + ("css_class", str), ("values", Tuple[Number]), ("colors", Tuple[str]), ("grades", Tuple[Number]), @@ -1207,21 +1207,21 @@ BipolarChoices = NamedTuple( NO_ANSWER = 6 BASE_UNIPOLAR_CHOICES = { - "cssClass": "vote-type-unipolar", + "css_class": "vote-type-unipolar", "values": (1, 2, 3, 4, 5, NO_ANSWER), "colors": ("green", "lime", "yellow", "orange", "red", "gray"), "grades": (1, 2, 3, 4, 5), } BASE_BIPOLAR_CHOICES = { - "cssClass": "vote-type-bipolar", + "css_class": "vote-type-bipolar", "values": (-3, -2, -1, 0, 1, 2, 3, NO_ANSWER), "colors": ("red", "orange", "lime", "green", "lime", "orange", "red", "gray"), "grades": (5, 11 / 3, 7 / 3, 1, 7 / 3, 11 / 3, 5), } BASE_YES_NO_CHOICES = { - "cssClass": "vote-type-yes-no", + "css_class": "vote-type-yes-no", "values": (1, 5, NO_ANSWER), "colors": ("green", "red", "gray"), "grades": (1, 5), diff --git a/evap/results/templates/distribution_with_grade.html b/evap/results/templates/distribution_with_grade.html index 221438c27..9ae33a074 100644 --- a/evap/results/templates/distribution_with_grade.html +++ b/evap/results/templates/distribution_with_grade.html @@ -2,7 +2,7 @@ {% load evaluation_filters %} <div class="distribution-bar-container{% if question_result.warning %} participants-warning{% endif %}"> - <div class="distribution-bar {{ question_result.choices.cssClass }}" + <div class="distribution-bar {{ question_result.choices.css_class }}" {% if question_result.question.is_bipolar_likert_question %} style="left: {{ question_result.minus_balance_count|percentage_one_decimal:question_result.count_sum }}"{% endif %} > {% with colors=question_result.choices|to_colors %} diff --git a/evap/student/templates/student_vote_questionnaire_group.html b/evap/student/templates/student_vote_questionnaire_group.html index d0726384d..0998bcdc8 100644 --- a/evap/student/templates/student_vote_questionnaire_group.html +++ b/evap/student/templates/student_vote_questionnaire_group.html @@ -43,7 +43,7 @@ {% endif %} {% if field|is_choice_field %} <div class="col-answer col-lg-8 col-xl-7 my-auto d-flex"> - <div class="vote-inputs tab-row {{ field.field.widget.attrs.choices.cssClass }} btn-group" data-bs-toggle="buttons"> + <div class="vote-inputs tab-row {{ field.field.widget.attrs.choices.css_class }} btn-group" data-bs-toggle="buttons"> {% for choice, color in field|zip:field.field.widget.attrs.choices.colors %} <input id="{{ choice.id_for_label }}" class="tab-selectable num-selectable btn-check" name="{{ choice.data.name }}" type="radio" value="{{ choice.data.value }}" autocomplete="off"{% if field.value == choice.data.value %} checked{% endif %}{% if preview %} disabled{% endif %}/> <label for="{{ choice.id_for_label }}" class="btn btn-sm vote-btn vote-btn-{{ color }} d-flex{% if field.value == choice.data.value %} active{% endif %}{% if field.errors %} choice-error{% endif %}"> -- GitLab