fix: Correct layout seperation -- let partials provide their own grid row if required

* Wrapping the content in a row at layout level breaks for content elements which don't need one, so better to include it as part of the partial template.
ila
Aonrud 2023-01-04 17:15:36 +00:00
rodzic 1e6ace7c81
commit 4781b8d9f6
9 zmienionych plików z 318 dodań i 311 usunięć

Wyświetl plik

@ -6,39 +6,41 @@
{% endblock %}
{% block content %}
<section class="admin-page admin-inbox col-md-8 col-md-offset-2">
{% if show_filters %}
{{ utils.display_box_filters("admin_inbox") }}
{% endif %}
<div class="row">
<section class="admin-page admin-inbox col-md-8 col-md-offset-2">
{% if show_filters %}
{{ utils.display_box_filters("admin_inbox") }}
{% endif %}
{% if not inbox %}
<p>Nothing to see yet, <a href="{{ url_for("get_lookup") }}">start following people in the lookup section</a>.</p>
{% endif %}
{% if not inbox %}
<p>Nothing to see yet, <a href="{{ url_for("get_lookup") }}">start following people in the lookup section</a>.</p>
{% endif %}
{% for inbox_object in inbox %}
{% if inbox_object.ap_type == "Announce" %}
{{ utils.actor_action(inbox_object, "shared", with_icon=True) }}
{{ utils.display_object(inbox_object.relates_to_anybox_object) }}
{% elif inbox_object.ap_type in ["Article", "Note", "Video", "Page", "Question"] %}
{{ utils.display_object(inbox_object) }}
{% elif inbox_object.ap_type == "Follow" %}
{{ utils.actor_action(inbox_object, "followed you") }}
{{ utils.display_actor(inbox_object.actor, actors_metadata) }}
{% elif inbox_object.ap_type == "Like" %}
{{ utils.actor_action(inbox_object, "liked one of your posts", with_icon=True) }}
{{ utils.display_object(inbox_object.relates_to_anybox_object) }}
{% else %}
<p>
Implement {{ inbox_object.ap_type }}
{{ inbox_object.ap_object }}
</p>
{% endif %}
{% endfor %}
{% for inbox_object in inbox %}
{% if inbox_object.ap_type == "Announce" %}
{{ utils.actor_action(inbox_object, "shared", with_icon=True) }}
{{ utils.display_object(inbox_object.relates_to_anybox_object) }}
{% elif inbox_object.ap_type in ["Article", "Note", "Video", "Page", "Question"] %}
{{ utils.display_object(inbox_object) }}
{% elif inbox_object.ap_type == "Follow" %}
{{ utils.actor_action(inbox_object, "followed you") }}
{{ utils.display_actor(inbox_object.actor, actors_metadata) }}
{% elif inbox_object.ap_type == "Like" %}
{{ utils.actor_action(inbox_object, "liked one of your posts", with_icon=True) }}
{{ utils.display_object(inbox_object.relates_to_anybox_object) }}
{% else %}
<p>
Implement {{ inbox_object.ap_type }}
{{ inbox_object.ap_object }}
</p>
{% endif %}
{% endfor %}
{% if next_cursor %}
<footer>
<a href="{{ request.url._path }}?cursor={{ next_cursor }}{% if request.query_params.filter_by %}&filter_by={{ request.query_params.filter_by }}{% endif %}" class="btn btn-primary btn-lg">See more</a>
</footer>
{% endif %}
</section>
{% if next_cursor %}
<footer>
<a href="{{ request.url._path }}?cursor={{ next_cursor }}{% if request.query_params.filter_by %}&filter_by={{ request.query_params.filter_by }}{% endif %}" class="btn btn-primary btn-lg">See more</a>
</footer>
{% endif %}
</section>
</div>
{% endblock %}

Wyświetl plik

@ -6,109 +6,111 @@
{% endblock %}
{% block content %}
<section class="admin-page admin-new col-md-8 col-md-offset-2">
{% if in_reply_to_object %}
<div class="actor-action">In reply to:</div>
{{ utils.display_object(in_reply_to_object) }}
{% endif %}
<ul class="nav nav-tabs">
{% for ap_type in ["Note", "Article", "Question"] %}
<li {% if request.query_params.get("type", "Note") == ap_type %}class="active"{% endif %}>
<a href="?type={{ ap_type }}">
{{ ap_type }}
</a>
</li>
{% endfor %}
</ul>
<form class="form admin-new" action="{{ request.url_for("admin_actions_new") }}" enctype="multipart/form-data" method="POST">
{{ utils.embed_csrf_token() }}
{{ utils.embed_redirect_url() }}
<p>
<select name="visibility" class="form-control">
{% for (k, v) in visibility_choices %}
<option value="{{ k }}" {% if visibility == k or in_reply_to_object and in_reply_to_object.visibility.name == k %}selected{% endif %}>{{ v }}</option>
{% endfor %}
</select>
</p>
{% if request.query_params.type == "Article" %}
<p>
<input type="text" class="form-control" name="name" placeholder="Title">
</p>
<div class="row">
<section class="admin-page admin-new col-md-8 col-md-offset-2">
{% if in_reply_to_object %}
<div class="actor-action">In reply to:</div>
{{ utils.display_object(in_reply_to_object) }}
{% endif %}
<div class="form-group">
<p><label for="content">Post</label></p>
<div class="btn-group">
{% for emoji in emojis %}
<button type="button" class="ji btn btn-default">{{ emoji | safe }}</button>
{% endfor %}
{% for emoji in custom_emojis %}
<button type="button" class="ji btn btn-default"><img src="{{ emoji.icon.url }}" alt="{{ emoji.name }}" title="{{ emoji.name }}" class="custom-emoji"></button>
{% endfor %}
</div>
<ul class="nav nav-tabs">
{% for ap_type in ["Note", "Article", "Question"] %}
<li {% if request.query_params.get("type", "Note") == ap_type %}class="active"{% endif %}>
<a href="?type={{ ap_type }}">
{{ ap_type }}
</a>
</li>
{% endfor %}
</ul>
<textarea name="content" rows="10" cols="50" autofocus="autofocus" designMode="on" placeholder="Post" class="form-control">{{ content }}</textarea>
</div>
<form class="form admin-new" action="{{ request.url_for("admin_actions_new") }}" enctype="multipart/form-data" method="POST">
{{ utils.embed_csrf_token() }}
{{ utils.embed_redirect_url() }}
<p>
<select name="visibility" class="form-control">
{% for (k, v) in visibility_choices %}
<option value="{{ k }}" {% if visibility == k or in_reply_to_object and in_reply_to_object.visibility.name == k %}selected{% endif %}>{{ v }}</option>
{% endfor %}
</select>
</p>
{% if request.query_params.type == "Question" %}
<fieldset class="form-group">
<p class="form-group">
<label for="poll_type">Poll Type</label>
<select name="poll_type">
<option value="oneOf">single choice</option>
<option value="anyOf">multiple choices</option>
</select>
{% if request.query_params.type == "Article" %}
<p>
<input type="text" class="form-control" name="name" placeholder="Title">
</p>
<p class="form-group">
<label for="poll_type">Poll Duration</label>
<select name="poll_duration">
<option value="5">ends in 5 minutes</option>
<option value="30">ends in 30 minutes</option>
<option value="60">ends in 1 hour</option>
<option value="360">ends in 6 hours</option>
<option value="1440">ends in 1 day</option>
</select>
</p>
<div class="form-group">
<label>Poll Options</label>
{% for i in ["1", "2", "3", "4"] %}
<p>
<input type="text" name="poll_answer_{{ i }}" class="form-control" placeholder="Option {{ i }}, leave empty to disable">
</p>
{% endif %}
<div class="form-group">
<p><label for="content">Post</label></p>
<div class="btn-group">
{% for emoji in emojis %}
<button type="button" class="ji btn btn-default">{{ emoji | safe }}</button>
{% endfor %}
{% for emoji in custom_emojis %}
<button type="button" class="ji btn btn-default"><img src="{{ emoji.icon.url }}" alt="{{ emoji.name }}" title="{{ emoji.name }}" class="custom-emoji"></button>
{% endfor %}
</div>
</fieldset>
{% endif %}
<p class="form-group">
<label for="content_warning">Content Warning</label>
<input type="text" name="content_warning" placeholder="content warning (will mark the post as sensitive)"{% if content_warning %} value="{{ content_warning }}"{% endif %} class="form-control">
</p>
<div class="checkbox">
<label>
<input type="checkbox" name="is_sensitive" id="is_sensitive">
Mark attachment(s) as sensitive
</label>
</div>
<input type="hidden" name="in_reply_to" value="{{ request.query_params.in_reply_to }}">
<div class="form-group">
<label for="files">Attachments</label>
<input id="files" name="files" type="file" multiple />
</div>
<div id="alts"></div>
<div class="form-group">
<input type="submit" value="Publish" class="btn btn-primary" />
</div>
</form>
<textarea name="content" rows="10" cols="50" autofocus="autofocus" designMode="on" placeholder="Post" class="form-control">{{ content }}</textarea>
</div>
<script src="{{ BASE_URL }}/static/new.js?v={{ JS_HASH }}"></script>
</section>
{% if request.query_params.type == "Question" %}
<fieldset class="form-group">
<p class="form-group">
<label for="poll_type">Poll Type</label>
<select name="poll_type">
<option value="oneOf">single choice</option>
<option value="anyOf">multiple choices</option>
</select>
</p>
<p class="form-group">
<label for="poll_type">Poll Duration</label>
<select name="poll_duration">
<option value="5">ends in 5 minutes</option>
<option value="30">ends in 30 minutes</option>
<option value="60">ends in 1 hour</option>
<option value="360">ends in 6 hours</option>
<option value="1440">ends in 1 day</option>
</select>
</p>
<div class="form-group">
<label>Poll Options</label>
{% for i in ["1", "2", "3", "4"] %}
<p>
<input type="text" name="poll_answer_{{ i }}" class="form-control" placeholder="Option {{ i }}, leave empty to disable">
</p>
{% endfor %}
</div>
</fieldset>
{% endif %}
<p class="form-group">
<label for="content_warning">Content Warning</label>
<input type="text" name="content_warning" placeholder="content warning (will mark the post as sensitive)"{% if content_warning %} value="{{ content_warning }}"{% endif %} class="form-control">
</p>
<div class="checkbox">
<label>
<input type="checkbox" name="is_sensitive" id="is_sensitive">
Mark attachment(s) as sensitive
</label>
</div>
<input type="hidden" name="in_reply_to" value="{{ request.query_params.in_reply_to }}">
<div class="form-group">
<label for="files">Attachments</label>
<input id="files" name="files" type="file" multiple />
</div>
<div id="alts"></div>
<div class="form-group">
<input type="submit" value="Publish" class="btn btn-primary" />
</div>
</form>
<script src="{{ BASE_URL }}/static/new.js?v={{ JS_HASH }}"></script>
</section>
</div>
{% endblock %}

Wyświetl plik

@ -6,30 +6,32 @@
{% endblock %}
{% block content %}
<section class="admin-page admin-outbox col-md-8 col-md-offset-2">
{{ utils.display_box_filters("admin_outbox") }}
<div class="row">
<section class="admin-page admin-outbox col-md-8 col-md-offset-2">
{{ utils.display_box_filters("admin_outbox") }}
{% for outbox_object in outbox %}
{% for outbox_object in outbox %}
{% if outbox_object.ap_type == "Announce" %}
<div class="actor-action">You shared <span title="{{ outbox_object.ap_published_at.isoformat() }}">{{ outbox_object.ap_published_at | timeago }}</span></div>
{{ utils.display_object(outbox_object.relates_to_anybox_object) }}
{% elif outbox_object.ap_type == "Like" %}
<div class="actor-action">You liked <span title="{{ outbox_object.ap_published_at.isoformat() }}">{{ outbox_object.ap_published_at | timeago }}</span></div>
{{ utils.display_object(outbox_object.relates_to_anybox_object) }}
{% elif outbox_object.ap_type == "Follow" %}
<div class="actor-action">You followed <span title="{{ outbox_object.ap_published_at.isoformat() }}">{{ outbox_object.ap_published_at | timeago }}</span></div>
{{ utils.display_actor(outbox_object.relates_to_actor, actors_metadata) }}
{% elif outbox_object.ap_type in ["Article", "Note", "Video", "Question"] %}
{{ utils.display_object(outbox_object) }}
{% if outbox_object.ap_type == "Announce" %}
<div class="actor-action">You shared <span title="{{ outbox_object.ap_published_at.isoformat() }}">{{ outbox_object.ap_published_at | timeago }}</span></div>
{{ utils.display_object(outbox_object.relates_to_anybox_object) }}
{% elif outbox_object.ap_type == "Like" %}
<div class="actor-action">You liked <span title="{{ outbox_object.ap_published_at.isoformat() }}">{{ outbox_object.ap_published_at | timeago }}</span></div>
{{ utils.display_object(outbox_object.relates_to_anybox_object) }}
{% elif outbox_object.ap_type == "Follow" %}
<div class="actor-action">You followed <span title="{{ outbox_object.ap_published_at.isoformat() }}">{{ outbox_object.ap_published_at | timeago }}</span></div>
{{ utils.display_actor(outbox_object.relates_to_actor, actors_metadata) }}
{% elif outbox_object.ap_type in ["Article", "Note", "Video", "Question"] %}
{{ utils.display_object(outbox_object) }}
{% endif %}
{% endfor %}
{% if next_cursor %}
<footer>
<a href="{{ url_for("admin_outbox") }}?cursor={{ next_cursor }}{% if request.query_params.filter_by %}&filter_by={{ request.query_params.filter_by }}{% endif %}" class="btn btn-lg btn-primary">See more</a>
</footer>
{% endif %}
{% endfor %}
{% if next_cursor %}
<footer>
<a href="{{ url_for("admin_outbox") }}?cursor={{ next_cursor }}{% if request.query_params.filter_by %}&filter_by={{ request.query_params.filter_by }}{% endif %}" class="btn btn-lg btn-primary">See more</a>
</footer>
{% endif %}
</section>
</section>
</div>
{% endblock %}

