Skip to content

Commit

Permalink
[Scorecards] Remove duplicate/draft Methodology views/urls
Browse files Browse the repository at this point in the history
- Remove scoring/methodology.html (2023’s copy of 2021 methodology).
- Rename scoring/methodology2023.html -> scoring/methodology.html.
- Remove scoring2022/methodology2023.html (2022’s draft of 2023).
- Update views.py and urls.py so that both 2022 and 2023 only have
  a single "methodology" view/url each.
- Fix incorrect nav link to 2023 "draft" methodology in 2022 navbar.
  • Loading branch information
zarino committed Oct 18, 2023
1 parent b0d82b9 commit 03edf69
Show file tree
Hide file tree
Showing 13 changed files with 710 additions and 2,271 deletions.
1,594 changes: 689 additions & 905 deletions scoring/templates/scoring/methodology.html

Large diffs are not rendered by default.

768 changes: 0 additions & 768 deletions scoring/templates/scoring/methodology2023.html

This file was deleted.

7 changes: 1 addition & 6 deletions scoring/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,9 @@
name="section_preview",
),
path("location/", views.LocationResultsView.as_view(), name="location_results"),
path(
"plan-scorecards-2022/methodology/",
views.MethodologyView.as_view(),
name="methodology2022",
),
path(
"methodology/",
views.Methodology2023View.as_view(),
views.MethodologyView.as_view(),
name="methodology",
),
path("about/", views.AboutView.as_view(), name="about"),
Expand Down
56 changes: 3 additions & 53 deletions scoring/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,56 +764,6 @@ def get_context_data(self, **kwargs):
return context


@method_decorator(cache_control(**cache_settings), name="dispatch")
class MethodologyView(CheckForDownPageMixin, SearchAutocompleteMixin, TemplateView):
template_name = "scoring/methodology.html"

def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)

# questions = PlanQuestion.objects.all()
# sections = PlanSection.objects.all()

section_qs = PlanSection.objects.filter(year=settings.PLAN_YEAR)

sections = {}
for section in section_qs.all():
sections[section.code] = {
"code": section.code,
"description": section.description,
"questions": [],
}

questions = PlanQuestion.objects.raw(
"select q.id, q.code, q.text, q.question_type, q.max_score, s.code as section_code \
from scoring_planquestion q join scoring_plansection s on q.section_id = s.id \
where s.year = '2021' order by q.code"
)

for question in questions:
section = question.section_code
q = {
"code": question.code,
"pretty_code": question.pretty_code(),
"display_code": question.code.replace(
"{}_".format(question.section_code), "", 1
),
"question": question.text,
"type": question.question_type,
"max": question.max_score,
"section": question.section.code,
}
sections[section]["questions"].append(q)

# context['questions'] = questions
context["sections"] = sorted(
sections.values(), key=lambda section: section["code"]
)
context["page_title"] = "Methodology"
context["current_page"] = "methodology-page"
return context


@method_decorator(cache_control(**cache_settings), name="dispatch")
class AboutView(CheckForDownPageMixin, SearchAutocompleteMixin, TemplateView):
template_name = "scoring/about.html"
Expand All @@ -826,8 +776,8 @@ def get_context_data(self, **kwargs):


@method_decorator(cache_control(**cache_settings), name="dispatch")
class Methodology2023View(CheckForDownPageMixin, SearchAutocompleteMixin, TemplateView):
template_name = "scoring/methodology2023.html"
class MethodologyView(CheckForDownPageMixin, SearchAutocompleteMixin, TemplateView):
template_name = "scoring/methodology.html"

def get_question_number(self, question):
code = question.code
Expand All @@ -838,7 +788,7 @@ def get_question_number(self, question):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["page_title"] = "Methodology"
context["current_page"] = "methodology2023-page"
context["current_page"] = "methodology-page"

questions = (
PlanQuestion.objects.filter(section__year=settings.PLAN_YEAR)
Expand Down
2 changes: 1 addition & 1 deletion scoring2022/static/scoring2022/scss/navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ body {
}
}

