microblog.pub/templates/following.html
2019-07-22 20:32:35 +02:00

62 lines
2.1 KiB
HTML

{% extends "layout.html" %}
{% import 'utils.html' as utils %}
{% block title %}Following - {{ config.NAME }}{% endblock %}
{% block header %}
{% endblock %}
{% block content %}
<div id="container">
{% include "header.html" %}
<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;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 }}"/>
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
<button type="submit" class="bar-item">unfollow</button>
</form>
<form action="/api/add_to_list" class="action-form" method="post">
<input type="hidden" name="redirect" value="{{ request.path }}"/>
<input type="hidden" name="actor_id" value="{{ follow.id }}"/>
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
<select name="list_name" style="float:left;">
<option></option>
{% for l in lists %}
{% if follow.id not in l.members %}
<option value="{{l.name}}">{{l.name}}</option>
{% endif %}
{% endfor %}
</select>
<button type="submit" class="bar-item">add to list</button>
</form>
{% for l in lists %}
{% if follow.id in l.members %}
<form action="/api/remove_from_list" class="action-form" method="post">
<input type="hidden" name="redirect" value="{{ request.path }}"/>
<input type="hidden" name="actor_id" value="{{ follow.id }}"/>
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
<button type="submit" class="bar-item">remove from {{ l.name }}</button>
</form>
{% endif %}
{% endfor %}
</div>
{% endif %}
<div style="height: 100px;">
{{ utils.display_actor_inline(follow, size=80) }}
</div>
{% endfor %}
{{ utils.display_pagination(older_than, newer_than) }}
</div>
</div>
{% endblock %}
{% block links %}
<link rel="alternate" href="{{ config.BASE_URL }}/following" type="application/activity+json">
{{ utils.display_pagination_links(older_than, newer_than) }}{% endblock %}