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
|
display flex
|
||||||
|
margin-bottom 0
|
||||||
|
flex 1
|
||||||
flex-direction column
|
flex-direction column
|
||||||
justify-content center
|
justify-content center
|
||||||
> li
|
> li
|
||||||
|
|
|
@ -6,6 +6,13 @@ $xl = 1200px
|
||||||
main
|
main
|
||||||
flex-direction column
|
flex-direction column
|
||||||
align-items center
|
align-items center
|
||||||
|
aside.author
|
||||||
|
margin-bottom 1rem
|
||||||
@media (min-width $md)
|
@media (min-width $md)
|
||||||
flex-direction row-reverse
|
flex-direction row-reverse
|
||||||
align-items unset
|
align-items unset
|
||||||
|
aside.author
|
||||||
|
margin-bottom 0
|
||||||
|
ol.entries
|
||||||
|
margin-right 2rem
|
||||||
|
justify-content flex-start
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
{% load static %}
|
{% load static %}
|
||||||
{% block styles %}
|
{% block styles %}
|
||||||
<link rel="stylesheet" type="text/stylus" href="{% static 'home/css/index.styl' %}" />
|
<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 %}
|
{% endblock %}
|
||||||
{% block main %}
|
{% block main %}
|
||||||
<aside class="author">
|
<aside class="author">
|
||||||
|
@ -35,4 +36,11 @@
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
</aside>
|
</aside>
|
||||||
|
<ol class="list-unstyled entries">
|
||||||
|
{% for entry in entries %}
|
||||||
|
<li>
|
||||||
|
{% include 'entries/h-entry.html' %}
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ol>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
from django.shortcuts import get_object_or_404, render
|
from django.shortcuts import get_object_or_404, render
|
||||||
from users.models import User
|
from users.models import User
|
||||||
|
from entries.models import Entry
|
||||||
from lemoncurry import breadcrumbs
|
from lemoncurry import breadcrumbs
|
||||||
|
|
||||||
breadcrumbs.add('home:index', 'home')
|
breadcrumbs.add('home:index', 'home')
|
||||||
|
@ -7,7 +8,9 @@ breadcrumbs.add('home:index', 'home')
|
||||||
|
|
||||||
def index(request):
|
def index(request):
|
||||||
user = get_object_or_404(User, pk=1)
|
user = get_object_or_404(User, pk=1)
|
||||||
|
entries = Entry.objects.filter(author=user)
|
||||||
return render(request, 'home/index.html', {
|
return render(request, 'home/index.html', {
|
||||||
'user': user,
|
'user': user,
|
||||||
|
'entries': entries,
|
||||||
'meta': user.as_meta(request),
|
'meta': user.as_meta(request),
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue