summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorJan Dittberner <jandd@cacert.org>2017-04-29 22:17:58 +0200
committerJan Dittberner <jandd@cacert.org>2017-04-29 22:17:58 +0200
commit1c989fdfa3d15b35342d439bcb3fbab894b6d46c (patch)
treed3a010d35294ef277deebf0f31ecdc344d65e20f /templates
parent2a38b6bcadfc5676d98446f47dc7c9c87bca727b (diff)
downloadcacert-boardvoting-1c989fdfa3d15b35342d439bcb3fbab894b6d46c.tar.gz
cacert-boardvoting-1c989fdfa3d15b35342d439bcb3fbab894b6d46c.tar.xz
cacert-boardvoting-1c989fdfa3d15b35342d439bcb3fbab894b6d46c.zip
Work on Semantic UI theming
Diffstat (limited to 'templates')
-rw-r--r--templates/footer.html8
-rw-r--r--templates/header.html34
-rw-r--r--templates/motion_fragments.html73
-rw-r--r--templates/motions.html18
4 files changed, 100 insertions, 33 deletions
diff --git a/templates/footer.html b/templates/footer.html
index a7086ad..f2bc089 100644
--- a/templates/footer.html
+++ b/templates/footer.html
@@ -1,4 +1,12 @@
{{ define "footer" }}
+</div>
+<script type="text/javascript">
+ $(document).ready(function() {
+ $('.message .close').on('click', function() {
+ $(this).closest('.message').transition('fade');
+ });
+ });
+</script>
</body>
</html>
{{ end }} \ No newline at end of file
diff --git a/templates/header.html b/templates/header.html
index a6fc69e..814e845 100644
--- a/templates/header.html
+++ b/templates/header.html
@@ -1,22 +1,26 @@
-{{ define "pagetitle" }}
-CAcert Board Decisions{{ if .PageTitle }} - {{ .PageTitle }}{{ end}}
-{{ end }}
-
{{ define "header" -}}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/html">
<head>
- <title>{{ template "pagetitle" . }}</title>
+ <title>{{ block "pagetitle" . }}CAcert Board Decisions{{ if .PageTitle }} - {{ .PageTitle }}{{ end }}{{ end }}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <link rel="stylesheet" type="text/css" href="/static/styles.css"/>
+ <link rel="stylesheet" type="text/css" href="/static/semantic.css"/>
+ <script type="text/javascript" src="/static/js/jquery.js"></script>
+ <script type="text/javascript" src="/static/semantic.js"></script>
</head>
-<body>
-<h1>{{ template "pagetitle" . }}</h1>
-{{ with .Flashes }}
-<ul class="flash-messages">
-{{ range . }}
- <li>{{ . }}</li>
-{{ end }}
-</ul>
-{{ end }}
+<body class="site">
+<div class="ui container">
+ <h1 class="ui header">{{ template "pagetitle" . }}</h1>
+ {{ with .Flashes }}
+ <div class="ui info message">
+ <i class="close icon"></i>
+ <div class="ui list">
+ {{ range . }}
+ <div class="ui item">{{ . }}</div>
+ {{ end }}
+ </div>
+ </div>
+ {{ end }}
+</div>
+<div class="ui one column grid container">
{{ end }} \ No newline at end of file
diff --git a/templates/motion_fragments.html b/templates/motion_fragments.html
index 38c7a01..d5f0233 100644
--- a/templates/motion_fragments.html
+++ b/templates/motion_fragments.html
@@ -1,4 +1,49 @@
{{ define "motion_fragment" }}
+<div class="column">
+ <div class="ui raised segment">
+ <span class="ui {{ template "status_class" .Status }} ribbon label">{{ .Status|toString|title }}</span>
+ <span class="header">{{ .Modified|date "2006-01-02 15:04:05 UTC" }}</span>
+ <h2 class="header"><a href="/motions/{{ .Tag }}">{{ .Tag }}: {{ .Title }}</a></h2>
+ <pre>{{ wrap 76 .Content }}</pre>
+ <table class="ui small definition table">
+ <tbody>
+ <tr>
+ <td>Due</td>
+ <td>{{.Due|date "2006-01-02 15:04:05 UTC"}}</td>
+ </tr>
+ <tr>
+ <td>Proposed</td>
+ <td>{{.Proposer}} ({{.Proposed|date "2006-01-02 15:04:05 UTC"}})</td>
+ </tr>
+ <tr>
+ <td>Vote type:</td>
+ <td>{{ .VoteType|toString|title }}</td>
+ </tr>
+ <tr>
+ <td>Votes:</td>
+ <td>
+ <div class="ui labels">
+ <div class="ui basic label green"><i class="check circle icon"></i>Aye<div class="detail">{{.Ayes}}</div></div>
+ <div class="ui basic label red"><i class="minus circle icon"></i>Naye<div class="detail">{{.Nayes}}</div></div>
+ <div class="ui basic label grey"><i class="circle icon"></i>Abstain<div class="detail">{{.Abstains}}</div></div>
+ </div>
+ {{ if .Votes }}
+ <div class="list">
+ {{ range .Votes }}
+ <div class="item">{{ .Name }}: {{ .Vote.Vote }}</div>
+ {{ end }}
+ </div>
+ <a href="/motions/{{ .Tag }}">Hide Votes</a>
+ {{ else }}
+ <a href="/motions/{{ .Tag }}?showvotes=1">Show Votes</a>
+ {{ end }}
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+</div>
+<!--
<td class="{{.Status}}">
{{ if eq .Status 0 }}Pending {{ .Due}}
{{ else if eq .Status 1}}Approved {{ .Modified}}
@@ -26,18 +71,22 @@
<i><a href="/motions/{{.Tag}}?showvotes=1">Show Votes</a></i>
{{ end }}
</td>
+ -->
{{ end }}
+
+{{ define "status_class" }}{{ if eq . 0 }}blue{{ else if eq . 1 }}green{{ else if eq . -1 }}red{{ else if eq . -2 }}grey{{ end }}{{ end }}
+
{{ define "motion_actions" }}
- <td>
- {{ if eq .Status 0 }}
- <ul>
- <li><a href="/vote/{{ .Tag }}/aye">Aye</a></li>
- <li><a href="/vote/{{ .Tag }}/abstain">Abstain</a></li>
- <li><a href="/vote/{{ .Tag }}/naye">Naye</a></li>
- <li><a href="/proxy/{{ .Tag }}">Proxy Vote</a></li>
- <li><a href="/motions/{{ .Tag }}/edit">Modify</a></li>
- <li><a href="/motions/{{ .Tag }}/withdraw">Withdraw</a></li>
- </ul>
- {{ end }}
- </td>
+<td>
+ {{ if eq .Status 0 }}
+ <ul>
+ <li><a href="/vote/{{ .Tag }}/aye">Aye</a></li>
+ <li><a href="/vote/{{ .Tag }}/abstain">Abstain</a></li>
+ <li><a href="/vote/{{ .Tag }}/naye">Naye</a></li>
+ <li><a href="/proxy/{{ .Tag }}">Proxy Vote</a></li>
+ <li><a href="/motions/{{ .Tag }}/edit">Modify</a></li>
+ <li><a href="/motions/{{ .Tag }}/withdraw">Withdraw</a></li>
+ </ul>
+ {{ end }}
+</td>
{{ end }}
diff --git a/templates/motions.html b/templates/motions.html
index e5279bd..bb4bb94 100644
--- a/templates/motions.html
+++ b/templates/motions.html
@@ -1,17 +1,23 @@
{{ template "header" . }}
{{ $voter := .Voter }}
-{{ if .Params.Flags.Unvoted }}
-<a href="/motions/">Show all votes</a>
-{{ else if $voter }}
-<a href="/motions/?unvoted=1">Show my pending votes</a><br/>
-{{ end }}
+<div class="column">
+ <div class="ui floated right secondary menu">
+ <a href="/motions/" class="{{ if not .Params.Flags.Unvoted }}active {{ end }}item" title="Show all votes">All votes</a>
+ <a href="/motions/?unvoted=1" class="{{ if .Params.Flags.Unvoted }}active {{ end}}item" title="Show my outstanding votes">My outstanding votes</a>
+ </div>
+</div>
{{ if .Decisions }}
+ {{ range .Decisions }}
+ {{ template "motion_fragment" . }}
+ {{ end }}
<table class="list">
<thead>
<tr>
<th>Status</th>
<th>Motion</th>
- {{ if $voter }}<th>Actions</th>{{ end }}
+ {{ if $voter }}
+ <th>Actions</th>
+ {{ end }}
</tr>
</thead>
<tbody>