Refine HTML layout
This commit improves the page structure and unifies the layout. Some reusable parts of the HTML code have been moved into page_fragments.html.main 0.6.0
parent
1f32b6d25b
commit
ea9641cfb1
@ -1,17 +1,23 @@
|
||||
{{ template "header.html" . }}
|
||||
<div class="column">
|
||||
<div class="ui negative message">
|
||||
<div class="header.html">You are not authorized to act here!</div>
|
||||
<div class="ui container">
|
||||
<div class="ui negative icon message">
|
||||
<i class="ban icon "></i>
|
||||
<div class="content">
|
||||
<div class="header">You are not authorized to act here!</div>
|
||||
<p>If you think this is in error, please contact the administrator.</p>
|
||||
<p>If you don't know who that is, it is definitely not an error ;)</p>
|
||||
{{ if .Emails }}
|
||||
<p>The following addresses were present in your certificate:<p>
|
||||
<ul>
|
||||
<div class="ui list">
|
||||
{{ range .Emails }}
|
||||
<li>{{ . }}</li>
|
||||
<div class="item">
|
||||
<i class="address card outline icon"></i>
|
||||
<div class="content">{{ . }}</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ template "footer.html" . }}
|
@ -1,19 +1,20 @@
|
||||
{{ template "header.html" . }}
|
||||
{{ $voter := .Voter }}
|
||||
<div class="column">
|
||||
<div class="ui basic segment">
|
||||
<div class="ui floated right secondary menu">
|
||||
<div class="ui secondary pointing menu">
|
||||
<a href="/motions/" class="item" title="Show all votes">All votes</a>
|
||||
{{ if $voter }}<a href="/motions/?unvoted=1" class="item" title="Show my outstanding votes">My outstanding votes</a>{{ end }}
|
||||
{{ if $voter }}
|
||||
<a href="/motions/?unvoted=1" class="item" title="Show my outstanding votes">My outstanding votes</a>
|
||||
<div class="right item">
|
||||
<a class="ui primary button" href="/newmotion/">New motion</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ with .Decision }}
|
||||
<div class="column">
|
||||
<div class="ui raised segment">
|
||||
{{ template "motion_fragment" . }}
|
||||
{{ if $voter }}{{ template "motion_actions" . }}{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end}}
|
||||
{{ template "footer.html" . }}
|
@ -1,52 +1,45 @@
|
||||
{{ template "header.html" . }}
|
||||
{{ $voter := .Voter }}
|
||||
<div class="column">
|
||||
{{ $page := . }}
|
||||
<div class="ui basic segment">
|
||||
<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>
|
||||
{{ if $voter }}<a href="/motions/?unvoted=1" class="{{ if .Params.Flags.Unvoted }}active {{ end}}item" title="Show my outstanding votes">My outstanding votes</a>{{ end }}
|
||||
</div>
|
||||
{{ if $voter }}<a class="ui primary button" href="/newmotion/">New motion</a>{{ end }}
|
||||
{{ if .PrevPage -}}
|
||||
<a href="?page={{ .PrevPage }}{{ if .Params.Flags.Unvoted }}&unvoted=1{{ end }}"
|
||||
class="ui left labeled icon button" title="newer motions"><i class="left arrow icon"></i> newer</a>
|
||||
{{- end }}
|
||||
{{ if .NextPage -}}
|
||||
<a href="?page={{ .NextPage }}{{ if .Params.Flags.Unvoted }}&unvoted=1{{ end }}"
|
||||
class="ui right labeled icon button" title="older motions"><i class="right arrow icon"></i> older</a>
|
||||
{{- end }}
|
||||
<div class="ui secondary pointing menu">
|
||||
<a href="/motions/" class="{{ if not .Params.Flags.Unvoted }}active {{ end }}item" title="Show all votes">All
|
||||
votes</a>
|
||||
{{ if $voter }}
|
||||
<a href="/motions/?unvoted=1" class="{{ if .Params.Flags.Unvoted }}active {{ end}}item"
|
||||
title="Show my outstanding votes">My outstanding votes</a>
|
||||
<div class="right item">
|
||||
<a class="ui primary button" href="/newmotion/">New motion</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ if .Decisions }}
|
||||
<div class="ui labeled icon menu">
|
||||
{{ template "pagination_fragment" $page }}
|
||||
</div>
|
||||
{{ range .Decisions }}
|
||||
<div class="column">
|
||||
<div class="ui raised segment">
|
||||
{{ template "motion_fragment" . }}
|
||||
{{ if $voter }}{{ template "motion_actions" . }}{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="column">
|
||||
<div class="ui basic segment">
|
||||
{{ if $voter }}<a class="ui primary button" href="/newmotion/">New motion</a>{{ end }}
|
||||
{{ if .PrevPage -}}
|
||||
<a href="?page={{ .PrevPage }}{{ if .Params.Flags.Unvoted }}&unvoted=1{{ end }}"
|
||||
class="ui left labeled icon button" title="newer motions">
|
||||
<i class="left arrow icon"></i> newer</a>
|
||||
{{- end }}
|
||||
{{ if .NextPage -}}
|
||||
<a href="?page={{ .NextPage }}{{ if .Params.Flags.Unvoted }}&unvoted=1{{ end }}"
|
||||
class="ui right labeled icon button" title="older motions">
|
||||
<i class="right arrow icon"></i> older</a>
|
||||
{{- end }}
|
||||
</div>
|
||||
<div class="ui labeled icon menu">
|
||||
{{ template "pagination_fragment" $page }}
|
||||
</div>
|
||||
{{ else }}
|
||||
<div class="ui basic segment">
|
||||
<div class="ui icon message">
|
||||
<i class="inbox icon"></i>
|
||||
<div class="content">
|
||||
<div class="header">No motions available</div>
|
||||
{{ if .Params.Flags.Unvoted }}
|
||||
<p>There are no motions requiring a vote from you.</p>
|
||||
{{ else }}
|
||||
<p>There are no motions in the system yet.</p>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ template "footer.html" . }}
|
@ -0,0 +1,20 @@
|
||||
{{ define "pagination_fragment" }}
|
||||
{{ if .PrevPage -}}
|
||||
<a class="item" href="?page={{ .PrevPage }}{{ if .Params.Flags.Unvoted }}&unvoted=1{{ end }}">
|
||||
<i class="left arrow icon"></i> newer
|
||||
</a>
|
||||
{{- end }}
|
||||
{{ if .NextPage -}}
|
||||
<a class="right item" href="?page={{ .NextPage }}{{ if .Params.Flags.Unvoted }}&unvoted=1{{ end }}">
|
||||
<i class="right arrow icon"></i> older
|
||||
</a>
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "return_header" }}
|
||||
<div class="ui basic segment">
|
||||
<div class="ui secondary pointing menu">
|
||||
<a href="/motions/" class="item" title="Show all votes">Back to motions</a>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
@ -1,22 +1,17 @@
|
||||
{{ template "header.html" . }}
|
||||
<div class="column">
|
||||
<div class="ui basic segment">
|
||||
<div class="ui floated right secondary menu">
|
||||
<a href="/motions/" class="item" title="Show all votes">Back to motions</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ template "return_header" . }}
|
||||
{{ with .Decision }}
|
||||
<div class="column">
|
||||
<div class="ui raised segment">
|
||||
{{ template "motion_fragment" . }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="ui basic segment">
|
||||
<form action="/motions/{{ .Decision.Tag }}/withdraw" method="post">
|
||||
{{ csrfField }}
|
||||
<div class="ui form">
|
||||
<button class="ui primary left labeled icon button" type="submit"><i class="trash icon"></i> Withdraw</button>
|
||||
<button class="ui primary left labeled icon button" type="submit"><i class="trash icon"></i> Withdraw
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{{ template "footer.html" . }}
|
Loading…
Reference in New Issue