From a4719768d5c2e7e7871cb3deedc2e4f110c99465 Mon Sep 17 00:00:00 2001 From: Lucas Date: Wed, 30 Oct 2024 06:25:50 +0000 Subject: [PATCH 1/7] DELETE --- .../planning-and-land-use.zip | Bin 6917298 -> 6917297 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/scoring/static/scoring/img/social-graphics/planning-and-land-use/planning-and-land-use.zip b/scoring/static/scoring/img/social-graphics/planning-and-land-use/planning-and-land-use.zip index 5d47761d43306e46f3c004bc6afdcd62457d0f52..02ccac048e11e8c792f8301e35289708e18c125c 100644 GIT binary patch delta 323 zcmWN=MNR_&06@_|aV^E&-JPNxDDLj=OSZFO@e|I#1=vGKxE}u{@8|O?^6ht0NF_oV z>12>e7TM&GOCI?YP)L*_ViZ$CDP@#XK_yjGQ$sCv)YCvCO*GR&D{ZvXK_^{w(?c(P z^fSO9Lku&*C}WH>@f%NsA3+%Rq^CUX8P9so2?w6{f|FkKl9#>WRj+y78{YJmx4q+C p?|I(`KJ<}~ed1G}`P>)2^p&rD<6GbP-Vc8Clb`+a7lf~Gv459hcL4wZ delta 325 zcmWN=MNR_&06@`{;!vcxySr0#io3hJEZNSA#ZNc`7hn$|;d=a+yzkGi=#SrtkV2GH z(nu$ROtQ!(hg@Rhkxv1I#3`bf5=tqfoC+$bqM90NsiU3-8fl`L7FubeoenzbqMIIi z>7$ Date: Wed, 16 Oct 2024 07:30:22 +0100 Subject: [PATCH 2/7] [Scorecards][General] Added percentage ring component --- scoring/static/scoring/scss/main.scss | 1 + .../static/scoring/scss/percentage-ring.scss | 36 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 scoring/static/scoring/scss/percentage-ring.scss 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%; + } +} From 105a4b6934d649bc083ec7ccc1c84e4905228553 Mon Sep 17 00:00:00 2001 From: Lucas Date: Wed, 16 Oct 2024 07:30:48 +0100 Subject: [PATCH 3/7] [Scorecards] Added percentage ring to councils --- scoring/templates/scoring/council.html | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/scoring/templates/scoring/council.html b/scoring/templates/scoring/council.html index f658703e..da2ba152 100644 --- a/scoring/templates/scoring/council.html +++ b/scoring/templates/scoring/council.html @@ -295,8 +295,28 @@

Visit us again on a bigger screen

{% include "scoring/includes/question-content-table-cell.html" with foorloop=forloop code=answer.code pretty_code=answer.pretty_code question_text=answer.question question_type=answer.type how_marked=answer.how_marked_display weighting=answer.weighting evidence_links=answer.evidence_links criteria=answer.criteria council_type_slug=council.get_scoring_group.slug %} - - {{ answer.score }}/{{ answer.max }} + + {{ answer.score }}/{{ answer.max }} +
+
+
+ {% widthratio answer.council_count council_count 100%}% +
+
+

+ {{ answer.council_count }} out of {{ council_count }} + + {% if answer.type == "negative" %} + {% include 'caps/includes/authority_type.html' with group=authority_type %} + councils got no penalty marks for this question. + {% else %} + {% include 'caps/includes/authority_type.html' with group=authority_type %} + councils got full marks for this question. + {% endif %} + +

