posted by me checkbox
[zzz-floof.git] / floof / templates / art / new.mako
index e2c00fb..684c004 100644 (file)
@@ -3,7 +3,42 @@
 <h1>Add New Art</h1>
 <p>Now: Upload a file.  Later: Supply a link?  Not exclusive to uploading.</p>
 
-${h.form(h.url_for(controller='art', action='upload'), multipart=True)}
-${h.file('file')}
+## Todo: write some macros to make outputting form fields easier.
+
+${h.form(h.url('create_art'), multipart=True)}
+
+<div>
+    ${normal_field(c.form.by)}
+    ${checkbox_field(c.form.by_me)}
+</div>
+
+<div>${normal_field(c.form.file)}</div>
+
+
+##Artist: ${h.text('artist')}
+##${h.file('file')}
 ${h.submit(None, 'Upload!')}
 ${h.end_form()}
+
+
+<%def name="field_errors(errors)">
+    %if errors:
+    <ul class="errors">
+        %for error in errors:
+            <li>${error}
+        %endfor
+    </ul>
+    %endif
+</%def>
+
+
+<%def name="normal_field(field)">
+    ${field.label()|n}
+    ${field()|n}
+    ${field_errors(field.errors)}
+</%def>
+
+<%def name="checkbox_field(field)">
+    ${field()|n} ${field.label()|n}
+    ${field_errors(field.errors)}
+</%def>
\ No newline at end of file