diff --git a/scoring/static/scoring/scss/main.scss b/scoring/static/scoring/scss/main.scss index 39151331..7913ac83 100644 --- a/scoring/static/scoring/scss/main.scss +++ b/scoring/static/scoring/scss/main.scss @@ -66,3 +66,4 @@ @import "open-graph-preview"; @import "years"; @import "gallery-component"; +@import "percentage-ring"; diff --git a/scoring/static/scoring/scss/percentage-ring.scss b/scoring/static/scoring/scss/percentage-ring.scss new file mode 100644 index 00000000..ec19d664 --- /dev/null +++ b/scoring/static/scoring/scss/percentage-ring.scss @@ -0,0 +1,36 @@ +/* USAGE: +Always check how the ring will look at 100% and if there is an overlap between elements. + +
+
+ {% widthratio answer.council_count council_count 100%}% +
+
+*/ + +.progress-ring { + min-width: var(--ring-size, 150px); + height: var(--ring-size, 150px); + border-radius: 50%; + position: relative; + display: flex; + justify-content: center; + align-items: center; + background: conic-gradient( + var(--ring-primary-color, $primary) 0% calc(var(--ring-percentage) * 1%), + var(--ring-secondary-color, $primary-200) calc(var(--ring-percentage) * 1%) 100% + ); + + .percentage { + font-weight: bold; + color: var(--ring-primary-color, $primary); + position: absolute; + display: flex; + justify-content: center; + align-items: center; + width: calc(var(--ring-size, 150px) * 0.7); + height: calc(var(--ring-size, 150px) * 0.7); + background: white; + border-radius: 50%; + } +} diff --git a/scoring/templates/scoring/council.html b/scoring/templates/scoring/council.html index abe1839c..0fd33fb2 100644 --- a/scoring/templates/scoring/council.html +++ b/scoring/templates/scoring/council.html @@ -243,29 +243,29 @@

Visit us again on a bigger screen

{% for section in sections %} - {% if section.has_negative_points %} - - {% else %} - - {% endif %} + - + {{ section.description }} {% if section.has_negative_points %} -
+

{% include 'caps/icons/warning.html' with classes='me-1 mb-1' width='1.1em' height='1.1em' role='presentation' %} Penalty marks

- {% if section.only_negative %} - {{ council.name }} was only awarded penalty marks in this section - {% else %} - {{ council.name }} incurred a penalty of {{ section.negative_percent|floatformat:0 }}% in this section - {% endif %} +

+ {% if section.only_negative %} + {{ council.name }} was only awarded penalty marks in this section + {% else %} + {{ council.name }} incurred a penalty of {{ section.negative_percent|floatformat:0 }}% in this section + {% endif %} +

+

+ {{ section.score }} = Total score ({{ section.non_negative_max|floatformat:"-2" }}) − Penalty points ({{ section.negative_points }}) +

{% endif %} - {% else %} - {{section.weighted_score|floatformat:0 }}% - {% if section.has_negative_points %} -
- {{ section.score }} = Total score ({{ section.non_negative_max|floatformat:"-2" }}) − Penalty points ({{ section.negative_points }}) -
- {% endif %} + {{section.weighted_score|floatformat:0 }}% + + + + + + {% endif %} {% for comparison in section.comparisons %} {{ comparison.weighted_score|floatformat:0 }}% + + + + + + + {% endfor %} - + +
{% for comparison in answer.comparisons %} - {{ comparison.score|format_mark }}/{{ comparison.max }} +
+

+ {{ comparison.score|format_mark }} out of {{ comparison.max }} + +

+ + + + + + + +
{% endfor %} - - {{ answer.council_count }} out of {{ council_count }} - - - {% include 'scoring/includes/scoring-group-name.html' with group=council.get_scoring_group.slug plural=True %} - {% if answer.type == "negative" %} - got no penalty marks for this question. - {% else %} - got full marks for this question. - {% endif %} - +
+
+
+ {% widthratio answer.council_count council_count 100%}% +
+
+ + {% include 'scoring/includes/scoring-group-name.html' with group=council.get_scoring_group.slug plural=True %} + {% if answer.type == "negative" %} + got no penalty marks for this question. + {% else %} + got full marks for this question. + {% endif %} + +
{% endfor %} @@ -339,21 +381,33 @@

Visit us again on a bigger screen

{% endfor %} - - + + Total score {{ plan_score.weighted_total|floatformat:0 }}% + + + + + + {% for comparison in comparisons %} {{ comparison.weighted_total|floatformat:0 }}% + + + + + + {% endfor %} - +