microblog.pub/app/templates/admin_new.html

95 lines
3.2 KiB
HTML
Raw Normal View History

2022-06-22 20:11:22 +02:00
{%- import "utils.html" as utils with context -%}
{% extends "layout.html" %}
2022-07-15 20:01:55 +02:00
{% block head %}
<title>{{ local_actor.display_name }} - New</title>
{% endblock %}
2022-06-22 20:11:22 +02:00
{% block content %}
2022-06-24 11:33:05 +02:00
{% if in_reply_to_object %}
2022-07-09 08:15:33 +02:00
<div class="actor-action">In reply to:</div>
2022-06-24 11:33:05 +02:00
{{ utils.display_object(in_reply_to_object) }}
{% endif %}
2022-07-09 08:15:33 +02:00
<div class="box">
2022-07-24 12:36:59 +02:00
<nav class="flexbox">
<ul>
2022-07-25 22:51:53 +02:00
{% for ap_type in ["Note", "Article", "Question"] %}
2022-07-24 12:36:59 +02:00
<li><a href="?type={{ ap_type }}" {% if request.query_params.get("type", "Note") == ap_type %}class="active"{% endif %}>
{{ ap_type }}
</a>
</li>
{% endfor %}
</ul>
</nav>
2022-08-30 08:51:02 +02:00
<form class="form admin-new" action="{{ request.url_for("admin_actions_new") }}" enctype="multipart/form-data" method="POST">
2022-06-22 20:11:22 +02:00
{{ utils.embed_csrf_token() }}
{{ utils.embed_redirect_url() }}
<p>
<select name="visibility">
{% for (k, v) in visibility_choices %}
2022-08-11 20:48:20 +02:00
<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>
2022-07-25 22:51:53 +02:00
{% if request.query_params.type == "Article" %}
<p>
2022-08-29 21:42:54 +02:00
<input type="text" class="width-95" name="name" placeholder="Title">
2022-07-25 22:51:53 +02:00
</p>
{% endif %}
2022-06-27 20:55:44 +02:00
{% for emoji in emojis %}
2022-07-01 19:35:34 +02:00
<span class="ji">{{ emoji | emojify(True) | safe }}</span>
2022-06-27 20:55:44 +02:00
{% endfor %}
{% for emoji in custom_emojis %}
<span class="ji"><img src="{{ emoji.icon.url }}" alt="{{ emoji.name }}" title="{{ emoji.name }}" class="custom-emoji"></span>
{% endfor %}
2022-08-29 21:42:54 +02:00
<textarea name="content" rows="10" cols="50" autofocus="autofocus" designMode="on" placeholder="Hey!">{{ content }}</textarea>
2022-07-24 12:36:59 +02:00
{% if request.query_params.type == "Question" %}
<p>
<select name="poll_type">
<option value="oneOf">single choice</option>
<option value="anyOf">multiple choices</option>
</select>
</p>
<p>
<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>
{% for i in ["1", "2", "3", "4"] %}
<p>
2022-08-29 21:42:54 +02:00
<input type="text" name="poll_answer_{{ i }}" class="width-95" placeholder="Option {{ i }}, leave empty to disable">
2022-07-24 12:36:59 +02:00
</p>
{% endfor %}
{% endif %}
2022-06-28 21:10:22 +02:00
<p>
2022-08-29 21:42:54 +02:00
<input type="text" name="content_warning" placeholder="content warning (will mark the post as sensitive)"{% if content_warning %} value="{{ content_warning }}"{% endif %} class="width-95">
2022-06-28 21:10:22 +02:00
</p>
<p>
2022-07-03 22:01:47 +02:00
<input type="checkbox" name="is_sensitive" id="is_sensitive"> <label for="is_sensitive">Mark attachment(s) as sensitive</label>
2022-06-28 21:10:22 +02:00
</p>
2022-06-24 11:33:05 +02:00
<input type="hidden" name="in_reply_to" value="{{ request.query_params.in_reply_to }}">
2022-06-26 11:09:43 +02:00
<p>
2022-08-29 21:42:54 +02:00
<input id="files" name="files" type="file" class="width-95" multiple>
2022-06-26 11:09:43 +02:00
</p>
2022-07-21 22:43:06 +02:00
<div id="alts"></div>
2022-06-26 11:09:43 +02:00
<p>
<input type="submit" value="Publish">
</p>
2022-06-22 20:11:22 +02:00
</form>
2022-07-09 08:15:33 +02:00
</div>
<script src="{{ BASE_URL }}/static/new.js?v={{ JS_HASH }}"></script>
2022-06-22 20:11:22 +02:00
{% endblock %}