From 352f0b0699728a28996f145bf998b4a9e73aa960 Mon Sep 17 00:00:00 2001 From: thomaswoehlke <thomas.woehlke@gmail.com> Date: Wed, 26 May 2021 08:49:59 +0200 Subject: [PATCH] Refactoring: vaccination --- .../bundesland/all/rki_bundesland_all.html | 11 ++--- .../all/rki_bundesland_all_pagination.html | 11 +++-- .../all/rki_bundesland_all_table.html | 47 +++++++------------ 3 files changed, 27 insertions(+), 42 deletions(-) diff --git a/src/flask_covid19/blueprints/data_rki/templates/rki/bundesland/all/rki_bundesland_all.html b/src/flask_covid19/blueprints/data_rki/templates/rki/bundesland/all/rki_bundesland_all.html index f7c4818c..bfb621c3 100644 --- a/src/flask_covid19/blueprints/data_rki/templates/rki/bundesland/all/rki_bundesland_all.html +++ b/src/flask_covid19/blueprints/data_rki/templates/rki/bundesland/all/rki_bundesland_all.html @@ -2,9 +2,9 @@ {% block content %} {{super()}} - {% include 'rki/navigation/rki_navtabs.html' %} + {% include 'owid/navigation/owid_navtabs.html' %} - <div class="container-fluid"> + <div class="container"> <div class="row"> <div class="col"> {% include 'rki/bundesland/all/rki_bundesland_all_pagination.html' %} @@ -23,10 +23,7 @@ </div> {% endblock %} + {% block footer_container %} - <div> - {% for error in errors %} - <h4>{{ error }}</h4> - {% endfor %} - </div> + {% endblock %} diff --git a/src/flask_covid19/blueprints/data_rki/templates/rki/bundesland/all/rki_bundesland_all_pagination.html b/src/flask_covid19/blueprints/data_rki/templates/rki/bundesland/all/rki_bundesland_all_pagination.html index 6eb53384..5939619c 100644 --- a/src/flask_covid19/blueprints/data_rki/templates/rki/bundesland/all/rki_bundesland_all_pagination.html +++ b/src/flask_covid19/blueprints/data_rki/templates/rki/bundesland/all/rki_bundesland_all_pagination.html @@ -1,9 +1,10 @@ {% if page_data.pages > 1 %} - <!-- previous page --> + <!-- previous page --> <ul class="pagination"> {% if page_data.has_prev %} <li class="page-item"> - <a class="page-link" href="{{ url_for('rki.url_rki_date_reported_all', page=page_data.prev_num) }}">Previous</a> + <a class="page-link" + href="{{ url_for('rki.url_rki_bundesland_all', page=page_data.prev_num) }}">Previous</a> </li> {% endif %} <!-- all page numbers --> @@ -11,7 +12,8 @@ {% if page_num %} {% if page_num != page_data.page %} <li class="page-item"> - <a class="page-link" href="{{ url_for('rki.url_rki_date_reported_all', page=page_num) }}">{{ page_num }}</a> + <a class="page-link" + href="{{ url_for('rki.url_rki_bundesland_all', page=page_num) }}">{{ page_num }}</a> </li> {% else %} <li class="page-item active"> @@ -27,7 +29,8 @@ <!-- next page --> {% if page_data.has_next %} <li class="page-item"> - <a class="page-link" href="{{ url_for('rki.url_rki_date_reported_all', page=page_data.next_num) }}">Next</a> + <a class="page-link" + href="{{ url_for('rki.url_rki_bundesland_all', page=page_data.next_num) }}">Next</a> </li> {% endif %} </ul> diff --git a/src/flask_covid19/blueprints/data_rki/templates/rki/bundesland/all/rki_bundesland_all_table.html b/src/flask_covid19/blueprints/data_rki/templates/rki/bundesland/all/rki_bundesland_all_table.html index a1f42f47..e289ed70 100644 --- a/src/flask_covid19/blueprints/data_rki/templates/rki/bundesland/all/rki_bundesland_all_table.html +++ b/src/flask_covid19/blueprints/data_rki/templates/rki/bundesland/all/rki_bundesland_all_table.html @@ -1,41 +1,26 @@ + <div class="table-responsive"> <table class="table table-hover table-striped table-dark"> - <thead class="table-secondary"> + <thead> <tr> - <th scope="col" class="text-right">day of week</th> - <th scope="col" class="text-left">date reported</th> - <th scope="col" class="text-right">week of year</th> - <th scope="col" class="text-left">year</th> - <th scope="col" class="text-left">day of year</th> + <th scope="col">bundesland</th> </tr> </thead> <tbody> - {% for owid_date_reported in page_data.items %} + {% for data_item in page_data.items %} <tr> - <td class="text-right"> - {{ owid_date_reported.get_name_for_weekday() }} - </td> - <td class="text-left"> - {{ owid_date_reported }} - </td> - <td class="text-right"> - {{ owid_date_reported.week_of_year }} - </td> - <td class="text-left"> - {{ owid_date_reported.year }} - </td> - <td class="text-left"> - {{ owid_date_reported.day_of_year }} + <td> + <a href="{{ url_for('rki.url_rki_bundesland_one', bundesland_id=data_item.id) }}"> + {{ data_item.location_group }} + </a> </td> </tr> {% endfor %} </tbody> - <tfoot class="table-secondary"> - <tr> - <th scope="col" class="text-right">day of week</th> - <th scope="col" class="text-left">date reported</th> - <th scope="col" class="text-right">week of year</th> - <th scope="col" class="text-left">year</th> - <th scope="col" class="text-left">day of year</th> - </tr> - </tfoot> - </table> \ No newline at end of file + <tfoot> + <tr> + <th scope="col">bundesland</th> + </tr> + </tfoot> + </table> + </div> + -- GitLab