Fix caching and tweak design

This commit is contained in:
Thomas Sileo
2019-07-05 22:05:28 +02:00
parent 8aba17f742
commit 98a2f8dbf8
9 changed files with 82 additions and 51 deletions

View File

@@ -10,7 +10,7 @@
<div id="following">
{% for (follow_id, follow) in following_data %}
{% if session.logged_in %}
<div style="margin-left:90px;padding-bottom:5px;margin-bottom:15px;">
<div style="margin-left:90px;padding-bottom:5px;margin-bottom:15px;display:inline-block;">
<form action="/api/undo" class="action-form" method="POST">
<input type="hidden" name="redirect" value="{{ request.path }}"/>
<input type="hidden" name="id" value="{{ follow_id }}"/>

View File

@@ -37,17 +37,17 @@
{% if "actor" in item.meta %}
{% set boost_actor = item.meta.actor %}
{% if session.logged_in %}
<div style="margin-left:65px;padding-bottom:5px;margin-bottom:15px;">
<span class="bar-item-no-hover"><a style="color:#808080;" href="{{ boost_actor.url | get_url }}">{{ boost_actor.name }}</a> boosted</span>
<div style="margin-left:65px;padding-bottom:5px;margin-bottom:15px;display:inline-block">
<form action="/api/undo" class="action-form" method="POST">
<input type="hidden" name="redirect" value="/"/>
<input type="hidden" name="id" value="{{ item.remote_id }}"/>
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
<button type="submit" class="bar-item">unboost</button>
</form>
<span class="bar-item-no-hover"><a style="color:#808080;" href="{{ boost_actor.url | get_url }}">{{ boost_actor.name }}</a> boosted</span>
</div>
{% else %}
<p style="margin-left:65px;padding-bottom:5px;">
<p style="margin-left:65px;padding-bottom:5px;display:inline-block;">
<span class="bar-item-no-hover"><a style="color:#808080;" href="{{ boost_actor.url | get_url }}">{{ boost_actor.name }}</a> boosted</span>
</p>
{% endif %}

View File

@@ -9,7 +9,7 @@
<div id="notes">
{% for item in liked %}
{% if session.logged_in %}
<div style="margin-left:65px;padding-bottom:5px;margin-bottom:15px;">
<div style="margin-left:65px;padding-bottom:5px;margin-bottom:15px;display:inline-block;">
<form action="/api/undo" class="action-form" method="POST">
<input type="hidden" name="redirect" value="/liked"/>
<input type="hidden" name="id" value="{{ item.remote_id }}"/>

View File

@@ -16,7 +16,7 @@
{% set data = data.to_dict() %}
<div id="lookup-result" style="margin-top:30px;">
{% if data | has_actor_type %}
<div style="margin-left:95px;padding-bottom:5px;margin-bottom:15px;">
<div style="margin-left:95px;padding-bottom:5px;margin-bottom:15px;display:inline-block;">
<form action="/api/follow" class="action-form" method="POST">
<input type="hidden" name="redirect" value="{{ request.path }}"/>
<input type="hidden" name="actor" value="{{ data.id }}"/>

View File

@@ -15,7 +15,7 @@
{% if item | has_type('Announce') %}
{% set boost_actor = item.meta.actor %}
{% if boost_actor %}
<p style="margin-left:70px;padding-bottom:5px;"><span class="bar-item-no-hover"><a style="color:#808080;" href="{{ boost_actor.url | get_url }}">{{ boost_actor.name or boost_actor.preferredUsername }}</a> boosted</span></p>
<p style="margin-left:70px;padding-bottom:5px;display:inline-block;"><span class="bar-item-no-hover"><a style="color:#808080;" href="{{ boost_actor.url | get_url }}">{{ boost_actor.name or boost_actor.preferredUsername }}</a> boosted</span></p>
{% endif %}
{% if item.meta.object %}
{{ utils.display_note(item.meta.object, ui=True) }}
@@ -24,26 +24,26 @@
{% if item | has_type('Like') %}
{% set boost_actor = item.meta.actor %}
<p style="margin-left:70px;padding-bottom:5px;"><span class="bar-item-no-hover"><a style="color:#808080;" href="{{ boost_actor.url | get_url }}">{{ boost_actor.name or boost_actor.preferredUsername }}</a> liked</span></p>
<p style="margin-left:70px;padding-bottom:5px;display:inline-block;"><span class="bar-item-no-hover"><a style="color:#808080;" href="{{ boost_actor.url | get_url }}">{{ boost_actor.name or boost_actor.preferredUsername }}</a> liked</span></p>
{% if item.meta.object %}
{{ utils.display_note(item.meta.object, ui=False, meta={'actor': item.meta.object_actor}) }}
{% endif %}
{% endif %}
{% if item | has_type('Follow') %}
<p style="margin-left:70px;padding-bottom:5px;"><span class="bar-item-no-hover">new follower</span> <!-- <a href="" class="bar-item">follow back</a></p> -->
<p style="margin-left:70px;padding-bottom:5px;display:inline-block;"><span class="bar-item-no-hover">new follower</span> <!-- <a href="" class="bar-item">follow back</a></p> -->
<div style="height: 100px;">
{{ utils.display_actor_inline(item.meta.actor, size=50) }}
</div>
{% elif item | has_type('Accept') %}
<p style="margin-left:70px;padding-bottom:5px;"><span class="bar-item-no-hover">you started following</span></p>
<p style="margin-left:70px;padding-bottom:5px;display:inline-block;"><span class="bar-item-no-hover">you started following</span></p>
<div style="height: 100px;">
{{ utils.display_actor_inline(item.meta.actor, size=50) }}
</div>
{% elif item | has_type('Undo') %}
<p style="margin-left:70px;padding-bottom:5px;"><span class="bar-item-no-hover">unfollowed you</span></p>
<p style="margin-left:70px;padding-bottom:5px;display:inline-block;"><span class="bar-item-no-hover">unfollowed you</span></p>
<div style="height: 100px;">
{{ utils.display_actor_inline(item.meta.actor, size=50) }}
</div>
@@ -57,7 +57,7 @@
{% else %}
{% if item | has_type('question_ended') %}
<p style="margin-left:70px;padding-bottom:5px;"><span class="bar-item-no-hover">poll ended</span></p>
<p style="margin-left:70px;padding-bottom:5px;display:inline-block;"><span class="bar-item-no-hover">poll ended</span></p>
{{ utils.display_note(item.activity.object) }}
{% endif %}