Add photostream
This commit is contained in:
parent
f04beb3aaa
commit
837e4fe693
4 changed files with 26 additions and 2 deletions
16
gallery/templates/gallery/photo_list.html
Normal file
16
gallery/templates/gallery/photo_list.html
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
<!-- Title -->
|
||||||
|
{% block title %} Gallery : Photostream {% endblock %}
|
||||||
|
|
||||||
|
<!-- Breadcrumb -->
|
||||||
|
{% block breadcrumb %}
|
||||||
|
<li>Photostream</li>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
<!-- Content -->
|
||||||
|
{% block content %}
|
||||||
|
{% for photo in object_list %}
|
||||||
|
<a href="{{ photo.get_absolute_url }}">{{ photo.slug }}</a>
|
||||||
|
{% endfor %}
|
||||||
|
{% endblock %}
|
|
@ -9,6 +9,9 @@ urlpatterns = [
|
||||||
# Main page
|
# Main page
|
||||||
path('', views.Main.as_view(), name='main_url'),
|
path('', views.Main.as_view(), name='main_url'),
|
||||||
|
|
||||||
|
# Top kuvat
|
||||||
|
path('photostream/', views.PhotosList.as_view(), name='photos_url'),
|
||||||
|
|
||||||
# Yksittäinen kuva albumissa:
|
# Yksittäinen kuva albumissa:
|
||||||
path('albums/<path:album_path>/<int:photo_slug>/', views.PhotoDetail.as_view(), name="photo_url"),
|
path('albums/<path:album_path>/<int:photo_slug>/', views.PhotoDetail.as_view(), name="photo_url"),
|
||||||
|
|
||||||
|
|
|
@ -38,3 +38,8 @@ class PhotoDetail(DetailView):
|
||||||
return get_object_or_404(Photo, slug=self.kwargs.get('photo_slug'))
|
return get_object_or_404(Photo, slug=self.kwargs.get('photo_slug'))
|
||||||
|
|
||||||
|
|
||||||
|
class PhotosList(ListView):
|
||||||
|
model = Photo
|
||||||
|
paginate_by = 30
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
<ul class="uk-navbar-nav">
|
<ul class="uk-navbar-nav">
|
||||||
<li><a href="{% url 'gallery:main_url' %}"><span uk-icon="camera"></span></a></li>
|
<li><a href="{% url 'gallery:main_url' %}"><span uk-icon="camera"></span></a></li>
|
||||||
<li class="uk-visible@m"><a href="{% url 'gallery:albums_url' %}">Albums</a></li>
|
<li class="uk-visible@m"><a href="{% url 'gallery:albums_url' %}">Albums</a></li>
|
||||||
<li class="uk-visible@m"><a href="">Photostream</a></li>
|
<li class="uk-visible@m"><a href="{% url 'gallery:photos_url' %}">Photostream</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-navbar-right uk-margin-right">
|
<div class="uk-navbar-right uk-margin-right">
|
||||||
|
@ -52,7 +52,7 @@
|
||||||
<ul class="uk-nav uk-nav-default">
|
<ul class="uk-nav uk-nav-default">
|
||||||
<li><a href="{% url 'gallery:main_url' %}">Home</a></li>
|
<li><a href="{% url 'gallery:main_url' %}">Home</a></li>
|
||||||
<li><a href="{% url 'gallery:albums_url' %}">Albums</a></li>
|
<li><a href="{% url 'gallery:albums_url' %}">Albums</a></li>
|
||||||
<li><a href="">Photostream</a></li>
|
<li><a href="{% url 'gallery:photos_url' %}">Photostream</a></li>
|
||||||
<li><a href="#">Contact</a></li>
|
<li><a href="#">Contact</a></li>
|
||||||
{% if user.is_authenticated %}
|
{% if user.is_authenticated %}
|
||||||
<li><a href="{% url 'admin:index' %}">Admin</a></li>
|
<li><a href="{% url 'admin:index' %}">Admin</a></li>
|
||||||
|
|
Loading…
Reference in a new issue