+
+ {% for comparison in answer.comparisons %} From b7b4552aff2644f9e4e03ae9dd402748b9738f4e Mon Sep 17 00:00:00 2001 From: Lucas Date: Wed, 16 Oct 2024 11:09:30 +0100 Subject: [PATCH 4/7] [Scorecards][General] Increased contrast ratio for success variable --- scoring/static/scoring/scss/variables.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scoring/static/scoring/scss/variables.scss b/scoring/static/scoring/scss/variables.scss index 3186e683..df4a0d64 100644 --- a/scoring/static/scoring/scss/variables.scss +++ b/scoring/static/scoring/scss/variables.scss @@ -32,7 +32,7 @@ $cyan: $color-scorecard-cyan; $light: $white; $primary: $color-scorecard-purple; $secondary: $color-scorecard-grey-800; -$success: $color-scorecard-green; +$success: darken($color-scorecard-green, 5%); // Pass contrast test $warning: $color-scorecard-red; $danger: $color-scorecard-red; $info: $color-scorecard-yellow; From a94a4e36478095a1e6fde016bfc09a96508e36db Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 17 Oct 2024 07:28:13 +0100 Subject: [PATCH 5/7] [Scorecards] Council page: Added year comparisson --- scoring/templates/scoring/council.html | 343 +++++++++++++++++++------ 1 file changed, 258 insertions(+), 85 deletions(-) diff --git a/scoring/templates/scoring/council.html b/scoring/templates/scoring/council.html index da2ba152..e6b725f7 100644 --- a/scoring/templates/scoring/council.html +++ b/scoring/templates/scoring/council.html @@ -215,73 +215,245 @@

Visit us again on a bigger screen

- - + + + + + {% for comparison in comparisons %} - + {% endfor %} - - {% for section in sections %} + + + - {% if section.has_negative_points %} - - {% else %} - - {% endif %} + {% for comparison in comparisons %} + + {% endfor %} - + + + - {% 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 %} -
+ {% for section in sections %} + + + + + + + {% if section.top_performer %} - {% else %} - {% endif %} + + {% for comparison in section.comparisons %} - {% endfor %} - - - + + {% for comparison in answer.comparisons %} - {% endfor %} - - {% endfor %} {% endfor %} - - - - - - - {% for comparison in comparisons %} - - {% endfor %} - - - - - -
Questions{{ council.name }}Questions + 2025 +

{{ council.name }}

+
+ Councils with full marks per question + {{ comparison.council.name }}{{ comparison.council.name }} - Councils with full marks per question -
+ Total score + +
+ {{ plan_score.weighted_total|floatformat:0 }}% + +
+
+

+ {% comment %} TODO check if it is a top performer that year {% endcomment %} + {% if section.top_performer %} + Top perfomer in this section in the action scorecards 2023 + {% include 'caps/icons/scorecards-star.html' with classes='text-info align-top' width='0.9em' height='0.9rem' role='presentation' %} + {% endif %} + 41% +

+

score in 2023

+
+ {% comment %} TODO display tcard his b instead of the previous onelock if question was not measured in 2023 {% endcomment %} +
+
+ Not measured in 2023 +
+
+
+ + {% comment %} {% endcomment %} + + {% comment %} TODO Update value {% endcomment %} + {% comment %} TODO Update aria-label, there are three scenarios: + - x% increase to compare with previous version of action Scorecards + - x% decrease to compare with previous version of action Scorecards + - No variation compare with previous version of action Scorecards + {% endcomment %} + {% comment %} Replace text-success when needed: + - positive variation: text-success + - negative variation: text-danger + - no change: text-muted + {% endcomment %} + 2% + compare to 2023 +
+
+
+
+ {{ comparison.weighted_total|floatformat:0 }}% + - {{ section.description }} +
+

