remove default styles, make new.html bulma styled, first rough version of stream

This commit is contained in:
Inhji 2019-12-07 20:48:44 +01:00
parent 07e39866df
commit 1cab097cd1
5 changed files with 519 additions and 414 deletions

View file

@ -1,9 +1,21 @@
.note-container p:first-child { main#wrapper {
margin: 1rem 1rem 0 1rem;
max-width: 50rem;
}
#header {
margin-bottom: 3rem;
}
/*.note-container p:first-child {
margin-top: 0; margin-top: 0;
} }
html, body {
height: 100%; // html, body {
} // height: 100%;
// }
@media only screen and (max-width: 480px) { @media only screen and (max-width: 480px) {
#menu-item-following { #menu-item-following {
@ -413,3 +425,5 @@ li.answer {
width:70px; width:70px;
display:inline-block; display:inline-block;
} }
*/

View file

@ -24,17 +24,16 @@
</div> </div>
<div class="menu"> <div class="tabs">
<ul> <ul>
<li><a href="/" {% if request.path == "/" %}class="selected"{% endif %}>Notes <small class="badge">{{ notes_count }}</small></a></li> <li {% if request.path == "/" %}class="is-active"{% endif %}><a href="/">Notes [{{ notes_count }}]</a></li>
{% if session.logged_in %}<li><a href="/all" {% if request.path == url_for("all") %}class="selected"{% endif %}>All <small class="badge">{{ with_replies_count }}</small></a></li> <li {% if request.path == url_for("all") %}class="is-active"{% endif %}><a href="/all">All [{{ with_replies_count }}]</a></li>
<li><a href="/liked" {% if request.path == "/liked" %}class="selected"{% endif %}>Liked <small class="badge">{{ liked_count }}</small></a></li> <li {% if request.path == "/liked" %}class="is-active"{% endif %}><a href="/liked">Liked [{{ liked_count }}]</a></li>
{% endif %} <li {% if request.path == "/followers" %} class="is-active" {% endif %}><a href="/followers">Followers [{{ followers_count }}]</a></li>
<li><a href="/followers"{% if request.path == "/followers" %} class="selected" {% endif %}>Followers <small class="badge">{{ followers_count }}</small></a></li> <li {% if request.path == "/following" %} class="is-active" {% endif %}><a href="/following">Following [{{ following_count }}]</a></li>
{% if not config.HIDE_FOLLOWING or session.logged_in %}<li id="menu-item-following"><a href="/following"{% if request.path == "/following" %} class="selected" {% endif %}>Following <small class="badge">{{ following_count }}</small></a></li>{% endif %} </ul>
<!-- <li><a href="/about"{% if request.path == "/about" %} class="selected" {% endif %}>/about</a></li> </div>
-->
</ul>
</div> </div>
</header> </header>

View file

@ -103,9 +103,9 @@ dt, dd { font-size: 0.9em; }
{% endif %} {% endif %}
<div class="base-container"> <main id="wrapper">
{% block content %}{% endblock %} {% block content %}{% endblock %}
</div> </main>
<footer class="footer"> <footer class="footer">
<div> <div>
Powered by <a href="https://microblog.pub">microblog.pub</a> <small class="microblogpub-version"><code>{{ microblogpub_version }}</code></small> (<a href="https://github.com/tsileo/microblog.pub">source code</a>) and the <a href="https://activitypub.rocks/">ActivityPub</a> protocol Powered by <a href="https://microblog.pub">microblog.pub</a> <small class="microblogpub-version"><code>{{ microblogpub_version }}</code></small> (<a href="https://github.com/tsileo/microblog.pub">source code</a>) and the <a href="https://activitypub.rocks/">ActivityPub</a> protocol

View file

