mirror of
http://git.carcosa.net/jmcbray/brutaldon.git
synced 2024-11-23 15:23:52 -05:00
Support for viewing completed polls
This commit is contained in:
parent
76b50cedd2
commit
83f46babe5
@ -240,6 +240,12 @@ a.navbar-item span:nth-child(2):before
|
|||||||
content: " ";
|
content: " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.poll {
|
||||||
|
margin-bottom: 1ex;
|
||||||
|
margin-top: 1em;
|
||||||
|
max-width: 90%;
|
||||||
|
}
|
||||||
|
|
||||||
/* Fix some rules that don't need to be there */
|
/* Fix some rules that don't need to be there */
|
||||||
.content figure:not(:last-child)
|
.content figure:not(:last-child)
|
||||||
{
|
{
|
||||||
|
@ -2,7 +2,6 @@ body > section > div.container {
|
|||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.reblog-icon {
|
.reblog-icon {
|
||||||
position: relative;
|
position: relative;
|
||||||
top: -24px;
|
top: -24px;
|
||||||
@ -219,6 +218,14 @@ a.navbar-item span:nth-child(2):before
|
|||||||
content: " ";
|
content: " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
div.poll {
|
||||||
|
margin-bottom: 1ex;
|
||||||
|
margin-top: 1em;
|
||||||
|
max-width: 90%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Fix some rules that don't need to be there */
|
/* Fix some rules that don't need to be there */
|
||||||
.content figure:not(:last-child)
|
.content figure:not(:last-child)
|
||||||
{
|
{
|
||||||
|
@ -30,7 +30,8 @@
|
|||||||
<div class="content">
|
<div class="content">
|
||||||
<p>
|
<p>
|
||||||
<strong>{{ toot.account.display_name }}</strong>
|
<strong>{{ toot.account.display_name }}</strong>
|
||||||
<small><a href="{% url "user" toot.account.acct %}">@{{ toot.account.acct }}</a></small>
|
<small><a href="{% url "user" toot.account.acct %}">
|
||||||
|
@{{ toot.account.acct }}</a></small>
|
||||||
<a href="{{ toot.url }}">
|
<a href="{{ toot.url }}">
|
||||||
<small>{{ toot.created_at |humane_time }}</small>
|
<small>{{ toot.created_at |humane_time }}</small>
|
||||||
</a>
|
</a>
|
||||||
@ -52,6 +53,17 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if toot.poll %}
|
||||||
|
<div class="poll">
|
||||||
|
{% if toot.poll.voted or toot.poll.expired %}
|
||||||
|
{% include "polls/completed_partial.html" with toot=toot %}
|
||||||
|
{% else %}
|
||||||
|
<!-- Poll form -->
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
{% if toot.card %}
|
{% if toot.card %}
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-content columns">
|
<div class="card-content columns">
|
||||||
|
19
brutaldon/templates/polls/completed_partial.html
Normal file
19
brutaldon/templates/polls/completed_partial.html
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{% load sanitizer %}
|
||||||
|
{% load taglinks %}
|
||||||
|
{% load static %}
|
||||||
|
<div class="columns is-multiline">
|
||||||
|
{% for option in toot.poll.options %}
|
||||||
|
<div class="column is-one-quarter">
|
||||||
|
<strong>{{ option.title }}</strong>
|
||||||
|
({{ option.votes_count}} vote{{ option.votes_count|pluralize }})
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="column is-three-quarters">
|
||||||
|
<progress class="progress is-primary"
|
||||||
|
value="{{ option.votes_count }}"
|
||||||
|
max="{{ toot.poll.votes_count }}"
|
||||||
|
{{ option.votes_count }}
|
||||||
|
</progress>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
Loading…
Reference in New Issue
Block a user