add grid loop + test page

parent d5195dcb
......@@ -6,7 +6,7 @@
<div class="container-fluid">
<div class="jumbotron jumbotron-fluid">
<div class="container">
<h1 class="display-4">Bonjour Monsieur Hive,</h1>
<h1 class="display-4">Bonjour Monsieur {{user.username}},</h1>
<p class="lead">Bienvenue sur votre espace.</p>
</div>
</div>
......
{% extends "base.html" %}
{% block content %}
<div class="row">
{% for item in items %}
<div class="col">
<a href="https://www.w3schools.com">
<div class="card mx-auto" style="width: 18rem; height:10rem;">
<img class="card-img-top" src="https://www.cadredesante.com/spip/local/cache-vignettes/L379xH251/hopital-dessin-g-7f972.jpg" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Mes patients {{item.title}}</h5>
</div>
</div>
</a>
</div>
{% if forloop.counter|divisibleby:"6" or forloop.last %}
</div> <!--end row-->
{% endif %}
{% endfor %}
{% endblock %}
......@@ -6,6 +6,7 @@ from django.contrib import admin
urlpatterns = [
path('', views.index, name='index'),
path('api', views.api, name='api'),
path('test', views.test, name='test'),
path('logout', views.logout_view, name='logout'),
url(r'^accounts/login/$', views.login, name='login'),
url(r'^home/$', views.home, name='home'),
......
......@@ -12,6 +12,10 @@ def logout_view(request):
def index(request):
return render(request, 'index.html')
def test(request):
items = [{"title": "ok1"}, {"title" : "ok2"}]
return render(request, 'test.html', {"items" : items})
@login_required
def api(request):
return HttpResponse("API")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment