}
.home {
- a {
+ nav a {
text-transform: uppercase;
display: inline-block;
text-decoration: none;
span {
font-size: 30%;
}
- margin-bottom: 2rem;
+ margin-bottom: 1rem;
&.divers {
width: 49%;
}
float: right;
}
}
+ .latest {
+ margin-top: 2em;
+ h2 {
+ margin: 0;
+ font-size: 400%;
+ font-weight: bold;
+ text-transform: uppercase;
+ }
+ .meta {
+ padding-top: 0.5rem;
+ padding-left: 0.5rem;
+ color: lighten($text-color, 40%);
+ }
+ }
}
.post {
{% block content-class %}home{% endblock %}
{% block body %}
-<div>
+<nav>
<a href="tag/radio/">Radio <span>(Panik & ailleurs)</span></a>
<a href="tag/code/">Logiciel libre <span>(Debian, GNOME & ce qui passe)</span></a>
<a class="divers" href="tag/divers/"><span>(Totalement)</span> divers</a>
<a class="vrac" href="archives/"><span>(tout)</span> En vrac</a>
+</nav>
+
+<div class="latest">
+<h2><a href="{{ latest.get_absolute_url }}">{{ latest.title }}</a></h2>
+<div class="meta">{{ latest.creation_timestamp|date:"j E Y, H:i"|lower }}</div>
+<div class="post">
+{{ latest.text|safe }}
+</div>
</div>
{% endblock %}
class HomeView(TemplateView):
template_name = 'phyll/home.html'
+ def get_context_data(self, **kwargs):
+ context = super(HomeView, self).get_context_data(**kwargs)
+ context['latest'] = Note.objects.filter(published=True).latest('creation_timestamp')
+ return context
+
class ArchivesView(ListView):
model = Note