Wyświetl plik

@ -6,23 +6,25 @@
{% extends "layout.html" %}
{% block content %}
<section class="admin-page admin-profile col-md-8 col-md-offset-2">
{{ utils.display_actor(actor, actors_metadata, with_details=True) }}
{% for inbox_object in inbox_objects %}
{% if inbox_object.ap_type == "Announce" %}
{{ utils.actor_action(inbox_object, "shared", with_icon=True) }}
{{ utils.display_object(inbox_object.relates_to_anybox_object) }}
{% else %}
{{ utils.display_object(inbox_object) }}
{% endif %}
{% endfor %}
<div class="row">
<section class="admin-page admin-profile col-md-8 col-md-offset-2">
{{ utils.display_actor(actor, actors_metadata, with_details=True) }}
{% for inbox_object in inbox_objects %}
{% if inbox_object.ap_type == "Announce" %}
{{ utils.actor_action(inbox_object, "shared", with_icon=True) }}
{{ utils.display_object(inbox_object.relates_to_anybox_object) }}
{% else %}
{{ utils.display_object(inbox_object) }}
{% endif %}
{% endfor %}
{% if next_cursor %}
<footer>
<a href="{{ request.url._path }}?actor_id={{ request.query_params.actor_id }}&cursor={{ next_cursor }}" class="btn btn-lg btn-primary">
See more
</a>
</footer>
{% endif %}
</section>
{% if next_cursor %}
<footer>
<a href="{{ request.url._path }}?actor_id={{ request.query_params.actor_id }}&cursor={{ next_cursor }}" class="btn btn-lg btn-primary">
See more
</a>
</footer>
{% endif %}
</section>
</div>
{% endblock %}

Wyświetl plik