@ -11,56 +11,136 @@
<h3 style="padding-bottom: 30px">Replying to {{ content }}</h3> <h3 style="padding-bottom: 30px">Replying to {{ content }}</h3>
{{ utils.display_thread(thread) }} {{ utils.display_thread(thread) }}
{% else %} {% else %}
<div class="tabbar">
<div class="tabs is-toggle is-rounded">
{% if request.args.get("question") == "1" %} {% if request.args.get("question") == "1" %}
<a href="{{ url_for('admin.admin_new') }}" class="tab">Note</a><a href="{{ url_for('admin.admin_new') }}?question=1" class="tab selected">Question</a> <ul>
<li><a href="{{ url_for('admin.admin_new') }}">Note</a></li>
<li class="is-active"><a href="{{ url_for('admin.admin_new') }}?question=1">Question</a></li>
</ul>
{% else %} {% else %}
<a href="{{ url_for('admin.admin_new') }}" class="tab selected">Note</a><a href="{{ url_for('admin.admin_new') }}?question=1" class="tab">Question</a> <ul>
<li class="is-active"><a href="{{ url_for('admin.admin_new') }}">Note</a></li>
<li><a href="{{ url_for('admin.admin_new') }}?question=1">Question</a></li>
</ul>
{% endif %} {% endif %}
</div> </div>
{% endif %} {% endif %}
<form id="new-activity" action="/api/new_{% if request.args.get("question") == "1" %}question{%else%}note{%endif%}" method="POST" enctype="multipart/form-data"> <form id="new-activity" action="/api/new_{% if request.args.get("question") == "1" %}question{%else%}note{%endif%}" method="POST" enctype="multipart/form-data">
<input type="hidden" name="redirect" value="/"> <input type="hidden" name="redirect" value="/">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<select name="visibility" style="padding:8px 10px;">
{% for v in visibility %}
<option value="{{v.name}}" {% if v == default_visibility %}selected="selected"{% endif %}>{{ v.value }}</option>
{% endfor %}
</select>
{% if reply %}<input type="hidden" name="reply" value="{{reply}}">{% endif %}
<p><input type="text" name="summary" placeholder="summary/CW (optional)"></p>
<p> <div class="field is-horizontal">
{% for emoji in emojis %} <div class="field-body">
<span class="ji">{{ emoji | emojify | safe }}</span> <!-- Visibility -->
{% endfor %} <div class="field">
{% for emoji in custom_emojis %} <label for="visibility" class="label">Visibility</label>
<span class="ji"><img src="{{emoji.get_icon_url()}}" alt="{{emoji.name}}" title="{{emoji.name}}" class="custom-emoji"></span> <div class="control">
{% endfor %} <div class="select">
</p> <select name="visibility" style="padding:8px 10px;">
{% for v in visibility %}
<option value="{{v.name}}" {% if v == default_visibility %}selected="selected"{% endif %}>{{ v.value }}</option>
{% endfor %}
</select>
</div>
</div>
</div>
<!-- Content Warning -->
<div class="field">
<label for="summary" class="label">Summary</label>
<p class="control">
<input class="input" name="summary" type="summary" placeholder="summary/CW (optional)">
</p>
</div>
</div>
</div>
<textarea name="content" rows="10" cols="50" autofocus="autofocus" designMode="on" style="font-size:1.2em;width:95%;">{{ content }}</textarea> {% if reply %}<input type="hidden" name="reply" value="{{reply}}">{% endif %}
<p> <div class="field">
<input type="file" name="file"> <div class="control">
<p> <div class="buttons">
<p> {% for emoji in emojis %}
<input type="text" name="file_description" placeholder="attachment description (optional)"> <span class="button is-dark ji">{{ emoji | emojify | safe }}</span>
</p> {% endfor %}
</div>
<p> <div class="buttons">
<input type="text" name="location_lat" id="location_lat" placeholder="latitude (optional)"> {% for emoji in custom_emojis %}
<input type="text" name="location_lng" id="location_lng" placeholder="longitude (optional)"> <span class="button is-dark ji"><img src="{{emoji.get_icon_url()}}" alt="{{emoji.name}}" title="{{emoji.name}}" class="custom-emoji"></span>
<a href="#" class="location_autofill">ask browser for location</a> {% endfor %}
</p> </div>
<p> </div>
<input type="text" name="location_name" placeholder="location name (optional)"> </div>
</p>
{% if request.args.get("question") == "1" %} <div class="field">
<div style="margin-top:20px;"> <div class="control">
<p>Open for: <select name="open_for"> <textarea class="textarea" name="content" rows="10" cols="50" autofocus="autofocus" designMode="on" style="font-size:1.2em;width:95%;">{{ content }}</textarea>
</div>
</div>
<div class="field is-horizontal">
<div class="field-body">
<div class="field">
<div class="file">
<label class="file-label">
<input class="file-input" type="file" name="name">
<span class="file-cta">
<span class="file-label">
Choose a file…
</span>
</span>
</label>
</div>
</div>
<div class="field">
<div class="control">
<input type="text" class="input" name="file_description" placeholder="attachment description (optional)">
</div>
</div>
</div>
</div>
<div class="field is-horizontal">
<div class="field-body">
<div class="field">
<div class="control">
<input type="text" class="input" name="location_lat" id="location_lat" placeholder="latitude (optional)">
</div>
</div>
<div class="field">
<div class="control">
<input type="text" class="input" name="location_lng" id="location_lng" placeholder="longitude (optional)">
</div>
</div>
<div class="field">
<div class="control">
<input type="text" class="input" name="location_name" placeholder="location name (optional)">
</div>
</div>
</div>
</div>
<div class="field">
<div class="control">
<a href="#" class="location_autofill button is-info">ask browser for location</a>
</div>
</div>
{% if request.args.get("question") == "1" %}
<div class="field is-horizontal">
<div class="field-body">
<div class="field">
<label for="open_for" class="label">Open for</label>
<div class="control">
<div class="select">
<select name="open_for">
<option value="5">5 minutes</option> <option value="5">5 minutes</option>
<option value="10">10 minutes</option> <option value="10">10 minutes</option>
<option value="15">15 minutes</option> <option value="15">15 minutes</option>
@ -70,22 +150,40 @@
<option value="1440" selected>1 day</option> <option value="1440" selected>1 day</option>
<option value="4320">3 days</option> <option value="4320">3 days</option>
<option value="10080">7 days</option> <option value="10080">7 days</option>
</select></p> </select>
</div>
</div>
</div>
<p><select name="of"> <div class="field">
<label for="of" class="label">Choices</label>
<div class="control">
<div class="select">
<select name="of">
<option value="oneOf">Single choice</option> <option value="oneOf">Single choice</option>
<option value="anyOf">Multiple choices</option> <option value="anyOf">Multiple choices</option>
</select></p> </select>
</div>
</div>
</div>
</div>
</div>
{% for i in range(4) %} {% for i in range(4) %}
<p><input type="text" name="answer{{i}}" placeholder="Answer #{{i+1}}"></p> <div class="field">
<div class="control">
<input type="text" class="input" name="answer{{i}}" placeholder="Answer #{{i+1}}">
</div>
</div>
{% endfor %} {% endfor %}
</div> {% endif %}
{% endif %}
<input type="submit" value="post"> <div class="field">
</div> <div class="control">
<input type="submit" value="post" class="button is-primary">
</div>
</div>
</form> </form>
</div> </div>

