Refactor add-artist form into an include file.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 27 Jul 2012 14:25:30 +0000 (16:25 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 27 Jul 2012 14:25:30 +0000 (16:25 +0200)
src/main/resources/templates/admin.add-artist
src/main/resources/templates/admin.artists
src/main/resources/templates/include/admin.add-artist [new file with mode: 0644]

index a6e08ee..c3a2a42 100644 (file)
@@ -2,11 +2,10 @@
 
 <h1>Add Artist</h1>
 
-<form method="post">
+<%if error|matches value=="no-name-given">
+       <p>You have to specify a name.</p>
+<%/if>
 
-       <label>Name: <input type="text" name="name" value=""/></label>
-       <button type="submit">Add Artist</button>
-
-</form>
+<%include include/admin.add-artist>
 
 <%include include/footer>
\ No newline at end of file
index 9b261c4..40aea01 100644 (file)
@@ -8,6 +8,8 @@
        <%last></ul><%/last>
 <%/foreach>
 
-<a href="admin.add-artist">add new artist</a>
+<h2>Add a New Artist</h2>
+
+<%include include/admin.add-artist>
 
 <%include include/footer>
\ No newline at end of file
diff --git a/src/main/resources/templates/include/admin.add-artist b/src/main/resources/templates/include/admin.add-artist
new file mode 100644 (file)
index 0000000..4e4005b
--- /dev/null
@@ -0,0 +1,9 @@
+<form action="admin.add-artist" method="post" accept-charset="utf-8">
+
+       <div>
+               Name:
+               <input type="text" name="name" value=""/>
+               <button type="submit">Add Artist</button>
+       </div>
+
+</form>