@ -1,14 +1,16 @@
<footer id="footer" class="clearfix">
<h3 class="text-center segmented"><a href="https://www.leftarchive.ie"><span class="fas fa-house"></span> Irish Left Archive homepage <span class="fas fa-arrow-right"></span></a></h3>
<div class="col-sm-6">
<h4><span class="fas fa-info fa-fw"></span> About the Irish Left Archive</h4>
<p>In 2007 the <a href="https://cedarlounge.wordpress.com" rel="external" class="external-link">Cedar Lounge Revolution<span class="fas fa-external-link-alt"></span></a> decided to initiate and host the Irish Left Online Document Archive. This was intended to be an online archive of materials relating to the Irish left with documents, leaflets, pamphlets, posters and newspapers from the latter half of the 20th century placed online in PDF format, freely accessible and easy to download for those who are interested&hellip;</p>
<p><a class="btn" href="https://www.leftarchive.ie/information/about-the-irish-left-archive/">Read more <span class="fas fa-arrow-right"></span></a></p>
</div>
<div class="col-sm-6">
<h4><span class="fas fa-share-nodes fa-fw"></span> @ila@leftarchive.ie</h4>
<p>This site is built using <a href="https://microblog.pub/" rel="external" class="external-link">Microblog.pub <span class="fas fa-external-link-alt"></span></a>, a single-user ActivityPub microblog.</p>
<p>You can <a href="/remote_follow">follow @ila@leftarchive.ie</a> from any Fediverse account, such as Mastodon, Pixelfed, Peertube etc.</p>
<p><a class="btn" href="https://github.com/Aonrud/ila-microblog.pub/tree/ila"><span class="fab fa-github"></span> View the ILA Micropub repo <span class="fas fa-arrow-right"></span></a></p>
</div>
</footer>
<div class="row">
<footer id="footer" class="clearfix">
<h3 class="text-center segmented"><a href="https://www.leftarchive.ie"><span class="fas fa-house"></span> Irish Left Archive homepage <span class="fas fa-arrow-right"></span></a></h3>
<div class="col-sm-6">
<h4><span class="fas fa-info fa-fw"></span> About the Irish Left Archive</h4>
<p>In 2007 the <a href="https://cedarlounge.wordpress.com" rel="external" class="external-link">Cedar Lounge Revolution<span class="fas fa-external-link-alt"></span></a> decided to initiate and host the Irish Left Online Document Archive. This was intended to be an online archive of materials relating to the Irish left with documents, leaflets, pamphlets, posters and newspapers from the latter half of the 20th century placed online in PDF format, freely accessible and easy to download for those who are interested&hellip;</p>
<p><a class="btn" href="https://www.leftarchive.ie/information/about-the-irish-left-archive/">Read more <span class="fas fa-arrow-right"></span></a></p>
</div>
<div class="col-sm-6">
<h4><span class="fas fa-share-nodes fa-fw"></span> @ila@leftarchive.ie</h4>
<p>This site is built using <a href="https://microblog.pub/" rel="external" class="external-link">Microblog.pub <span class="fas fa-external-link-alt"></span></a>, a single-user ActivityPub microblog.</p>
<p>You can <a href="/remote_follow">follow @ila@leftarchive.ie</a> from any Fediverse account, such as Mastodon, Pixelfed, Peertube etc.</p>
<p><a class="btn" href="https://github.com/Aonrud/ila-microblog.pub/tree/ila"><span class="fab fa-github"></span> View the ILA Micropub repo <span class="fas fa-arrow-right"></span></a></p>
</div>
</footer>
</div>

Wyświetl plik

@ -52,12 +52,8 @@
</nav>
</div>
{% endif %}
<div class="row">
{% block content %}{% endblock %}
</div>
<div class="row">
{% include "footer.html" %}
</div>
{% block content %}{% endblock %}
{% include "footer.html" %}
</div>
{% if is_admin %}
<script src="{{ BASE_URL }}/static/common-admin.js?v={{ JS_HASH }}"></script>

Wyświetl plik

