Use Semantic UI for all HTML templates
[cacert-boardvoting.git] / templates / edit_motion_form.html
index d17389c..f686183 100644 (file)
@@ -1,73 +1,72 @@
 {{ template "header" . }}
-<form action="/motions/{{ .Form.Decision.Tag }}/edit" method="post">
-    <table>
-        <tr>
-            <td>ID:</td>
-            <td>{{ .Form.Decision.Tag }}</td>
-        </tr>
-        <tr>
-            <td>Proponent:</td>
-            <td>{{ .Voter.Name }}</td>
-        </tr>
-        <tr>
-            <td>Proposed date/time:</td>
-            <td>{{ .Form.Decision.Proposed }}</td>
-        </tr>
-        <tr>
-            <td>Title:</td>
-            <td><input name="Title" value="{{ .Form.Title }}"/>
-                {{ with .Form.Errors.Title }}
-                <span class="error">{{ . }}</span>
+<div class="column">
+    <div class="ui floated right secondary menu">
+        <a href="/motions/" class="item" title="Show all votes">Back to
+            motions</a>
+    </div>
+</div>
+<div class="column">
+    <div class="ui raised segment">
+        <form action="/motions/{{ .Form.Decision.Tag }}/edit" method="post">
+            <div class="ui form{{ if .Form.Errors }} error{{ end }}">
+                <div class="three fields">
+                    <div class="field">
+                        <label>ID:</label>
+                        <a href="/motions/{{ .Form.Decision.Tag }}">{{ .Form.Decision.Tag }}</a>
+                    </div>
+                    <div class="field">
+                        <label>Proponent:</label>
+                        {{ .Voter.Name }}
+                    </div>
+                    <div class="field">
+                        <label>Proposed date/time:</label>
+                        {{ .Form.Decision.Proposed|date "2006-01-02 15:04:05 UTC" }}
+                    </div>
+                </div>
+                <div class="required field{{ if .Form.Errors.Title }} error{{ end }}">
+                    <label for="Title">Title:</label>
+                    <input name="Title" type="text" value="{{ .Form.Title }}">
+                </div>
+                <div class="required field{{ if .Form.Errors.Content }} error{{ end }}">
+                    <label for="Content">Text:</label>
+                    <textarea name="Content">{{ .Form.Content }}</textarea>
+                </div>
+                <div class="two fields">
+                    <div class="required field{{ if .Form.Errors.VoteType }} error{{ end }}">
+                        <label for="VoteType">Vote type:</label>
+                        <select name="VoteType">
+                            <option value="0"
+                                    {{ if eq "0" .Form.VoteType }}selected{{ end }}>
+                                Motion
+                            </option>
+                            <option value="1"
+                                    {{ if eq "1" .Form.VoteType }}selected{{ end }}>
+                                Veto
+                            </option>
+                        </select>
+                    </div>
+                    <div class="required field{{ if .Form.Errors.Due }} error{{ end }}">
+                        <label for="Due">Due: (autofilled from chosen
+                            option)</label>
+                        <select name="Due">
+                            <option value="+3 days">In 3 Days</option>
+                            <option value="+7 days">In 1 Week</option>
+                            <option value="+14 days">In 2 Weeks</option>
+                            <option value="+28 days">In 4 Weeks</option>
+                        </select>
+                    </div>
+                </div>
+                {{ with .Form.Errors }}
+                <div class="ui error message">
+                    {{ with .Title }}<p>{{ . }}</p>{{ end }}
+                    {{ with .Content }}<p>{{ . }}</p>{{ end }}
+                    {{ with .VoteType }}<p>{{ . }}</p>{{ end }}
+                    {{ with .Due }}<p>{{ . }}</p>{{ end }}
+                </div>
                 {{ end }}
-            </td>
-        </tr>
-        <tr>
-            <td>Text:</td>
-            <td><textarea name="Content">{{ .Form.Content }}</textarea>
-                {{ with .Form.Errors.Content }}
-                <span class="error">{{ . }}</span>
-                {{ end }}
-            </td>
-        </tr>
-        <tr>
-            <td>Vote type:</td>
-            <td>
-                <select name="VoteType">
-                    <option value="0"
-                            {{ if eq "0" .Form.VoteType }}selected{{ end }}>
-                        Motion
-                    </option>
-                    <option value="1"
-                            {{ if eq "1" .Form.VoteType }}selected{{ end }}>Veto
-                    </option>
-                </select>
-                {{ with .Form.Errors.VoteType }}
-                <span class="error">{{ . }}</span>
-                {{ end }}
-            </td>
-        </tr>
-        <tr>
-            <td rowspan="2">Due:</td>
-            <td>(autofilled from option below)</td>
-        </tr>
-        <tr>
-            <td>
-                <select name="Due">
-                    <option value="+3 days">In 3 Days</option>
-                    <option value="+7 days">In 1 Week</option>
-                    <option value="+14 days">In 2 Weeks</option>
-                    <option value="+28 days">In 4 Weeks</option>
-                </select>
-                {{ with .Form.Errors.Due }}
-                <span class="error">{{ . }}</span>
-                {{ end }}
-            </td>
-        </tr>
-        <tr>
-            <td>&nbsp;</td>
-            <td><input type="submit" value="Propose"/></td>
-        </tr>
-    </table>
-</form>
-<a href="/motions/">Back to motions</a>
+                <button class="ui button" type="submit">Propose</button>
+            </div>
+        </form>
+    </div>
+</div>
 {{ template "footer" . }}
\ No newline at end of file