Skip to content

Commit

Permalink
Improve tableview template with bootstrap list
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias84 committed Aug 19, 2019
1 parent 9a7bc89 commit 816be29
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions papersquirrel/settings/base.py
Expand Up @@ -17,6 +17,7 @@
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
'crispy_forms',
]

Expand Down
18 changes: 13 additions & 5 deletions squirrel/templates/squirrel/index.html
@@ -1,12 +1,20 @@
{% extends "squirrel/base.html" %}
{% load humanize %}
{% block content %}
{% if user.is_authenticated %}
{% if latest_article_list %}
<ul>
{% for article in latest_article_list %}
<li><a href="{% url 'squirrel:detail' article.id %}">{{ article.download_url }}</a></li>
{% endfor %}
</ul>
<div class="list-group">
{% for article in latest_article_list %}
<a href="{% url 'squirrel:detail' article.id %}" class="list-group-item list-group-item-action flex-column align-items-start">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">{{ article.title }}</h5>
<small>{{ article.download_date|naturalday}}</small>
</div>
<p class="mb-1">{{ article.description}}</p>
<!--<small>Donec id elit non mi porta.</small>-->
</a>
{% endfor %}
</div>
{% else %}
<p>No articles are available.</p>
{% endif %}
Expand Down

0 comments on commit 816be29

Please sign in to comment.