Creating the application templates/views

Now let's create the application views:

  1. Within the views/pages folder, create a new file called band-list.html and add the following code:
     {% extends 'layout.html' %} {% block title %}{% endblock %} {% block content %} <div class="album text-muted"> <div class="container"> <div class="row"> {% for band in bands %} <div class="card col-lg-4"> <h2 class="text-lg-center">{{ band.name }}</h2> {% if band.album == null %} <img src="https://placehold.it/320x320" alt="{{ band.name }}" style="height: 320px; width: 100%; display: block;"> {% endif %} {% if band.album %} <img src="{{ band.album }}" width="100%" height="320px"> {% endif %} <p class ="card-text">{{ band.description }}</p> </div> {% endfor %} </div> </div> ...

Get Node.js 6.x Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.