diff --git a/etiquette_site.py b/etiquette_site.py index 3dc153c..2785398 100644 --- a/etiquette_site.py +++ b/etiquette_site.py @@ -665,7 +665,6 @@ def get_user_json(username): @session_manager.give_token def post_album_add_tag(albumid): ''' - Edit the album's title and description. Apply a tag to every photo in the album. ''' response = {} @@ -685,6 +684,21 @@ def post_album_add_tag(albumid): return jsonify.make_json_response(response) +@site.route('/album//edit', methods=['POST']) +@session_manager.give_token +def post_album_edit(albumid): + ''' + Edit the title / description. + ''' + album = P_album(albumid) + + title = request.form.get('title', None) + description = request.form.get('description', None) + album.edit(title=title, description=description) + response = {'title': album.title, 'description': album.description} + return jsonify.make_json_response(response) + + def post_photo_add_remove_tag_core(photoid, tagname, add_or_remove): photo = P_photo(photoid, response_type='json') tag = P_tag(tagname, response_type='json') diff --git a/templates/album.html b/templates/album.html index 2ebee75..f37005e 100644 --- a/templates/album.html +++ b/templates/album.html @@ -6,6 +6,7 @@ Album {{album.display_name}} + @@ -24,15 +44,34 @@ p {{header.make_header(session=session)}}
-

{{album.title}}

-

{{album.description}}

- {% set parent=album.parent() %} +

+ {% if album.title %} + {{album.title}} + {% else %} + Album {{album.id}} + {% endif %} + + +

+ +

{{album.description}}

+ + + {% set viewparam = "?view=list" if view == "list" else "" %} + {% set parent = album.parent() %} {% if parent %}

Parent: {{parent.display_name}}

{% else %}

Parent: Albums

{% endif %} + {% set sub_albums = album.children() %} {% if sub_albums %}

Sub-albums

@@ -43,7 +82,9 @@ p {% endfor %} {% endif %} + {% set photos = album.photos() %} + {% if photos or sub_albums %} Download: {% if photos %} @@ -57,6 +98,8 @@ p {% endif %} + {% endif %} + {% if photos %}

Photos

{% if view != "list" %} @@ -75,10 +118,80 @@ p - \ No newline at end of file +