&.methodology2023-page {
&.methodology-page {
#methodology-page.nav-item .nav-link{
@include nav-link-active;
}
Expand Down
2 changes: 1 addition & 1 deletion scoring2022/templates/scoring2022/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h4 class="mb-3">History of the Scorecards</h4>
<p>While both of these tools are very useful, neither allow residents to understand the quality of their council’s Climate Action Plan, or how their council’s plan compares to others. Without this information it is difficult to know how their council can improve, and what to ask for. For this reason CE UK decided to assess Climate Action Plans and publish the findings publicly.</p>
<p>This is a pilot project for CE UK, and the first time that this analysis has been undertaken. The work was carried out by our small staff team and our wonderful team of over 120 trained volunteers.</p>
{% comment %} TODO missing link {% endcomment %}
<p>We began by scoring the plans using the Checklist as a starting point. From there we identified which elements are essential components of a Climate Action Plan. We removed all questions relating to the action the council was taking on climate change, as we decided to focus only on the written plans in the first year of this project. To find out more read <a href="{% url 'scoring2022:methodology2022' %}">our methodology</a>.</p>
<p>We began by scoring the plans using the Checklist as a starting point. From there we identified which elements are essential components of a Climate Action Plan. We removed all questions relating to the action the council was taking on climate change, as we decided to focus only on the written plans in the first year of this project. To find out more read <a href="{% url 'scoring2022:methodology' %}">our methodology</a>.</p>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion scoring2022/templates/scoring2022/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<a class="nav-link" href="{% url 'scoring2022:home' %}">Scorecards</a>
</li>
<li id="methodology-page" class="nav-item">
<a class="nav-link" href="{% url 'scoring:methodology' %}">New methodology</a>
<a class="nav-link" href="{% url 'scoring2022:methodology' %}">Methodology</a>
</li>
<li id="how-to-page" class="nav-item">
<a class="nav-link" href="{% url 'scoring2022:how-to-use-the-scorecards' %}">How to use the Scorecards</a>
Expand Down
2 changes: 1 addition & 1 deletion scoring2022/templates/scoring2022/council.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ <h3 class="mb-3">About the scoring</h3>
<p>Has this council released a Climate Action Plan plan recently? <a class="d-inline-block" href="https://cape.mysociety.org/councils/{{ council.slug }}">Check our database to find out.</a></p>
{% endif %}
{% if authority_type.slug == 'district' %}
<p>This district council is signed up to their county council's joint Climate Action Plan. Here, if the district council has a plan, they are marked on their own plan and the county plan, depending on which is relevant to each question. <a class="d-inline-block" href="{% url 'scoring2022:methodology2022' %}">You can find out more about this in the methodology.</a></p>
<p>This district council is signed up to their county council's joint Climate Action Plan. Here, if the district council has a plan, they are marked on their own plan and the county plan, depending on which is relevant to each question. <a class="d-inline-block" href="{% url 'scoring2022:methodology' %}">You can find out more about this in the methodology.</a></p>
{% endif %}
{% if plan_urls %}
<details>
Expand Down
20 changes: 10 additions & 10 deletions scoring2022/templates/scoring2022/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ <h5 class="filter-title mb-3">Select a section:</h5>
</div>
<button type="submit" class="btn btn-blue mb-3 d-block mt-3">Apply filters</button>
</form>
<a class="my-3" href="{% url 'scoring2022:methodology2022' %}scoring-system">Learn more about each section</a>
<a class="my-3" href="{% url 'scoring2022:methodology' %}scoring-system">Learn more about each section</a>
</div>

<div class="scorecard-table-wrapper">
Expand All @@ -125,63 +125,63 @@ <h5 class="filter-title mb-3">Select a section:</h5>
</th>
<th scope="col" class="first-row-child category-1">
<div class="table-header-first-row">
<a href="{% url 'scoring2022:methodology2022' %}#sec-gov">Governance, development and funding</a>
<a href="{% url 'scoring2022:methodology' %}#sec-gov">Governance, development and funding</a>
<button class="js-sort-table sort-icon{% if sorted_by == 's1_gov' %} is-sorted-descending{% endif %}" title="Sort highest first"></button>
</div>
<div class="table-sticky-border top"></div>
</th>
<th scope="col" class="first-row-child category-2">
<div class="table-header-first-row">
<a href="{% url 'scoring2022:methodology2022' %}#sec-ma">Mitigation and Adaptation</a>
<a href="{% url 'scoring2022:methodology' %}#sec-ma">Mitigation and Adaptation</a>
<button class="js-sort-table sort-icon{% if sorted_by == 's2_m_a' %} is-sorted-descending{% endif %}" title="Sort highest first"></button>
</div>
<div class="table-sticky-border top"></div>
</th>
<th scope="col" class="first-row-child category-3">
<div class="table-header-first-row">
<a href="{% url 'scoring2022:methodology2022' %}#sec-ca">Commitment and Integration</a>
<a href="{% url 'scoring2022:methodology' %}#sec-ca">Commitment and Integration</a>
<button class="js-sort-table sort-icon{% if sorted_by == 's3_c_a' %} is-sorted-descending{% endif %}" title="Sort highest first"></button>
</div>
<div class="table-sticky-border top"></div>
</th>
<th scope="col" class="first-row-child category-4">
<div class="table-header-first-row">
<a href="{% url 'scoring2022:methodology2022' %}#sec-coms">Community engagement and communications</a>
<a href="{% url 'scoring2022:methodology' %}#sec-coms">Community engagement and communications</a>
<button class="js-sort-table sort-icon{% if sorted_by == 's4_coms' %} is-sorted-descending{% endif %}" title="Sort highest first"></button>
</div>
<div class="table-sticky-border top"></div>
</th>
<th scope="col" class="first-row-child category-5">
<div class="table-header-first-row">
<a href="{% url 'scoring2022:methodology2022' %}#sec-mset">Measuring and setting emissions targets</a>
<a href="{% url 'scoring2022:methodology' %}#sec-mset">Measuring and setting emissions targets</a>
<button class="js-sort-table sort-icon{% if sorted_by == 's5_mset' %} is-sorted-descending{% endif %}" title="Sort highest first"></button>
</div>
<div class="table-sticky-border top"></div>
</th>
<th scope="col" class="first-row-child category-6">
<div class="table-header-first-row">
<a href="{% url 'scoring2022:methodology2022' %}#sec-co">Co-benefits</a>
<a href="{% url 'scoring2022:methodology' %}#sec-co">Co-benefits</a>
<button class="js-sort-table sort-icon{% if sorted_by == 's6_cb' %} is-sorted-descending{% endif %}" title="Sort highest first"></button>
</div>
<div class="table-sticky-border top"></div>
</th>
<th scope="col" class="first-row-child category-7">
<div class="table-header-first-row">
<a href="{% url 'scoring2022:methodology2022' %}#sec-dsi">Diversity and Social Inclusion</a>
<a href="{% url 'scoring2022:methodology' %}#sec-dsi">Diversity and Social Inclusion</a>
<button class="js-sort-table sort-icon{% if sorted_by == 's7_dsi' %} is-sorted-descending{% endif %}" title="Sort highest first"></button>
</div>
<div class="table-sticky-border top"></div>
</th>
<th scope="col" class="first-row-child category-8">
<div class="table-header-first-row">
<a href="{% url 'scoring2022:methodology2022' %}#sec-est">Education, Skills and Training</a>
<a href="{% url 'scoring2022:methodology' %}#sec-est">Education, Skills and Training</a>
<button class="js-sort-table sort-icon{% if sorted_by == 's8_est' %} is-sorted-descending{% endif %}" title="Sort highest first"></button>
</div>
<div class="table-sticky-border top"></div>
</th>
<th scope="col" class="first-row-child category-9">
<div class="table-header-first-row">
<a href="{% url 'scoring2022:methodology2022' %}#sec-ee">Ecological emergency</a>
<a href="{% url 'scoring2022:methodology' %}#sec-ee">Ecological emergency</a>
<button class="js-sort-table sort-icon{% if sorted_by == 's9_ee' %} is-sorted-descending{% endif %}" title="Sort highest first"></button>
</div>
<div class="table-sticky-border top"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ <h3 class="mb-4">How to use the Scorecards as a Councillor or Officer</h3>
<p><a href="https://drive.google.com/file/d/1IcqQFwcKcz0XcxKRu9h-g3Zj8TsbyhuI/view" class="d-inline-block btn btn-blue is--light my-4"><strong>Download:</strong> Top 10 policy document</a></p>
<p>Here are some helpful tips on how best to understand this data and use it for meaningful improvement to your council’s planned activity.</p>
<ul class="mb-4">
<li>Take time to <strong>understand the</strong> <a href="{% url 'scoring2022:methodology2022' %}">methodology</a> and what exactly the markers were looking for in each question. </li>
<li>Take time to <strong>understand the</strong> <a href="{% url 'scoring2022:methodology' %}">methodology</a> and what exactly the markers were looking for in each question. </li>
<li><strong>Look at each section score</strong>. You might have scored particularly well in some sections but not in others: why is that? Use the filter buttons to see which councils have scored highly in the sections that you didn’t score as well on. What have these councils done differently with their plans, and what can you learn from this?</li>
<li><strong>Make use of the filter tools</strong>. Use the various criteria such as urbanisation, deprivation or population size to discover councils that are similar to yours, and see where the strengths and weaknesses are in their climate action plans.<br>
Or check your neighbouring councils: where have they scored well, and can you learn from them?<br>
Expand Down
2 changes: 1 addition & 1 deletion scoring2022/templates/scoring2022/methodology.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="hero container-fluid bg-dark-grey">
<div style="max-width: 1110px" class="mx-auto">
<a class="cta reverse white" href="{% url 'scoring2022:home' %}">Back to the Scorecards</a>
<h1 class="text-white mt-3">Methodology</h1>
<h1 class="text-white mt-3">2021 Plan Scorecards Methodology</h1>
<div class="mt-3">
<span class="hero-sub">Check out our process</span>
</div>
Expand Down
Loading

0 comments on commit 03edf69

Please sign in to comment.