Show like/boost counters even when not logged in

This commit is contained in:
Bat 2018-09-04 13:46:08 +01:00
parent c0174a310c
commit dbdc9f317e
9 changed files with 73 additions and 20 deletions

View File

@ -512,5 +512,11 @@ msgstr ""
msgid "Subtitle" msgid "Subtitle"
msgstr "Titel" msgstr "Titel"
msgid "Login to like"
msgstr ""
msgid "Login to boost"
msgstr ""
#~ msgid "Your password should be at least 8 characters long" #~ msgid "Your password should be at least 8 characters long"
#~ msgstr "Das Passwort sollte mindestens 8 Zeichen lang sein" #~ msgstr "Das Passwort sollte mindestens 8 Zeichen lang sein"

View File

@ -500,3 +500,9 @@ msgstr ""
msgid "Subtitle" msgid "Subtitle"
msgstr "" msgstr ""
msgid "Login to like"
msgstr ""
msgid "Login to boost"
msgstr ""

View File

@ -510,3 +510,9 @@ msgstr ""
#, fuzzy #, fuzzy
msgid "Subtitle" msgid "Subtitle"
msgstr "Titre" msgstr "Titre"
msgid "Login to like"
msgstr ""
msgid "Login to boost"
msgstr ""

View File

@ -502,3 +502,9 @@ msgstr ""
#, fuzzy #, fuzzy
msgid "Subtitle" msgid "Subtitle"
msgstr "Título" msgstr "Título"
msgid "Login to like"
msgstr ""
msgid "Login to boost"
msgstr ""

View File

@ -516,6 +516,12 @@ msgstr ""
msgid "Subtitle" msgid "Subtitle"
msgstr "Tittel" msgstr "Tittel"
msgid "Login to like"
msgstr ""
msgid "Login to boost"
msgstr ""
#~ msgid "One reshare" #~ msgid "One reshare"
#~ msgid_plural "{{ count }} reshares" #~ msgid_plural "{{ count }} reshares"
#~ msgstr[0] "Én deling" #~ msgstr[0] "Én deling"

View File

@ -527,6 +527,12 @@ msgstr ""
msgid "Subtitle" msgid "Subtitle"
msgstr "Tytuł" msgstr "Tytuł"
msgid "Login to like"
msgstr ""
msgid "Login to boost"
msgstr ""
#~ msgid "One reshare" #~ msgid "One reshare"
#~ msgid_plural "{{ count }} reshares" #~ msgid_plural "{{ count }} reshares"
#~ msgstr[0] "Jedno udostępnienie" #~ msgstr[0] "Jedno udostępnienie"

View File

@ -489,3 +489,9 @@ msgstr ""
msgid "Subtitle" msgid "Subtitle"
msgstr "" msgstr ""
msgid "Login to like"
msgstr ""
msgid "Login to boost"
msgstr ""

View File