@ -17,107 +17,109 @@
{% endmacro %}
{% block content %}
<div class="admin-page admin-notifications col-md-8 col-md-offset-2">
<h2>Notifications</h2>
<div id="notifications">
{%- for notif in notifications %}
<div class="notification">
{%- if notif.notification_type.value == "new_follower" %}
{{ notif_actor_action(notif, "followed you") }}
{{ utils.display_actor(notif.actor, actors_metadata) }}
{%- elif notif.notification_type.value == "pending_incoming_follower" %}
{{ notif_actor_action(notif, "sent a follow request") }}
{{ utils.display_actor(notif.actor, actors_metadata, pending_incoming_follow_notif=notif) }}
{% elif notif.notification_type.value == "rejected_follower" %}
{% elif notif.notification_type.value == "unfollow" %}
{{ notif_actor_action(notif, "unfollowed you") }}
{{ utils.display_actor(notif.actor, actors_metadata) }}
{%- elif notif.notification_type.value == "follow_request_accepted" %}
{{ notif_actor_action(notif, "accepted your follow request") }}
{{ utils.display_actor(notif.actor, actors_metadata) }}
{%- elif notif.notification_type.value == "follow_request_rejected" %}
{{ notif_actor_action(notif, "rejected your follow request") }}
{{ utils.display_actor(notif.actor, actors_metadata) }}
{% elif notif.notification_type.value == "blocked" %}
{{ notif_actor_action(notif, "blocked you") }}
{{ utils.display_actor(notif.actor, actors_metadata) }}
{% elif notif.notification_type.value == "unblocked" %}
{{ notif_actor_action(notif, "unblocked you") }}
{{ utils.display_actor(notif.actor, actors_metadata) }}
{% elif notif.notification_type.value == "block" %}
{{ notif_actor_action(notif, "was blocked") }}
{{ utils.display_actor(notif.actor, actors_metadata) }}
{% elif notif.notification_type.value == "unblock" %}
{{ notif_actor_action(notif, "was unblocked") }}
{{ utils.display_actor(notif.actor, actors_metadata) }}
{%- elif notif.notification_type.value == "move" %}
{# for move notif, the actor is the target and the inbox object the Move activity #}
<div class="row">
<div class="admin-page admin-notifications col-md-8 col-md-offset-2">
<h2>Notifications</h2>
<div id="notifications">
{%- for notif in notifications %}
<div class="notification">
{%- if notif.notification_type.value == "new_follower" %}
{{ notif_actor_action(notif, "followed you") }}
{{ utils.display_actor(notif.actor, actors_metadata) }}
{%- elif notif.notification_type.value == "pending_incoming_follower" %}
{{ notif_actor_action(notif, "sent a follow request") }}
{{ utils.display_actor(notif.actor, actors_metadata, pending_incoming_follow_notif=notif) }}
{% elif notif.notification_type.value == "rejected_follower" %}
{% elif notif.notification_type.value == "unfollow" %}
{{ notif_actor_action(notif, "unfollowed you") }}
{{ utils.display_actor(notif.actor, actors_metadata) }}
{%- elif notif.notification_type.value == "follow_request_accepted" %}
{{ notif_actor_action(notif, "accepted your follow request") }}
{{ utils.display_actor(notif.actor, actors_metadata) }}
{%- elif notif.notification_type.value == "follow_request_rejected" %}
{{ notif_actor_action(notif, "rejected your follow request") }}
{{ utils.display_actor(notif.actor, actors_metadata) }}
{% elif notif.notification_type.value == "blocked" %}
{{ notif_actor_action(notif, "blocked you") }}
{{ utils.display_actor(notif.actor, actors_metadata) }}
{% elif notif.notification_type.value == "unblocked" %}
{{ notif_actor_action(notif, "unblocked you") }}
{{ utils.display_actor(notif.actor, actors_metadata) }}
{% elif notif.notification_type.value == "block" %}
{{ notif_actor_action(notif, "was blocked") }}
{{ utils.display_actor(notif.actor, actors_metadata) }}
{% elif notif.notification_type.value == "unblock" %}
{{ notif_actor_action(notif, "was unblocked") }}
{{ utils.display_actor(notif.actor, actors_metadata) }}
{%- elif notif.notification_type.value == "move" %}
{# for move notif, the actor is the target and the inbox object the Move activity #}
<div class="actor-action">
<a href="{{ url_for("admin_profile") }}?actor_id={{ notif.inbox_object.actor.ap_id }}">
{{ utils.display_tiny_actor_icon(notif.inbox_object.actor) }} {{ notif.inbox_object.actor.display_name | clean_html(notif.inbox_object.actor) | safe }}</a> has moved to
<span title="{{ notif.created_at.isoformat() }}">{{ notif.created_at | timeago }}</span>
</div>
{{ utils.display_actor(notif.actor) }}
{% elif notif.notification_type.value == "like" %}
{{ notif_actor_action(notif, "liked a post", with_icon=True) }}
{{ utils.display_object(notif.outbox_object) }}
{% elif notif.notification_type.value == "undo_like" %}
{{ notif_actor_action(notif, "unliked a post", with_icon=True) }}
{{ utils.display_object(notif.outbox_object) }}
{% elif notif.notification_type.value == "announce" %}
{{ notif_actor_action(notif, "shared a post", with_icon=True) }}
{{ utils.display_object(notif.outbox_object) }}
{% elif notif.notification_type.value == "undo_announce" %}
{{ notif_actor_action(notif, "unshared a post", with_icon=True) }}
{{ utils.display_object(notif.outbox_object) }}
{% elif notif.notification_type.value == "mention" %}
{{ notif_actor_action(notif, "mentioned you") }}
{{ utils.display_object(notif.inbox_object) }}
{% elif notif.notification_type.value == "new_webmention" %}
<div class="actor-action" title="{{ notif.created_at.isoformat() }}">
new webmention from
{% set facepile_item = notif.webmention.as_facepile_item %}
{% if facepile_item %}
<a href="{{ facepile_item.actor_url }}">{{ facepile_item.actor_name }}</a>
{% endif %}
<a class="bold" href="{{ notif.webmention.source }}">{{ notif.webmention.source }}</a>
</div>
{{ utils.display_object(notif.outbox_object) }}
{% elif notif.notification_type.value == "updated_webmention" %}
<div class="actor-action" title="{{ notif.created_at.isoformat() }}">
updated webmention from
{% set facepile_item = notif.webmention.as_facepile_item %}
{% if facepile_item %}
<a href="{{ facepile_item.actor_url }}">{{ facepile_item.actor_name }}</a>
{% endif %}
<a class="bold" href="{{ notif.webmention.source }}">{{ notif.webmention.source }}</a>
</div>
{{ utils.display_object(notif.outbox_object) }}
{% elif notif.notification_type.value == "deleted_webmention" %}
<div class="actor-action" title="{{ notif.created_at.isoformat() }}">
deleted webmention from
{% set facepile_item = notif.webmention.as_facepile_item %}
{% if facepile_item %}
<a href="{{ facepile_item.actor_url }}">{{ facepile_item.actor_name }}</a>
{% endif %}
<a class="bold" href="{{ notif.webmention.source }}">{{ notif.webmention.source }}</a>
</div>
{{ utils.display_object(notif.outbox_object) }}
{% else %}
<div class="actor-action">
<a href="{{ url_for("admin_profile") }}?actor_id={{ notif.inbox_object.actor.ap_id }}">
{{ utils.display_tiny_actor_icon(notif.inbox_object.actor) }} {{ notif.inbox_object.actor.display_name | clean_html(notif.inbox_object.actor) | safe }}</a> has moved to
<span title="{{ notif.created_at.isoformat() }}">{{ notif.created_at | timeago }}</span>
Implement {{ notif.notification_type }}
</div>
{{ utils.display_actor(notif.actor) }}
{% elif notif.notification_type.value == "like" %}
{{ notif_actor_action(notif, "liked a post", with_icon=True) }}
{{ utils.display_object(notif.outbox_object) }}
{% elif notif.notification_type.value == "undo_like" %}
{{ notif_actor_action(notif, "unliked a post", with_icon=True) }}
{{ utils.display_object(notif.outbox_object) }}
{% elif notif.notification_type.value == "announce" %}
{{ notif_actor_action(notif, "shared a post", with_icon=True) }}
{{ utils.display_object(notif.outbox_object) }}
{% elif notif.notification_type.value == "undo_announce" %}
{{ notif_actor_action(notif, "unshared a post", with_icon=True) }}
{{ utils.display_object(notif.outbox_object) }}
{% elif notif.notification_type.value == "mention" %}
{{ notif_actor_action(notif, "mentioned you") }}
{{ utils.display_object(notif.inbox_object) }}
{% elif notif.notification_type.value == "new_webmention" %}
<div class="actor-action" title="{{ notif.created_at.isoformat() }}">
new webmention from
{% set facepile_item = notif.webmention.as_facepile_item %}
{% if facepile_item %}
<a href="{{ facepile_item.actor_url }}">{{ facepile_item.actor_name }}</a>
{% endif %}
<a class="bold" href="{{ notif.webmention.source }}">{{ notif.webmention.source }}</a>
</div>
{{ utils.display_object(notif.outbox_object) }}
{% elif notif.notification_type.value == "updated_webmention" %}
<div class="actor-action" title="{{ notif.created_at.isoformat() }}">
updated webmention from
{% set facepile_item = notif.webmention.as_facepile_item %}
{% if facepile_item %}
<a href="{{ facepile_item.actor_url }}">{{ facepile_item.actor_name }}</a>
{% endif %}
<a class="bold" href="{{ notif.webmention.source }}">{{ notif.webmention.source }}</a>
</div>
{{ utils.display_object(notif.outbox_object) }}
{% elif notif.notification_type.value == "deleted_webmention" %}
<div class="actor-action" title="{{ notif.created_at.isoformat() }}">
deleted webmention from
{% set facepile_item = notif.webmention.as_facepile_item %}
{% if facepile_item %}
<a href="{{ facepile_item.actor_url }}">{{ facepile_item.actor_name }}</a>
{% endif %}
<a class="bold" href="{{ notif.webmention.source }}">{{ notif.webmention.source }}</a>
</div>
{{ utils.display_object(notif.outbox_object) }}
{% else %}
<div class="actor-action">
Implement {{ notif.notification_type }}
</div>
{%- endif %}
{%- endif %}
</div>
{%- endfor %}
</div>
{%- endfor %}
</div>
{% if next_cursor %}
<p class="text-center">
<a href="{{ request.url._path }}?cursor={{ next_cursor }}" class="btn btn-lg btn-primary">
See more{% if more_unread_count %} ({{ more_unread_count }} unread left){% endif %}
</a>
</p>
{% endif %}
{% if next_cursor %}
<p class="text-center">
<a href="{{ request.url._path }}?cursor={{ next_cursor }}" class="btn btn-lg btn-primary">
See more{% if more_unread_count %} ({{ more_unread_count }} unread left){% endif %}
</a>
</p>
{% endif %}
</div>
</div>
{% endblock %}

Wyświetl plik

@ -28,5 +28,4 @@
{% include "sidebar.html" %}
</div>
</div>
{% endblock %}

Wyświetl plik

@ -1,29 +1,29 @@
{%- import "utils.html" as utils with context -%}
{% extends "layout.html" %}
{%- import "utils.html" as utils with context -%}
{% extends "layout.html" %}
{% block head %}
<title>Interact from your instance</title>
<meta name="robots" content="noindex, nofollow">
{% endblock %}
{% block head %}
<title>Interact from your instance</title>
<meta name="robots" content="noindex, nofollow">
{% endblock %}
{% block content %}
{% include "header.html" %}
{% block content %}
{% include "header.html" %}
<div class="row">
<div class="col-sm-8">
<h2>Interact from your instance</h2>
<div class="row">
<div class="col-sm-8">
<h2>Interact from your instance</h2>
<form class="form-inline" action="{{ url_for("post_remote_interaction") }}" method="POST">
{{ utils.embed_csrf_token() }}
<input type="text" name="profile" placeholder="you@instance.tld" class="form-control" autofocus>
<input type="hidden" name="ap_id" value="{{ outbox_object.ap_id }}">
<input type="submit" value="Interact" class="btn btn-success" />
</form>
<form class="form-inline" action="{{ url_for("post_remote_interaction") }}" method="POST">
{{ utils.embed_csrf_token() }}
<input type="text" name="profile" placeholder="you@instance.tld" class="form-control" autofocus>
<input type="hidden" name="ap_id" value="{{ outbox_object.ap_id }}">
<input type="submit" value="Interact" class="btn btn-success" />
</form>
{{ utils.display_object(outbox_object) }}
</div>
<div class="col-sm-4">
{% include "sidebar.html" %}
</div>
{{ utils.display_object(outbox_object) }}
</div>
{% endblock %}
<div class="col-sm-4">
{% include "sidebar.html" %}
</div>
</div>
{% endblock %}