View file

@ -45,7 +45,7 @@
{% set icon_url = actor.icon.url | get_actor_icon_url(50) %} {% set icon_url = actor.icon.url | get_actor_icon_url(50) %}
{% endif %} {% endif %}
<span class="bar-item-no-hover" style="padding:0;"> <span class="bar-item-no-hover" style="padding:0;">
<span style="display:flex;height:30px;line-height:30px;background: url('{{ icon_url }}') no-repeat;background-size:30px;border-top-left-radius: 2px;border-bottom-left-radius: 2px;"> <span style="display:flex;height:30px;line-height:30px;background: url('{{ icon_url }}') no-repeat;background-size:30px;border-top-left-radius: 2px;border-bottom-left-radius: 2px;">
{% if before and before_url %} {% if before and before_url %}
<span style="flex-shrink:1; padding:0 10px 0 40px;"><a href="{{before_url}}">{{before}}</a></span> <span style="flex-shrink:1; padding:0 10px 0 40px;"><a href="{{before_url}}">{{before}}</a></span>
@ -60,7 +60,7 @@
<span style="flex-shrink:1;padding:0 10px;">{{ after }}</span> <span style="flex-shrink:1;padding:0 10px;">{{ after }}</span>
{% endif %} {% endif %}
</span> </span>
</span> </span>
{%- endmacro %} {%- endmacro %}
@ -96,22 +96,22 @@
{% set real_end_time = obj.closed or obj.endTime %} {% set real_end_time = obj.closed or obj.endTime %}
<article class="note-box"> <article class="note h-entry" id="activity-{{ obj.id | permalink_id }}">
<div class="note h-entry" id="activity-{{ obj.id | permalink_id }}"> <div class="media h-card p-author">
<figure class="media-left">
<div class="h-card p-author"> <a class="u-url u-uid no-hover image is-64x64" rel="author" href="{{ actor | url_or_id | get_url }}">
<a class="u-url u-uid no-hover" rel="author" href="{{ actor | url_or_id | get_url }}"><img class="u-photo" src="{% if not actor.icon %}/static/nopic.png{% else %}{{ actor.icon.url | get_actor_icon_url(50) }}{% endif %}"> <img class="u-photo" src="{% if not actor.icon %}/static/nopic.png{% else %}{{ actor.icon.url | get_actor_icon_url(50) }}{% endif %}">
</a> </a>
<data class="p-name" value="{{ actor.name or actor.preferredUsername }}"></data> </figure>
</div> <data class="p-name" value="{{ actor.name or actor.preferredUsername }}"></data>
<div class="media-content">
<div class="note-wrapper"> <aside>
<aside style="clear:both;height:20px;"> <a href="{{ actor | url_or_id | get_url }}" class="no-hover">
<a href="{{ actor | url_or_id | get_url }}" style="margin:0;text-decoration:none;margin: 0;text-decoration: none;display: block;width: 75%;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;float: left;" class="no-hover">
<strong>{{ (actor.name or actor.preferredUsername) | clean | replace_custom_emojis(actor) | safe }}</strong> <strong>{{ (actor.name or actor.preferredUsername) | clean | replace_custom_emojis(actor) | safe }}</strong>
<span class="l">@{% if not no_color and obj.id | is_from_outbox %}<span class="pcolor">{{ actor.preferredUsername | clean | replace_custom_emojis(actor) | safe }}</span>{% else %}{{ actor.preferredUsername | clean | replace_custom_emojis(actor) | safe }}{% endif %}@{% if not no_color and obj.id | is_from_outbox %}<span class="pcolor">{{ actor | url_or_id | get_url | domain }}</span>{% else %}{{ actor | url_or_id | get_url | domain }}{% endif %}</span></a> <span class="l">@{% if not no_color and obj.id | is_from_outbox %}<span class="pcolor">{{ actor.preferredUsername | clean | replace_custom_emojis(actor) | safe }}</span>{% else %}{{ actor.preferredUsername | clean | replace_custom_emojis(actor) | safe }}{% endif %}@{% if not no_color and obj.id | is_from_outbox %}<span class="pcolor">{{ actor | url_or_id | get_url | domain }}</span>{% else %}{{ actor | url_or_id | get_url | domain }}{% endif %}</span>
</a>
<span style="float:right;width: 25%;text-align: right;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;display: block;"> <span class="is-pulled-right">
<a rel="noopener" class="u-url u-uid note-permalink l" href="{{ obj | url_or_id | get_url }}"> <a rel="noopener" class="u-url u-uid note-permalink l" href="{{ obj | url_or_id | get_url }}">
<time class="dt-published" title="{{ obj.published }}" datetime="{{ obj.published }}" {% if obj | url_or_id | get_url | is_from_outbox %}{%else%}rel="external noreferrer"{%endif%}>{{ obj.published | format_timeago }}</time></a> <time class="dt-published" title="{{ obj.published }}" datetime="{{ obj.published }}" {% if obj | url_or_id | get_url | is_from_outbox %}{%else%}rel="external noreferrer"{%endif%}>{{ obj.published | format_timeago }}</time></a>
</span> </span>
@ -142,12 +142,12 @@
{% endif %} {% endif %}
<li class="answer"> <li class="answer">
{% if session.logged_in and not meta.poll_answers_sent and not (real_end_time | gtnow) and not (obj.id | is_from_outbox) %} {% if session.logged_in and not meta.poll_answers_sent and not (real_end_time | gtnow) and not (obj.id | is_from_outbox) %}
<span><form action="/api/vote" class="action-form" method="POST"> <span><form action="/api/vote" class="action-form" method="POST">
<input type="hidden" name="redirect" value="{{ redir }}"> <input type="hidden" name="redirect" value="{{ redir }}">
<input type="hidden" name="id" value="{{ obj.id }}"> <input type="hidden" name="id" value="{{ obj.id }}">
<input type="hidden" name="choice" value="{{ oneOf.name }}"> <input type="hidden" name="choice" value="{{ oneOf.name }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="bar-item">vote</button> <button type="submit" class="bar-item">vote</button>
</form></span>{% endif %} </form></span>{% endif %}
<span class="answer-bar color-menu-background" style="width:{{pct}}%;"></span> <span class="answer-bar color-menu-background" style="width:{{pct}}%;"></span>
@ -168,12 +168,12 @@
<li class="answer"> <li class="answer">
{% set already_voted = anyOf.name | poll_answer_key in meta.poll_answers_sent %} {% set already_voted = anyOf.name | poll_answer_key in meta.poll_answers_sent %}
{% if session.logged_in and not already_voted and not (real_end_time | gtnow) and not (obj.id | is_from_outbox) %} {% if session.logged_in and not already_voted and not (real_end_time | gtnow) and not (obj.id | is_from_outbox) %}
<span><form action="/api/vote" class="action-form" method="POST"> <span><form action="/api/vote" class="action-form" method="POST">
<input type="hidden" name="redirect" value="{{ redir }}"> <input type="hidden" name="redirect" value="{{ redir }}">
<input type="hidden" name="id" value="{{ obj.id }}"> <input type="hidden" name="id" value="{{ obj.id }}">
<input type="hidden" name="choice" value="{{ anyOf.name }}"> <input type="hidden" name="choice" value="{{ anyOf.name }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="bar-item">vote</button> <button type="submit" class="bar-item">vote</button>
</form></span> </form></span>
{% elif session.logged_in and already_voted and not (real_end_time | gtnow) %} {% elif session.logged_in and already_voted and not (real_end_time | gtnow) %}
<span style="position:relative;top:5px;height:10px;width:50px;display:inline-block;"></span> <span style="position:relative;top:5px;height:10px;width:50px;display:inline-block;"></span>
@ -213,25 +213,25 @@
{% if obj.sensitive and not request.args.get("show_sensitive") == perma_id %} {% if obj.sensitive and not request.args.get("show_sensitive") == perma_id %}
<div style="clear:both"> <div style="clear:both">
<form action="{{redir}}" class="action-form" method="GET" style="display:inline-block"> <form action="{{redir}}" class="action-form" method="GET" style="display:inline-block">
<input type="hidden" name="show_sensitive" value="{{perma_id}}"> <input type="hidden" name="show_sensitive" value="{{perma_id}}">
{% for k, v in request.args.items() %} {% for k, v in request.args.items() %}
<input type="hidden" name="{{k}}" value="{{v}}"> <input type="hidden" name="{{k}}" value="{{v}}">
{% endfor %} {% endfor %}
<button type="submit" class="bar-item-reverse">display sensitive content</button> <button type="submit" class="bar-item-reverse">display sensitive content</button>
</form> </form>
</div> </div>
{% else %} {% else %}
{% if obj.sensitive %} {% if obj.sensitive %}
<div style="clear:both;margin-bottom: 20px;"> <div style="clear:both;margin-bottom: 20px;">
<form action="{{redir}}" class="action-form" method="GET" style="display:inline-block"> <form action="{{redir}}" class="action-form" method="GET" style="display:inline-block">
{% for k, v in request.args.items() %} {% for k, v in request.args.items() %}
{% if k != "show_sensitive" %} {% if k != "show_sensitive" %}
<input type="hidden" name="{{k}}" value="{{v}}"> <input type="hidden" name="{{k}}" value="{{v}}">
{% endif %} {% endif %}
{% endfor %} {% endfor %}
<button type="submit" class="bar-item">hide sensitive content</button> <button type="submit" class="bar-item">hide sensitive content</button>
</form> </form>
</div> </div>
{% endif %} {% endif %}
@ -255,169 +255,163 @@
</ul> </ul>
{% endif %} {% endif %}
{% endif %} {% endif %}
</div> </div>
{% endif %} {% endif %}
{% if meta and meta.og_metadata and obj | has_type('Note') %} {% if meta and meta.og_metadata and obj | has_type('Note') %}
{% for og in meta.og_metadata %} {% for og in meta.og_metadata %}
{% if og.url %} {% if og.url %}
<a href="{{ og.url }}" class="og-link" style="margin:30px 0;clear:both;display: flex;"> <a href="{{ og.url }}" class="og-link" style="margin:30px 0;clear:both;display: flex;">
{% if og.image | get_og_image_url %} {% if og.image | get_og_image_url %}
<div style="padding:0 20px 0 0;"> <div style="padding:0 20px 0 0;">
<img style="width:100px;border-radius:3px;" src="{{ og.image | get_og_image_url }}"> <img style="width:100px;border-radius:3px;" src="{{ og.image | get_og_image_url }}">
</div> </div>
{% endif %} {% endif %}
<div> <div>
<strong>{{ og.title }}</strong> <strong>{{ og.title }}</strong>
<p>{{ og.description | truncate(80) }}</p> <p>{{ og.description | truncate(80) }}</p>
<small>{{ og.site_name }}</small> <small>{{ og.site_name }}</small>
</div> </div>
</a> </a>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
<aside class="bottom-bar buttons">
{% if meta.count_reply and obj.id | is_from_outbox %}<a class ="bar-item" href="{{ obj.url | get_url }}"><strong>{{ meta.count_reply }}</strong> repl{% if meta.count_reply > 1 %}ies{% else %}y{% endif %}</a>
{% elif meta.count_reply and session.logged_in %}
<a class="button" href="/admin/thread?oid={{aid}}"><strong>{{ meta.count_reply }}</strong> repl{% if meta.count_reply > 1 %}ies{% else %}y{% endif %}</a>{% endif %}
{% if not perma and meta.count_boost and obj.id | is_from_outbox %}<a class ="button" href="{{ obj.url | get_url }}"><strong>{{ meta.count_boost }}</strong> boost{% if meta.count_boost > 1 %}s{% endif %}</a>{% endif %}
{% if not perma and meta.count_like and obj.id | is_from_outbox %}<a class ="button" href="{{ obj.url | get_url }}"><strong>{{ meta.count_like }}</strong> like{% if meta.count_like > 1 %}s{% endif %}</a>{% endif %}
{% if session.logged_in %}
<a class="button" href="/admin/new?reply={{ aid }}">reply</a>
<aside class="bottom-bar"> {% if meta | get_visibility | visibility_is_public %}
{% if meta.count_reply and obj.id | is_from_outbox %}<a class ="bar-item" href="{{ obj.url | get_url }}"><strong>{{ meta.count_reply }}</strong> repl{% if meta.count_reply > 1 %}ies{% else %}y{% endif %}</a> {% if meta.boosted %}
{% elif meta.count_reply and session.logged_in %} <form action="/api/undo" class="action-form" method="POST">
<a class="bar-item" href="/admin/thread?oid={{aid}}"><strong>{{ meta.count_reply }}</strong> repl{% if meta.count_reply > 1 %}ies{% else %}y{% endif %}</a>{% endif %} <input type="hidden" name="redirect" value="{{ redir }}">
<input type="hidden" name="id" value="{{ meta.boosted }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="button">unboost</button>
</form>
{% else %}
<form action="/api/boost" class="action-form" method="POST">
<input type="hidden" name="redirect" value="{{ redir }}">
<input type="hidden" name="id" value="{{ obj.id }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="button">boost</button>
</form>
{% endif %}
{% endif %}
{% if meta.liked %}
<form action="/api/undo" class="action-form" method="POST">
<input type="hidden" name="redirect" value="{{ redir }}">
<input type="hidden" name="id" value="{{ meta.liked }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="button">unlike</button>
</form>
{% else %}
<form action="/api/like" class="action-form" method="POST">
<input type="hidden" name="redirect" value="{{ redir }}">
<input type="hidden" name="id" value="{{ obj.id }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="button">like</button>
</form>
{% endif %}
{% if not perma and meta.count_boost and obj.id | is_from_outbox %}<a class ="bar-item" href="{{ obj.url | get_url }}"><strong>{{ meta.count_boost }}</strong> boost{% if meta.count_boost > 1 %}s{% endif %}</a>{% endif %} {% if meta.bookmarked or request.path == url_for("admin.admin_bookmarks") %}
{% if not perma and meta.count_like and obj.id | is_from_outbox %}<a class ="bar-item" href="{{ obj.url | get_url }}"><strong>{{ meta.count_like }}</strong> like{% if meta.count_like > 1 %}s{% endif %}</a>{% endif %} <form action="/api/bookmark" class="action-form" method="POST">
<input type="hidden" name="redirect" value="{{ redir }}">
<input type="hidden" name="id" value="{{ obj.id }}">
<input type="hidden" name="undo" value="yes">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="button">unbookmark</button>
</form>
{% else %}
<form action="/api/bookmark" class="action-form" method="POST">
<input type="hidden" name="redirect" value="{{ redir }}">
<input type="hidden" name="id" value="{{ obj.id }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="button">bookmark</button>
</form>
{% endif %}
{% if session.logged_in %} {% if obj.id | is_from_outbox %}
<a class="bar-item" href="/admin/new?reply={{ aid }}">reply</a> <form action="/api/note/delete" class="action-form" method="POST">
<input type="hidden" name="redirect" value="{{ redir }}">
<input type="hidden" name="id" value="{{ obj.id }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="button" onclick="return confirm('Confirm the delete action?');">delete</button>
</form>
{% if meta.pinned %}
<form action="/api/note/unpin" class="action-form" method="POST">
<input type="hidden" name="redirect" value="{{ redir }}">
<input type="hidden" name="id" value="{{ obj.id }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="button">unpin</button>
</form>
{% else %}
<form action="/api/note/pin" class="action-form" method="POST">
<input type="hidden" name="redirect" value="{{ redir }}">
<input type="hidden" name="id" value="{{ obj.id }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="button">pin</button>
</form>
{% endif %}
{% if meta | get_visibility | visibility_is_public %} {% endif %}
{% if meta.boosted %} {% endif %}
<form action="/api/undo" class="action-form" method="POST">
<input type="hidden" name="redirect" value="{{ redir }}">
<input type="hidden" name="id" value="{{ meta.boosted }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="bar-item">unboost</button>
</form>
{% else %}
<form action="/api/boost" class="action-form" method="POST">
<input type="hidden" name="redirect" value="{{ redir }}">
<input type="hidden" name="id" value="{{ obj.id }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="bar-item">boost</button>
</form>
{% endif %}
{% endif %}
{% if meta.liked %} {% if session.logged_in and obj.inReplyTo and not meta.count_reply and not perma %}
<form action="/api/undo" class="action-form" method="POST"> <a class="button" href="/admin/thread?oid={{aid}}">thread</a>
<input type="hidden" name="redirect" value="{{ redir }}"> {% endif %}
<input type="hidden" name="id" value="{{ meta.liked }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="bar-item">unlike</button>
</form>
{% else %}
<form action="/api/like" class="action-form" method="POST">
<input type="hidden" name="redirect" value="{{ redir }}">
<input type="hidden" name="id" value="{{ obj.id }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="bar-item">like</button>
</form>
{% endif %}
{% if meta.bookmarked or request.path == url_for("admin.admin_bookmarks") %} {% if meta | get_visibility | visibility_is_public %}
<form action="/api/bookmark" class="action-form" method="POST"> {% if obj | url_or_id | get_url | is_from_outbox %}
<input type="hidden" name="redirect" value="{{ redir }}"> {% if not perma %}
<input type="hidden" name="id" value="{{ obj.id }}"> <a class="button" href="{{ obj | url_or_id | get_url }}">permalink</a>
<input type="hidden" name="undo" value="yes"> {% endif %}
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"> {% else %}
<button type="submit" class="bar-item">unbookmark</button> <a class="button" href="{{ obj | url_or_id | get_url }}" rel="external noreferrer">source</a>
</form> {% if session.logged_in %}
{% else %} <a class="button" href="/admin/profile?actor_id={{actor.id}}">profile</a>
<form action="/api/bookmark" class="action-form" method="POST"> {% endif %}
<input type="hidden" name="redirect" value="{{ redir }}"> {% endif %}
<input type="hidden" name="id" value="{{ obj.id }}"> {% endif %}
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"> <a class="button bar-item-no-border">{{ meta | get_visibility | visibility }}</a>
<button type="submit" class="bar-item">bookmark</button>
</form>
{% endif %}
</aside>
{% if likes or shares %}
{% if obj.id | is_from_outbox %} <aside style="padding-top:20px;">
<form action="/api/note/delete" class="action-form" method="POST"> {% if likes %}
<input type="hidden" name="redirect" value="{{ redir }}">
<input type="hidden" name="id" value="{{ obj.id }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="bar-item" onclick="return confirm('Confirm the delete action?');">delete</button>
</form>
{% if meta.pinned %}
<form action="/api/note/unpin" class="action-form" method="POST">
<input type="hidden" name="redirect" value="{{ redir }}">
<input type="hidden" name="id" value="{{ obj.id }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="bar-item">unpin</button>
</form>
{% else %}
<form action="/api/note/pin" class="action-form" method="POST">
<input type="hidden" name="redirect" value="{{ redir }}">
<input type="hidden" name="id" value="{{ obj.id }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="bar-item">pin</button>
</form>
{% endif %}
{% endif %}
{% endif %}
{% if session.logged_in and obj.inReplyTo and not meta.count_reply and not perma %}
<a class="bar-item" href="/admin/thread?oid={{aid}}">thread</a>
{% endif %}
{% if meta | get_visibility | visibility_is_public %}
{% if obj | url_or_id | get_url | is_from_outbox %}
{% if not perma %}
<a class="bar-item" href="{{ obj | url_or_id | get_url }}">permalink</a>
{% endif %}
{% else %}
<a class="bar-item" href="{{ obj | url_or_id | get_url }}" rel="external noreferrer">source</a>
{% if session.logged_in %}
<a class="bar-item" href="/admin/profile?actor_id={{actor.id}}">profile</a>
{% endif %}
{% endif %}
{% endif %}
<a class="bar-item bar-item-no-border">{{ meta | get_visibility | visibility }}</a>
</aside>
{% if likes or shares %}
<aside style="padding-top:20px;">
{% if likes %}
<h4 style="font-weight:normal"><strong>{{ likes|length }}</strong> like{% if (likes | length) > 1 %}s{% endif %}</h4> <h4 style="font-weight:normal"><strong>{{ likes|length }}</strong> like{% if (likes | length) > 1 %}s{% endif %}</h4>
<div style="display:flex;flex-wrap:wrap;"> <div style="display:flex;flex-wrap:wrap;">
{% for like in likes %} {% for like in likes %}
{{ display_actor_icon(like) }} {{ display_actor_icon(like) }}
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
{% if shares %} {% if shares %}
<h4 style="font-weight:normal"><strong>{{ shares|length }}</strong> boost{% if (shares|length) > 1 %}s{% endif %}</h4> <h4 style="font-weight:normal"><strong>{{ shares|length }}</strong> boost{% if (shares|length) > 1 %}s{% endif %}</h4>
<div style="display:flex;flex-wrap:wrap;"> <div style="display:flex;flex-wrap:wrap;">
{% for boost in shares %} {% for boost in shares %}
{{ display_actor_icon(boost) }} {{ display_actor_icon(boost) }}
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
</aside> </aside>
{% endif %} {% endif %}
</div> </div>
</div> </div>
</article> </article>