Add functions to manage groups of an artist.
[demoscenemusic.git] / src / main / resources / templates / admin.edit-artist
index a3fdcbe..77d2d35 100644 (file)
@@ -2,11 +2,84 @@
 
 <h1>Edit Artist</h1>
 
-<form method="post">
+<form method="post" accept-charset="utf-8">
 
-       <label>Name: <input type="text" name="name" value="<% artist.name|html>"/></label>
+       <label>Name: <input type="text" name="name" value="<% artist.name|html>"></label>
        <button type="submit">Edit Artist</button>
 
+       <%foreach artist.properties property>
+
+               <label>
+                       Property: <%property.key|html>
+                       <input type="text" name="value.<%property.key|html>" value="<%property.value|html>">
+                       <input type="checkbox" name="delete.<%property.key|html>">Delete
+               </label>
+
+       <%/foreach>
+
+       <label>
+               New Property:
+               <input type="text" name="property" value="">
+               <input type="text" name="value" value="">
+               <button type="submit" name="new-property" value="true">Add Property</button>
+       </label>
+
 </form>
 
+<h2>Groups</h2>
+
+<%foreach artist.groups group>
+
+       <form action="admin.edit-artist" method="post" accept-charset="utf-8">
+
+               <input type="hidden" name="id" value="<%artist.id|html>"/>
+               <input type="hidden" name="group" value="<%group.id|html>"/>
+
+               <div>
+                       <%group.name|html> <a href="admin.edit-group?id=<%group.id|html>">edit</a>
+               </div>
+               <button type="submit" name="delete-group" value="true">Delete Group</button>
+
+       </form>
+
+<%foreachelse>
+       <p>This artists does not belong to any groups.</p>
+<%/foreach>
+
+<h3>Add a Group</h3>
+
+<form action="admin.edit-artist" method="post" accept-charset="utf-8">
+
+       <input type="hidden" name="id" value="<%artist.id|html>"/>
+
+       <div>
+               Add Group:
+               <select name="group">
+                       <%foreach dataManager.allGroups group>
+                               <option value="<%group.id|html>"><%group.name|html></option>
+                       <%/foreach>
+               </select>
+       </div>
+       <button type="submit" name="add-group" value="true">Add Group</button>
+
+</form>
+
+<h2>Tracks</h2>
+
+<%foreach artist.tracks track>
+       <%first>
+               <ul>
+       <%/first>
+       <li><%track.name|html> <a href="admin.edit-track?id=<%track.id|html>">edit</a></li>
+       <%last>
+               </ul>
+       <%/last>
+<%foreachelse>
+       <p>This artist does not yet have any tracks.</p>
+<%/foreach>
+
+<h2>Add a New Track</h2>
+
+<%include include/admin.add-track>
+
 <%include include/footer>
\ No newline at end of file