From aa93211025dff86a600dabf39ca91753bddb4546 Mon Sep 17 00:00:00 2001 From: Skia Date: Tue, 21 Feb 2017 14:29:58 +0100 Subject: [PATCH] Add support for editing album date --- sas/templates/sas/album.jinja | 2 +- sas/views.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sas/templates/sas/album.jinja b/sas/templates/sas/album.jinja index 74091964..eb18a4e1 100644 --- a/sas/templates/sas/album.jinja +++ b/sas/templates/sas/album.jinja @@ -39,7 +39,7 @@ {% endif %} {% endif %}
- {% for a in album.children_albums.order_by('-id') %} + {% for a in album.children_albums.order_by('-date') %}
{% if edit_mode %} diff --git a/sas/views.py b/sas/views.py index 06660724..c9de8edf 100644 --- a/sas/views.py +++ b/sas/views.py @@ -253,7 +253,8 @@ class PictureEditForm(forms.ModelForm): class AlbumEditForm(forms.ModelForm): class Meta: model = Album - fields=['name', 'file', 'parent', 'edit_groups'] + fields = ['name', 'date', 'file', 'parent', 'edit_groups'] + date = forms.DateField(label=_("Date"), widget=SelectDate, required=True) parent = make_ajax_field(Album, 'parent', 'files', help_text="") edit_groups = make_ajax_field(Album, 'edit_groups', 'groups', help_text="") recursive = forms.BooleanField(label=_("Apply rights recursively"), required=False)