Add photostream

This commit is contained in:
Nyymix 2025-01-05 22:34:39 +02:00
parent f04beb3aaa
commit 837e4fe693
4 changed files with 26 additions and 2 deletions

View 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 %}

View file

@ -9,6 +9,9 @@ urlpatterns = [
# Main page
path('', views.Main.as_view(), name='main_url'),
# Top kuvat
path('photostream/', views.PhotosList.as_view(), name='photos_url'),
# Yksittäinen kuva albumissa:
path('albums/<path:album_path>/<int:photo_slug>/', views.PhotoDetail.as_view(), name="photo_url"),

View file

@ -38,3 +38,8 @@ class PhotoDetail(DetailView):
return get_object_or_404(Photo, slug=self.kwargs.get('photo_slug'))
class PhotosList(ListView):
model = Photo
paginate_by = 30

View file

@ -30,7 +30,7 @@
<ul class="uk-navbar-nav">
<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="">Photostream</a></li>
<li class="uk-visible@m"><a href="{% url 'gallery:photos_url' %}">Photostream</a></li>
</ul>
</div>
<div class="uk-navbar-right uk-margin-right">
@ -52,7 +52,7 @@
<ul class="uk-nav uk-nav-default">
<li><a href="{% url 'gallery:main_url' %}">Home</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>
{% if user.is_authenticated %}
<li><a href="{% url 'admin:index' %}">Admin</a></li>