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