Changeset 667fb41 in Klonkt for src/views/pages/authorize-interaction.ejs
- Timestamp:
- 07/01/2026 01:32:22 PM (2 months ago)
- Branches:
- main
- Children:
- c45c187
- Parents:
- bb3f67c
- File:
-
- 1 edited
-
src/views/pages/authorize-interaction.ejs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/views/pages/authorize-interaction.ejs
rbb3f67c r667fb41 93 93 <a class="btn" href="/"><%= t('fedi.remote_back') %></a> 94 94 </p> 95 <% } else if (typeof voted !== 'undefined' && voted) { %> 96 <h1 class="auth-interact-title">📊 <%= t('poll.voted_title') %></h1> 97 <p class="auth-interact-note"><%= t('poll.voted_done') %></p> 98 <p class="auth-interact-actions"> 99 <% if (uri) { %><a class="btn btn-primary" href="<%= uri %>" rel="nofollow noopener"><%= t('fedi.remote_view_original') %></a><% } %> 100 <a class="btn" href="/"><%= t('fedi.remote_back') %></a> 101 </p> 95 102 <% } else if (typeof followTarget !== 'undefined' && followTarget) { %> 96 103 <h1 class="auth-interact-title"><%= t('fedi.follow_heading') %></h1> … … 135 142 <span><%= t('fedi.remote_view_original') %></span> 136 143 </a> 144 <% } %> 145 <% if (target.poll) { var _pl = target.poll; var _tot = _pl.options.reduce(function(s,o){return s+(o.count||0);},0); %> 146 <% if (!_pl.closed) { %> 147 <form method="post" action="/authorize_interaction/vote" class="auth-poll"> 148 <input type="hidden" name="uri" value="<%= uri %>"> 149 <% _pl.options.forEach(function(o){ %> 150 <label class="auth-poll-choice"><input type="<%= _pl.multiple ? 'checkbox' : 'radio' %>" name="choice" value="<%= o.name %>"><span><%= o.name %></span></label> 151 <% }); %> 152 <div class="auth-interact-actions"> 153 <button type="submit" class="btn btn-primary"><%= t('poll.vote') %></button> 154 </div> 155 <p class="auth-poll-foot"><% if (_pl.multiple) { %><%= t('poll.multiple') %> · <% } %><%= (_pl.voters!=null?_pl.voters:_tot) %> <%= t('poll.votes') %></p> 156 </form> 157 <% } else { %> 158 <div class="auth-poll"> 159 <% _pl.options.forEach(function(o){ var _pct = _tot ? Math.round((o.count||0)*100/_tot) : 0; %> 160 <div class="auth-poll-res"><span class="auth-poll-fill" style="width:<%= _pct %>%"></span><span class="auth-poll-name"><%= o.name %></span><span class="auth-poll-pct"><%= _pct %>%</span></div> 161 <% }); %> 162 <p class="auth-poll-foot"><%= (_pl.voters!=null?_pl.voters:_tot) %> <%= t('poll.votes') %> · <%= t('poll.closed') %></p> 163 </div> 164 <% } %> 137 165 <% } %> 138 166 <% var _liked = (typeof reacted !== 'undefined' && reacted.liked); var _boosted = (typeof reacted !== 'undefined' && reacted.boosted); %> … … 251 279 .fedi-edit-save { padding: .4rem 1rem; border: 0; border-radius: 999px; background: var(--accent); color: var(--paper, #fff); 252 280 font: inherit; font-weight: 600; font-size: .82rem; cursor: pointer; } 281 /* Poll ballot / results on the interact page */ 282 .auth-poll { display: flex; flex-direction: column; gap: 8px; margin: 0 0 1rem; } 283 .auth-poll-choice { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; cursor: pointer; 284 border: 1px solid color-mix(in srgb, var(--ink, #000) 14%, transparent); } 285 .auth-poll-choice:hover { border-color: var(--accent); } 286 .auth-poll-choice input { accent-color: var(--accent); } 287 .auth-poll-res { position: relative; padding: 9px 12px; border-radius: 10px; overflow: hidden; display: flex; align-items: center; gap: 8px; 288 background: color-mix(in srgb, var(--ink, #000) 6%, transparent); } 289 .auth-poll-fill { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--accent) 22%, transparent); z-index: 0; } 290 .auth-poll-name { position: relative; z-index: 1; flex: 1; font-size: .95rem; } 291 .auth-poll-pct { position: relative; z-index: 1; font-variant-numeric: tabular-nums; font-weight: 500; } 292 .auth-poll-foot { font-size: .82rem; color: var(--ink-soft, #888); margin: .1rem 0 0; } 253 293 </style> 254 294
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)