@ -207,8 +207,8 @@ main .article-meta .reshares > p {
font-size: 1.5em; font-size: 1.5em;
} }
main .article-meta .likes button, main .article-meta .likes .action,
main .article-meta .reshares button { main .article-meta .reshares .action {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
@ -221,12 +221,12 @@ main .article-meta .reshares button {
} }
main .article-meta .likes > p, main .article-meta .likes > p,
main .article-meta .likes button:hover { color: #E92F2F; } main .article-meta .likes .action:hover { color: #E92F2F; }
main .article-meta .reshares > p, main .article-meta .reshares > p,
main .article-meta .reshares button:hover { color: #7765E3; } main .article-meta .reshares .action:hover { color: #7765E3; }
main .article-meta .likes button i, main .article-meta .likes .action i,
main .article-meta .reshares button i { main .article-meta .reshares .action i {
transition: background 0.1s ease-in; transition: background 0.1s ease-in;
display: flex; display: flex;
align-items: center; align-items: center;
@ -239,37 +239,37 @@ main .article-meta .reshares button i {
border-radius: 50%; border-radius: 50%;
} }
main .article-meta .likes button i { main .article-meta .likes .action i {
color: #E92F2F; color: #E92F2F;
border: solid #E92F2F thin; border: solid #E92F2F thin;
font-weight: 400; font-weight: 400;
} }
main .article-meta .likes button:hover i { main .article-meta .likes .action:hover i {
background: rgba(233, 47, 47, 0.15); background: rgba(233, 47, 47, 0.15);
} }
main .article-meta .reshares button i { main .article-meta .reshares .action i {
color: #7765E3; color: #7765E3;
border: solid #7765E3 thin; border: solid #7765E3 thin;
font-weight: 600; font-weight: 600;
} }
main .article-meta .reshares button:hover i { main .article-meta .reshares .action:hover i {
background: rgba(119, 101, 227, 0.15); background: rgba(119, 101, 227, 0.15);
} }
main .article-meta .likes button.liked i { background: #E92F2F; } main .article-meta .likes .action.liked i { background: #E92F2F; }
main .article-meta .likes button.liked:hover i { main .article-meta .likes .action.liked:hover i {
background: rgba(233, 47, 47, 0.25); background: rgba(233, 47, 47, 0.25);
color: #E92F2F; color: #E92F2F;
} }
main .article-meta .reshares button.reshared i { background: #7765E3; } main .article-meta .reshares .action.reshared i { background: #7765E3; }
main .article-meta .reshares button.reshared:hover i { main .article-meta .reshares .action.reshared:hover i {
background: rgba(119, 101, 227, 0.25); background: rgba(119, 101, 227, 0.25);
color: #7765E3; color: #7765E3;
} }
main .article-meta .likes button.liked i, main .article-meta .likes .action.liked i,
main .article-meta .reshares button.reshared i { main .article-meta .reshares .action.reshared i {
color: #F4F4F4; color: #F4F4F4;
font-weight: 900; font-weight: 900;
} }

View File

@ -41,23 +41,34 @@
<p aria-label="{{ "{{ count }} likes" | _n(singular="One like", count=n_likes) }}" title="{{ "{{ count }} likes" | _n(singular="One like", count=n_likes) }}">{{ n_likes }}</p> <p aria-label="{{ "{{ count }} likes" | _n(singular="One like", count=n_likes) }}" title="{{ "{{ count }} likes" | _n(singular="One like", count=n_likes) }}">{{ n_likes }}</p>
{% if has_liked %} {% if has_liked %}
<button type="submit" class="liked"><i class="far fa-heart"></i>{{ "I don't like this anymore" | _ }}</button> <button type="submit" class="action liked"><i class="far fa-heart"></i>{{ "I don't like this anymore" | _ }}</button>
{% else %} {% else %}
<button type="submit"><i class="fa fa-heart"></i>{{ "Add yours" | _ }}</button> <button type="submit" class="action"><i class="fa fa-heart"></i>{{ "Add yours" | _ }}</button>
{% endif %} {% endif %}
</form> </form>
<form class="reshares" action="{{ article.url }}reshare" method="POST"> <form class="reshares" action="{{ article.url }}reshare" method="POST">
<p aria-label="{{ "{{ count }} Boosts" | _n(singular="One Boost", count=n_reshares) }}" title="{{ "{{ count }} Boosts" | _n(singular="One Boost", count=n_reshares) }}">{{ n_reshares }}</p> <p aria-label="{{ "{{ count }} Boosts" | _n(singular="One Boost", count=n_reshares) }}" title="{{ "{{ count }} Boosts" | _n(singular="One Boost", count=n_reshares) }}">{{ n_reshares }}</p>
{% if has_reshared %} {% if has_reshared %}
<button type="submit" class="reshared"><i class="far fa-retweet"></i>{{ "I don't want to boost this anymore" | _ }}</button> <button type="submit" class="action reshared"><i class="fa fa-retweet"></i>{{ "I don't want to boost this anymore" | _ }}</button>
{% else %} {% else %}
<button type="submit"><i class="fa fa-retweet"></i>{{ "Boost" | _ }}</button> <button type="submit" class="action"><i class="fa fa-retweet"></i>{{ "Boost" | _ }}</button>
{% endif %} {% endif %}
</form> </form>
</div> </div>
{% else %} {% else %}
<p class="center">{{ "Login or use your Fediverse account to interact with this article" | _ }}</p> <p class="center">{{ "Login or use your Fediverse account to interact with this article" | _ }}</p>
<div class="actions">
<div class="likes">
<p aria-label="{{ "{{ count }} likes" | _n(singular="One like", count=n_likes) }}" title="{{ "{{ count }} likes" | _n(singular="One like", count=n_likes) }}">{{ n_likes }}</p>
<a href="/login?m=Login%20to%20like" type="submit" class="action"><i class="fa fa-heart"></i>{{ "Add yours" | _ }}</a>
</div>
<div class="reshares">
<p aria-label="{{ "{{ count }} Boosts" | _n(singular="One Boost", count=n_reshares) }}" title="{{ "{{ count }} Boosts" | _n(singular="One Boost", count=n_reshares) }}">{{ n_reshares }}</p>
<a href="/login?m=Login%20to%20boost" type="submit" class="action"><i class="fa fa-retweet"></i>{{ "Boost" | _ }}</a>
</div>
</div>
{% endif %} {% endif %}
<div class="comments"> <div class="comments">