CodeForAfrica / HURUmap

HURUmap is an interactive web platform that allows citizens and journalists to explore, visualise, and download census data. This gives them the power to give context to stories that was otherwise hard to spot. Accessible at https://hurumap.org
https://hurumap.org
GNU General Public License v3.0
8 stars 7 forks source link

Hide / Give CTA in empty sections [161378524] #41

Closed kilemensi closed 5 years ago

kilemensi commented 5 years ago

Description

Standard the LOCATIONNOTFOUND as LOCATION_NOT_FOUND_DIST to be used in HURUmap templates to either hide or CtA wherever there is a missing data.

Type of change

Code

If our data distribution is called budget, then our code that hides the viz whenever data is missing:

  {% if not budget.is_missing %}
    <article class="clearfix">
      <header class="section-contents">
        <h1>Budget</h1>
      </header>
      <div class="section-container">
        {% if not budget.government_expenditure_dist.is_missing %}
          <section class="clearfix stat-row">
            <h2 class="header-for-columns">Government Spending</h2>
            <div class="column-full"
                 id="chart-grouped_column-budget-government_expenditure_dist"
                 data-stat-type="scaled-percentage">
            </div>
          </section>
        {% endif %}
      </div>
    </article>
  {% endif %}

Checklist: