]> git.decadent.org.uk Git - memories.git/blobdiff - templates/user/album_list
Memories as at 1.3
[memories.git] / templates / user / album_list
diff --git a/templates/user/album_list b/templates/user/album_list
new file mode 100644 (file)
index 0000000..59bcad0
--- /dev/null
@@ -0,0 +1,41 @@
+<div class="albums">
+[% IF request.user == user %]
+    <h2> Albums </h2>
+    <form method="post" action="[%base%]/user/edit_albums/[%user.id%]">
+    [% IF user.albums.size > 0 %]
+    <table style="width:100%">
+        <tr>
+        <th style="width: 70%"> Name </th> <th> Private? </th> <th> Delete? </th>
+        </tr>
+    [% FOR album = user.albums %]
+        <tr>
+        <td> <a href="[%base%]/album/view/[%album.id%]/">[% album.name %]</a> </td>
+        <td> <input type="checkbox" name="privacy_[% album.id%]"
+        value="1" [% IF album.privacy == 1 %] checked="1" [%END%] />
+        </td>
+        <td> <input type="submit" value="Delete" name="delete_[%album.id%]"/>
+        </td>
+        </tr>
+    [% END %]
+    </table>
+    <input type="submit" value="Submit changes" name="changes">
+    <hr>
+    [% END %]
+    <h3> Create a new album </h3>
+    Name: <input name="new_name"/> <br>
+    Private? <input type="checkbox" name="new_privacy"/> <br>
+    <input type="submit" value="Create" name="create">
+    </form>
+[% ELSE %]
+
+[% IF albums.size > 0 %]
+    <h2> Public albums </h2>
+    <ul>
+    [% FOR album = albums %]
+    <li> <a href="[%base%]/album/view/[%album.id%]">[% album %]</a>
+    [% END %]
+    </ul>
+[% END %]
+
+[% END %]
+</div>