mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
115 lines
5.2 KiB
HTML
115 lines
5.2 KiB
HTML
{% if theme() and file_exists('app/templates/themes/' + theme() + '/base.html') %}
|
|
{% extends 'themes/' + theme() + '/base.html' %}
|
|
{% else %}
|
|
{% extends "base.html" %}
|
|
{% endif %} %}
|
|
{% from 'bootstrap/form.html' import render_form, render_field %}
|
|
|
|
{% block app_content %}
|
|
<div class="row">
|
|
<div class="col-12 col-md-8 position-relative main_pane">
|
|
{% block title %}<h1>{{ _('Edit post') }}</h1>{% endblock %}
|
|
<form method="post" enctype="multipart/form-data" role="form">
|
|
{{ form.csrf_token() }}
|
|
{% block post_type %}{% endblock %}
|
|
{{ render_field(form.title) }}
|
|
{% if post_type == POST_TYPE_LINK %}
|
|
{{ render_field(form.link_url) }}
|
|
{% elif post_type == POST_TYPE_IMAGE %}
|
|
{{ render_field(form.image_file) }}
|
|
{{ render_field(form.image_alt_text) }}
|
|
<small class="field_hint">{{ _('Describe the image, to help visually impaired people.') }}</small>
|
|
{% elif post_type == POST_TYPE_VIDEO %}
|
|
{{ render_field(form.video_url) }}
|
|
<p class="small field_hint">{{ _('Provide a URL ending with .mp4 or .webm.') }}</p>
|
|
{% endif %}
|
|
{{ render_field(form.body) }}
|
|
|
|
{% if not low_bandwidth %}
|
|
{% if markdown_editor %}
|
|
<script nonce="{{ session['nonce'] }}">
|
|
window.addEventListener("load", function () {
|
|
var downarea = new DownArea({
|
|
elem: document.querySelector('#body'),
|
|
resize: DownArea.RESIZE_VERTICAL,
|
|
hide: ['heading', 'bold-italic'],
|
|
value: {{ form.body.data | tojson | safe }},
|
|
});
|
|
setupAutoResize('body');
|
|
});
|
|
</script>
|
|
{% else %}
|
|
<a href="#" aria-hidden="true" class="markdown_editor_enabler create_post_markdown_editor_enabler" data-id="body">{{ _('Enable markdown editor') }}</a>
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
{% if post_type == POST_TYPE_POLL %}
|
|
<fieldset id="pollChoicesFieldset">
|
|
<legend>{{ _('Poll choices') }}</legend>
|
|
<div class="form-group">
|
|
{{ form.choice_1(class_="form-control", **{"placeholder": "First choice"}) }}
|
|
</div>
|
|
<div class="form-group">
|
|
{{ form.choice_2(class_="form-control", **{"placeholder": "Second choice"}) }}
|
|
</div>
|
|
<div class="form-group" style="{{ 'display: none;' if form.choice_3.data == none }}">
|
|
{{ form.choice_3(class_="form-control") }}
|
|
</div>
|
|
<div class="form-group" style="display: none;">
|
|
{{ form.choice_4(class_="form-control") }}
|
|
</div>
|
|
<div class="form-group" style="display: none;">
|
|
{{ form.choice_5(class_="form-control") }}
|
|
</div>
|
|
<div class="form-group" style="display: none;">
|
|
{{ form.choice_6(class_="form-control") }}
|
|
</div>
|
|
<div class="form-group" style="display: none;">
|
|
{{ form.choice_7(class_="form-control") }}
|
|
</div>
|
|
<div class="form-group" style="display: none;">
|
|
{{ form.choice_8(class_="form-control") }}
|
|
</div>
|
|
<div class="form-group" style="display: none;">
|
|
{{ form.choice_9(class_="form-control") }}
|
|
</div>
|
|
<div class="form-group" style="display: none;">
|
|
{{ form.choice_10(class_="form-control") }}
|
|
</div>
|
|
<button id="addPollChoice" type="button" class="btn btn-primary">{{ _('Add choice') }}</button>
|
|
</fieldset>
|
|
{{ render_field(form.mode) }}
|
|
{% if form.finish_in %}{{ render_field(form.finish_in) }}{% endif %}
|
|
{{ render_field(form.local_only) }}
|
|
{% endif %}
|
|
|
|
{{ render_field(form.tags) }}
|
|
<small class="field_hint">{{ _('Separate each tag with a comma.') }}</small>
|
|
|
|
<div class="row mt-4">
|
|
<div class="col-md-3">
|
|
{{ render_field(form.notify_author) }}
|
|
</div>
|
|
<div class="col-md-1">
|
|
{{ render_field(form.sticky) }}
|
|
</div>
|
|
<div class="col-md-1">
|
|
{{ render_field(form.nsfw) }}
|
|
</div>
|
|
<div class="col-md-1">
|
|
{{ render_field(form.nsfl) }}
|
|
</div>
|
|
|
|
<div class="col post_language_chooser">
|
|
{{ render_field(form.language_id) }}
|
|
</div>
|
|
</div>
|
|
|
|
{{ render_field(form.submit) }}
|
|
</form>
|
|
</div>
|
|
|
|
{% include "_side_pane.html" %}
|
|
|
|
</div>
|
|
{% endblock %}
|