Display boosts correctly

This commit is contained in:
Jason McBrayer 2018-04-24 09:12:13 -04:00
parent b3e0eefba4
commit 651367c0d7
5 changed files with 96 additions and 74 deletions

View File

@ -0,0 +1,5 @@
.reblog-icon {
position: relative;
top: -24px;
left: 40px;
}

View File

@ -8,6 +8,7 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/fork-awesome@1.0.11/css/fork-awesome.min.css" <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/fork-awesome@1.0.11/css/fork-awesome.min.css"
integrity="sha256-MGU/JUq/40CFrfxjXb5pZjpoZmxiP2KuICN5ElLFNd8=" integrity="sha256-MGU/JUq/40CFrfxjXb5pZjpoZmxiP2KuICN5ElLFNd8="
crossorigin="anonymous"> crossorigin="anonymous">
<link rel="stylesheet" href="/static/css/brutaldon.css">
</head> </head>
<body> <body>
<section class="section"> <section class="section">
@ -17,7 +18,7 @@
Title Title
</h1> </h1>
<p class="subtitle"> <p class="subtitle">
My first website with <strong>Bulma</strong>! Brutaldon is totally a thing.
</p> </p>
{% endblock %} {% endblock %}
</div> </div>

View File

@ -8,78 +8,11 @@
{% block content %} {% block content %}
<h1 class="title">Your {{ timeline }} timeline</h1> <h1 class="title">Your {{ timeline }} timeline</h1>
{% for toot in toots %} {% for toot in toots %}
<div class="box"> {% if toot.reblog %}
<article class="media"> {% include "main/toot_partial.html" with toot=toot.reblog reblog=True reblog_by=toot.account.username reblog_icon=toot.account.avatar %}
<figure class="media-left"> {% else %}
<p class="image is-64x64"> {% include "main/toot_partial.html" with toot=toot reblog=False %}
<img src="{{ toot.account.avatar }}" {% endif %}
alt="">
</p>
</figure>
<div class="media-content">
<div class="content">
<p>
<strong>{{ toot.account.display_name }}</strong>
<small>@{{ toot.account.username }}</small>
<small>{{ toot.created_at |naturaltime }}</small>
</p>
{% if toot.spoiler_text %}
<p>
<strong>{{ toot.spoiler_text }} </strong>
</p>
{% endif %}
<div>
{{ toot.content | safe }}
</div>
{% if toot.media_attachments %}
<div class="level">
<div class="level-left">
{% for media in toot.media_attachments %}
<a class="level-item" href="{{ media.url }}">
<img src="{{ media.preview_url }}" alt="
{% if media.text_url %}
{{ media.text_url }}
{% else %}
{{ media.url }}
{% endif %}"
class="image is-128x128">
</a>
{% endfor %}
</div>
</div>
{% endif %}
<p><br></p>
</div>
<nav class="level is-mobile">
<div class="level-left">
<a class="level-item">
<span class="icon is-small"><i class="fa fa-reply">
<span class="is-invisible">Reply</span>
</i></span>
</a>
<a class="level-item">
<span class="icon is-small"><i class="fa fa-retweet">
<span class="is-invisible" >Boost</span>
</i></span>
</a>
<a class="level-item">
<span class="icon is-small"><i class="fa fa-heart">
<span class="is-invisible" >Favorite</span>
</i></span>
</a>
</div>
<div class="level-right">
<a class="level-item">
{{ toot.visibility }}
</a>
</div>
</nav>
</div>
<div class="media-right">
</div>
</article>
</div>
<hr class="is-hidden"> <hr class="is-hidden">
{% endfor %} {% endfor %}
{% endblock %} {% endblock %}

View File

@ -0,0 +1,83 @@
{% load humanize %}
<div class="box">
<article class="media">
<figure class="media-left">
<p class="image is-64x64">
<img src="{{ toot.account.avatar }}"
alt="">
</p>
{% if reblog %}
<p class="image is-32x32 reblog-icon" >
<img src ="{{ reblog_icon }}" alt="">
</p>
{% endif %}
</figure>
<div class="media-content">
<div class="content">
<p>
<strong>{{ toot.account.display_name }}</strong>
<small>@{{ toot.account.username }}</small>
<small>{{ toot.created_at |naturaltime }}</small>
{% if reblog %}
<br>
Boosted by @{{ reblog_by }}
{% endif %}
</p>
{% if toot.spoiler_text %}
<p>
<strong>{{ toot.spoiler_text }} </strong>
</p>
{% endif %}
<div>
{{ toot.content | safe }}
</div>
{% if toot.media_attachments %}
<div class="level">
<div class="level-left">
{% for media in toot.media_attachments %}
<a class="level-item" href="{{ media.url }}">
<img src="{{ media.preview_url }}" alt="
{% if media.text_url %}
{{ media.text_url }}
{% else %}
{{ media.url }}
{% endif %}"
class="image is-128x128">
</a>
{% endfor %}
</div>
</div>
{% endif %}
<p><br></p>
</div>
<nav class="level is-mobile">
<div class="level-left">
<a class="level-item">
<span class="icon is-small"><i class="fa fa-reply">
<span class="is-invisible">Reply</span>
</i></span>
</a>
<a class="level-item">
<span class="icon is-small"><i class="fa fa-retweet">
<span class="is-invisible" >Boost</span>
</i></span>
</a>
<a class="level-item">
<span class="icon is-small"><i class="fa fa-heart">
<span class="is-invisible" >Favorite</span>
</i></span>
</a>
</div>
<div class="level-right">
<a class="level-item">
{{ toot.visibility }}
</a>
</div>
</nav>
</div>
<div class="media-right">
</div>
</article>
</div>

View File

@ -1,7 +1,7 @@
certifi==2017.11.5 certifi==2017.11.5
chardet==3.0.4 chardet==3.0.4
decorator==4.1.2 decorator==4.1.2
Django==2.0.1 Django==2.0.4
django-widget-tweaks==1.4.2 django-widget-tweaks==1.4.2
idna==2.6 idna==2.6
Mastodon.py==1.2.1 Mastodon.py==1.2.1