brutaldon-interfaccia-web-m.../brutaldon/templates/main/toot_partial.html

236 lines
10 KiB
HTML
Raw Normal View History

{% load humanetime %}
2018-04-24 15:12:13 +02:00
{% load humanize %}
{% load sanitizer %}
{% load taglinks %}
{% load static %}
2018-04-24 15:12:13 +02:00
2018-05-23 16:05:13 +02:00
{% if active %}
2019-07-10 01:37:18 +02:00
<article id="toot-{{toot.id}}" class="media box active-context">
{% else %}
<article id="toot-{{toot.id}}" class="media box">
{% endif %}
2018-05-23 16:05:13 +02:00
2019-07-10 01:37:18 +02:00
<figure class="media-left">
<p class="image is-64x64 account-avatar">
<a href="{% url "user" toot.account.acct %}">
<img loading="auto" src="{{ toot.account.avatar_static }}"
2019-07-10 01:37:18 +02:00
alt="">
</a>
</p>
{% if reblog %}
<p class="image is-32x32 reblog-icon" >
<a href="{% url "user" reblog_by %}">
<img loading="auto" src ="{{ reblog_icon }}" alt="">
2019-07-10 01:37:18 +02:00
</a>
</p>
{% endif %}
</figure>
<div class="media-content">
<div class="content">
<p>
2019-10-29 18:43:51 +01:00
<strong>{{ toot.account.display_name | fix_emojos:toot.account.emojis | strip_html |safe}}</strong>
2019-07-10 01:37:18 +02:00
<small><a href="{% url "user" toot.account.acct %}">
@{{ toot.account.acct }}</a></small>
<a href="{{ toot.url }}">
<small>{{ toot.created_at |humane_time }}</small>
</a>
2018-08-29 11:23:35 +02:00
{% if reblog %}
2019-07-10 01:37:18 +02:00
<br>
Boosted by @{{ reblog_by }}
{% endif %}
2019-07-10 01:37:18 +02:00
</p>
{% if toot.spoiler_text %}
<details class="toot">
<summary><strong>{{ toot.spoiler_text }} </strong></summary>
<div class="toot">
{{ toot.content | relink_toot | fix_emojos:toot.emojis | strip_html | safe }}
</div>
2019-07-10 01:37:18 +02:00
</details>
{% else %}
<div class="toot">
{{ toot.content | relink_toot | fix_emojos:toot.emojis | strip_html | safe }}
</div>
{% 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 -->
{% include "polls/new_partial.html" with toot=toot %}
2018-08-29 11:23:35 +02:00
{% endif %}
2019-07-10 01:37:18 +02:00
</div>
{% endif %}
2018-04-24 15:12:13 +02:00
2019-07-10 01:37:18 +02:00
{% if toot.card %}
<div class="card">
<div class="card-content columns">
{% if toot.card.image %}
<div class="column is-one-third">
<a href="{{ toot.card.url }}">
<noscript class="loading-lazy">
<img loading="lazy" alt="{{ toot.card.title }}"
src="{{ toot.card.image }}"
class="is-max-128">
</noscript>
</a>
</div>
2019-07-10 01:37:18 +02:00
{% endif %}
<div class="column is-two-thirds">
<p>
<strong>
<a href="{{ toot.card.url }}">
{{ toot.card.title }}
</a>
</strong>
<p>{{ toot.card.description |truncatechars_html:500}}</p>
</div>
</div>
2019-07-10 01:37:18 +02:00
</div>
{% endif %}
2019-07-10 01:37:18 +02:00
{% if toot.media_attachments %}
<br>
<div class="columns is-multiline attachments is-gapless">
{% for media in toot.media_attachments %}
2019-02-04 21:24:06 +01:00
{% if media.type == "image" %}
2019-07-10 01:37:18 +02:00
<figure class="column attachment-image">
2019-02-04 21:24:06 +01:00
<a href="{{ media.url }}">
<noscript class="loading-lazy">
{% if toot.sensitive %}
<img loading="lazy" src="{% static "images/sensitive.png" %}"
2019-07-10 01:37:18 +02:00
{% else %}
<img loading="lazy" src="{{ media.preview_url }}"
2019-07-10 01:37:18 +02:00
{% endif %}
alt="{% if media.description %}
{{ media.description }}
{% elif media.text_url %}
{{ media.text_url }}
{% else %}
{{ media.url }}
{% endif %}"
{% if media.description %}
title="{{ media.description }}"
{% endif %}
class="image is-max-256">
</noscript>
</a>
2019-07-10 01:37:18 +02:00
</figure>
{% else %}
<figure class="column">
<video controls loop class="is-max-256"
poster="{{ media.preview_url }}">
<source src="{{ media.url }}" type="video/mp4">
<a href="{{ media.url }}">
<noscript class="loading-lazy">
2019-07-10 01:37:18 +02:00
{% if toot.sensitive %}
<img loading="lazy" src="{% static "images/sensitive.png" %}"
2019-07-10 01:37:18 +02:00
{% else %}
<img loading="lazy" src="{{ media.preview_url }}"
2019-07-10 01:37:18 +02:00
{% endif %}
alt="{% if media.description %}
{{ media.description }}
{% elif media.text_url %}
{{ media.text_url }}
{% else %}
{{ media.url }}
{% endif %}"
{% if media.description %}
title="{{ media.description }}"
{% endif %}
class="image is-max-256">
</noscript>
2019-07-10 01:37:18 +02:00
</a>
</video>
</figure>
2019-02-04 21:24:06 +01:00
{% endif %}
2019-07-10 01:37:18 +02:00
{% endfor %}
</div>
2019-07-10 01:37:18 +02:00
{% endif %}
<br>
<p class="is-hidden"></p>
</div>
{% if not confirm_page %}
<nav class="level is-mobile">
<div class="level-left">
<a href="{% url "reply" toot.id %}#toot-{{ toot.id }}" class="level-item">
{% if toot.replies_count > 0 %}
<span class="fa fa-reply-all">
<span class="is-hidden-mobile"><strong>Reply</strong></span>
</span>
2019-07-10 01:37:18 +02:00
{% else %}
<span class="fa fa-reply">
<span class="is-hidden-mobile">Reply</span>
</span>
2019-07-10 01:37:18 +02:00
{% endif %}
</a>
{% if toot.visibility != 'private' and toot.visibility != 'direct' %}
<a href="{% url "boost" toot.id %}" class="level-item"
ic-post-to="{% url "boost" toot.id %}"
ic-indicator="#toot-spinner-{{toot.id}}">
{% if toot.reblogged %}
2019-07-10 01:37:18 +02:00
<span class="fa fa-retweet has-text-warning">
<strong class="is-hidden-mobile" >Boosted</strong>
{% else %}
<span class="fa fa-retweet" >
<span class="is-hidden-mobile" >Boost</span>
{% endif %}
</span>
</span>
</a>
2019-07-10 01:37:18 +02:00
{% endif %}
<a href="{% url "fav" toot.id %}" class="level-item"
ic-post-to="{% url "fav" toot.id %}"
ic-indicator="#toot-spinner-{{toot.id}}">
{% if toot.favourited %}
<span class="fa fa-heart has-text-warning">
<strong class="is-hidden-mobile" >Favorited</strong>
2019-07-10 01:37:18 +02:00
{% else %}
<span class="fa fa-heart">
<span class="is-hidden-mobile" >Favorite</span>
2019-07-10 01:37:18 +02:00
{% endif %}
2018-08-29 11:23:35 +02:00
</span>
</span>
2019-07-10 01:37:18 +02:00
</a>
<i id="toot-spinner-{{toot.id}}" class="fa fa-spinner fa-spin" style="display:none"></i>
</div>
<div class="level-right">
{% if toot.account.acct == own_acct.acct %}
<a class="level-item" href="{% url "redraft" toot.id %}">
redraft
</a>
<a class="level-item" href="{% url "delete" toot.id %}"
ic-delete-from="{% url "delete" toot.id %}"
ic-indicator="#toot-spinner-{{toot.id}}"
ic-confirm="Really delete that toot?"
ic-success-action="fadeOut;remove"
ic-action-target="#toot-{{ toot.id }}">
delete
</a>
2019-07-10 01:37:18 +02:00
{% endif %}
{{ toot.visibility }}
&nbsp;&nbsp;
{% if toot.in_reply_to_id or toot.replies_count > 0 %}
<a class="level-item" href="{% url "thread" toot.id %}#toot-{{ toot.id }}">
2019-05-20 19:40:21 +02:00
<span class="fa fa-comments"></span>
<strong> thread</strong>
</a>
2019-07-10 01:37:18 +02:00
{% else %}
<a class="level-item" href="{% url "thread" toot.id %}#toot-{{ toot.id }}">
thread
</a>
2019-07-10 01:37:18 +02:00
{% endif %}
</div>
</nav>
{% endif %}
2019-07-10 01:37:18 +02:00
</div>
<div class="media-right"></div>
</article>