{{ 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 %} +
+ {% endif %} - -
- {% include 'caps/icons/scorecards-star.html' with classes='text-info align-text-bottom me-1' width='1.2em' height='1.2rem' role='presentation' %} - {{ section.weighted_score|floatformat:0 }}% + +
+
+ {% include 'caps/icons/scorecards-star.html' with classes='text-info' width='1rem' height='1rem' role='presentation' %} + {{section.weighted_score|floatformat:0 }}% + Top perfomer +

Top performer in this section

+
+
+
+

+ {% comment %} TODO check if it is a top performer that year {% endcomment %} + {% if section.top_performer %} + Top perfomer in this section in the action scorecards 2023 + {% include 'caps/icons/scorecards-star.html' with classes='text-info align-top' width='0.9em' height='0.9rem' role='presentation' %} + {% endif %} + 41% +

+

score in 2023

+
+
+ + {% comment %} {% endcomment %} + + {% comment %} TODO Update value {% endcomment %} + {% comment %} TODO Update aria-label, there are three scenarios: + - x% increase to compare with previous version of action Scorecards + - x% decrease to compare with previous version of action Scorecards + - No variation compare with previous version of action Scorecards + {% endcomment %} + {% comment %} Replace text-success when needed: + - positive variation: text-success + - negative variation: text-danger + - no change: text-muted + {% endcomment %} + 2% + compare to 2023 +
+
+
- {{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 }}) +
+
+ {{section.weighted_score|floatformat:0 }}% +
+
+

+ {% comment %} TODO check if it is a top performer that year {% endcomment %} + {% if section.top_performer %} + Top perfomer in this section in the action scorecards 2023 + {% include 'caps/icons/scorecards-star.html' with classes='text-info align-top' width='0.9em' height='0.9rem' role='presentation' %} + {% endif %} + 41% +

+

score in 2023

+
+
+ + {% comment %} {% endcomment %} + + {% comment %} TODO Update value {% endcomment %} + {% comment %} TODO Update aria-label, there are three scenarios: + - x% increase to compare with previous version of action Scorecards + - x% decrease to compare with previous version of action Scorecards + - No variation compare with previous version of action Scorecards + {% endcomment %} + {% comment %} Replace text-success when needed: + - positive variation: text-success + - negative variation: text-danger + - no change: text-muted + {% endcomment %} + 2% + compare to 2023 +
- {% endif %} +
+ + {% comment %} ERASE THIS {% endcomment %} +
+
+
+

+ Relative variation + +

+ + + {% comment %} {% endcomment %} + + 100% + +
+
+

+ Absolute variation + +

+ + + {% comment %} {% endcomment %} + + 4% + +
+
+
+ {% comment %} {% endcomment %} + + + {% if section.has_negative_points %} +
+ {{ section.score }} = Total score ({{ section.non_negative_max|floatformat:"-2" }}) − Penalty points ({{ section.negative_points }}) +
+ {% endif %}
+ {{ comparison.weighted_score|floatformat:0 }}% - {{ answer.score }}/{{ answer.max }} + +
+
+

+ {{ answer.score }} + out of + {{ answer.max }} +

+
+ +
+
+

+ {{ answer.score }} + out of + {{ answer.max }} +

+

score in 2023

+
+
+

+ + {% comment %} - {% endcomment %} + + + 1 marks + compare to 2023 +

+
+
+ {% comment %} TODO display this card block instead of the previous one if question was not measured in 2023 {% endcomment %} +
+
+ Not measured in 2023 +
+
+
+
-
+
{% widthratio answer.council_count council_count 100%}%

- {{ answer.council_count }} out of {{ council_count }} + {% comment %} {{ answer.council_count }} out of {{ council_count }} {% endcomment %} {% if answer.type == "negative" %} {% include 'caps/includes/authority_type.html' with group=authority_type %} councils got no penalty marks for this question. {% else %} {% include 'caps/includes/authority_type.html' with group=authority_type %} - councils got full marks for this question. + councils with full mark per question for 2025 {% endif %}

-
+ {{ comparison.score }}/{{ comparison.max }} - - {{ answer.council_count }} out of {{ council_count }} - - - {% include 'caps/includes/authority_type.html' with group=authority_type %} - {% if answer.type == "negative" %} - councils got no penalty marks for this question. - {% else %} - councils got full marks for this question. - {% endif %} - -
- Total score - - {{ plan_score.weighted_total|floatformat:0 }}% - - {{ comparison.weighted_total|floatformat:0 }}% -