forked from 00dani/lemoncurry
Add entries to the homepage, and make style tweaks so everywhere looks right
This commit is contained in:
parent
172f0d4753
commit
60cd6c911b
4 changed files with 21 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
|||
main > .container
|
||||
ol.entries
|
||||
display flex
|
||||
margin-bottom 0
|
||||
flex 1
|
||||
flex-direction column
|
||||
justify-content center
|
||||
> li
|
||||
|
|
|
@ -6,6 +6,13 @@ $xl = 1200px
|
|||
main
|
||||
flex-direction column
|
||||
align-items center
|
||||
aside.author
|
||||
margin-bottom 1rem
|
||||
@media (min-width $md)
|
||||
flex-direction row-reverse
|
||||
align-items unset
|
||||
aside.author
|
||||
margin-bottom 0
|
||||
ol.entries
|
||||
margin-right 2rem
|
||||
justify-content flex-start
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
{% load static %}
|
||||
{% block styles %}
|
||||
<link rel="stylesheet" type="text/stylus" href="{% static 'home/css/index.styl' %}" />
|
||||
<link rel="stylesheet" type="text/stylus" href="{% static 'entries/css/h-entry.styl' %}" />
|
||||
{% endblock %}
|
||||
{% block main %}
|
||||
<aside class="author">
|
||||
|
@ -35,4 +36,11 @@
|
|||
</div>
|
||||
</article>
|
||||
</aside>
|
||||
<ol class="list-unstyled entries">
|
||||
{% for entry in entries %}
|
||||
<li>
|
||||
{% include 'entries/h-entry.html' %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from django.shortcuts import get_object_or_404, render
|
||||
from users.models import User
|
||||
from entries.models import Entry
|
||||
from lemoncurry import breadcrumbs
|
||||
|
||||
breadcrumbs.add('home:index', 'home')
|
||||
|
@ -7,7 +8,9 @@ breadcrumbs.add('home:index', 'home')
|
|||
|
||||
def index(request):
|
||||
user = get_object_or_404(User, pk=1)
|
||||
entries = Entry.objects.filter(author=user)
|
||||
return render(request, 'home/index.html', {
|
||||
'user': user,
|
||||
'entries': entries,
|
||||
'meta': user.as_meta(request),
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue