404, both to have a navigation bar and other elements, share elements in pages, the weather page is now extending from base.html
+17 −24 · 1 file changed
-
templates/weather-average.html+17 −24
@@ -1,36 +1,29 @@ -{% extends 'bootstrap/base.html' %} +{% extends 'base.html' %} {% import 'macros.html' as macros %} {% block title %}Weather Averages for {{ city }}{% endblock %} -{% block navbar %} - <nav class="navbar navbar-inverse" role="navigation"> - <div class="container"> - <a class="navbar-brand" href="#">Weather</a> - </div> - </nav> -{% endblock %} +{% block page_content %} + <div class="container"> + <h1>Weather Average</h1> -{% block content %} - <div class="container" - <h1>Weather Average</h1> - <h2>{{ city }}</h2> - -<table class="table table-bordered"> - <tr> - <th>Month</th> - <th>Min</th> - <th>Max</th> - <th>Rainfall</th> - </tr> - {% for month in months %} - {{ macros.weather_row(month, + <h2>{{ city }}</h2> + <table class="table table-bordered"> + <tr> + <th>Month</th> + <th>Min</th> + <th>Max</th> + <th>Rainfall</th> + </tr> + {% for month in months %} + {{ macros.weather_row(month, weather[month]['min'], weather[month]['max'], weather[month]['rain'], highlight['min'], highlight['max'], highlight['rain']) }} - {% endfor %} -</table> + {% endfor %} + </table> + </div> {% endblock %} \ No newline at end of file