-
Notifications
You must be signed in to change notification settings - Fork 174
Expand file tree
/
Copy pathproposal.tmpl
More file actions
141 lines (134 loc) · 6.07 KB
/
Copy pathproposal.tmpl
File metadata and controls
141 lines (134 loc) · 6.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
{{define "proposal"}}
{{template "top" .}}
<div id="main" data-handler="proposal" class="py-5 overflow-y-auto">
{{$politeiaURL := .PoliteiaURL}}
{{$shortToken := .ShortToken}}
{{$votingPower := 0}}
{{$proposalToken := ""}}
{{with .Proposal}}
{{$proposalToken = .Token}}
{{with .VoteDetails}}
{{$votingPower = len .EligibleTickets}}
{{end}}
{{end}}
<section id="proposalInfo" data-token="{{$proposalToken}}" data-votingpower="{{$votingPower}}" data-assetid="42"
class="flex-stretch-column mw-500 mx-auto pb-3 pt-2 px-3">
<div class="d-flex justify-content-start align-items-center">
<span id="goBackToProposals" class="ico-wide-headed-left-arrow fs24 py-1 lh1 hoverbg pointer"></span>
</div>
{{if .ErrorMsg}}
<div class="text-danger m-2 p-3">{{.ErrorMsg}}</div>
{{end}}
{{with .Proposal}}
{{$meta := .Metadata}}
<div class="d-flex justify-content-between mt-3">
<h5 class="pb-0 mb-0">
{{.Name}}
</h5>
<small class="{{if eq $meta.VoteStatusDesc "Approved"}}buycolor{{else if eq $meta.VoteStatusDesc "Rejected"
}}text-danger{{else}}text-color-secondary{{end}}">
{{$meta.VoteStatusDesc}}
</small>
</div>
<div class="d-flex justify-content-between">
<span class="text-muted">{{.Username}} — [[[version]]] {{.Version}}</span>
</div>
<hr class="mt-2">
<div class="mb-2">
<div class="d-flex">
<span>[[[token]]]</span>
<span class="ms-auto">{{.Token}}</span>
</div>
{{if gt .TotalVotes 0}}
<div class="d-flex">
<span>[[[total_votes]]]</span>
<span class="ms-auto">{{.TotalVotes}}</span>
</div>
<div class="d-flex">
<span>[[[quorum_requirements]]]</span>
<span class="ms-auto">{{$meta.QuorumCount}}</span>
</div>
{{end}}
<div class="d-flex">
<span> [[[comments]]]</span>
<span class="ms-auto">{{.CommentsCount}}</span>
</div>
<div class="d-flex">
<span>[[[published]]]</span>
<span class="ms-auto">{{timeAgo .PublishedAt}}</span>
</div>
</div>
<div class="d-flex mb-2 mt-1 {{if eq .TotalVotes 0}}d-hide{{end}}">
<div class="me-2 d-flex">
<div class="yes-indicator mt-2 me-1"></div> [[[Yes]]]: {{$meta.Yes}} ({{printf "%.1f"
$meta.Approval}}%)
</div>
<div class="d-flex">
<div class="no-indicator mt-2 me-1"></div> [[[No]]]: {{$meta.No}} ({{printf "%.1f"
$meta.Rejection}}%)
</div>
</div>
<div class="d-flex align-items-center mb-2 {{if eq .TotalVotes 0}}d-hide{{end}}">
<div class="vote-bar" data-yes="{{ $meta.Approval }}" data-no="{{ $meta.Rejection }}"
data-threshold="{{ $meta.PassPercent }}">
<div class="vote-yes"></div>
<div class="vote-no"></div>
<span class="approval-threshold"></span>
</div>
</div>
<div class="d-flex {{if eq .TotalVotes 0}}d-hide{{end}}">
<small class="text-muted ms-auto">{{.TotalVotes}} [[[votes]]]</small>
</div>
<button id="viewVoteFormBtn" type="button" class="btn w-100 rounded25 mt-2 mb-2 {{if eq $votingPower 0}}d-hide{{end}}">
[[[vote_now]]]
</button>
<div class="d-flex align-items-center mt-2">
<h5>[[[proposal_structure]]]</h5>
<a class="ms-auto plainlink flex-center" target="_blank"
href="{{$politeiaURL}}/record/{{$shortToken}}">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
aria-hidden="true">
<path d="M14 3h5a2 2 0 0 1 2 2v5" />
<path d="M10 14L21 3" />
<polyline points="15 3 21 3 21 9" />
<rect x="3" y="7" width="14" height="14" rx="2" ry="2" />
</svg>
<span class="ps-1 pt-1 fs12">[[[view_on_politeia]]]</span>
</a>
</div>
<small class="card p-3 proposal-content">{{mdToHTML .Description}}</small>
{{end}}
{{- /* POP-UP FORMS */ -}}
<div id="forms" class="d-hide">
{{- /* SUCCESS ANIMATION */ -}}
<form id="checkmarkForm" class="flex-center flex-column plain">
<div id="checkmarkBox" class="flex-center">
<span class="ico-check" id="checkmark"></span>
</div>
<div id="successMessage" class="fs22"></div>
</form>
{{- /* VOTE FORM */ -}}
<form class="d-hide" id="voteForm" autocomplete="off">
<div class="form-closer"><span class="ico-cross"></span></div>
<header>[[[vote]]]</header>
<div class="fs15 text-center text-muted">
[[[cast_vote_prompt]]]
</div>
<div class="d-flex justify-content-center fs15">
[[[voting_power]]]: {{$votingPower}}
</div>
<div class="d-flex justify-content-center mt-1">
<button class="vote-btn go rounded3 me-2" type="button" data-value="yes">[[[Yes]]]</button>
<button class="vote-btn danger rounded3" type="button" data-value="no">[[[No]]]</button>
</div>
<div class="flex-stretch-column">
<button id="voteSubmit" type="button" class="feature">[[[submit_vote]]]</button>
</div>
<div class="fs15 text-center d-hide text-danger text-break" id="voteFormError"></div>
</form>
</div>
</section>
</div>
{{template "bottom"}}
{{end}}