mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 11:26:56 -08:00
persist post reply fieldset state
This commit is contained in:
parent
92dffa8535
commit
5a6a013afd
4 changed files with 10 additions and 8 deletions
|
@ -18,6 +18,7 @@
|
|||
if (!options.animation) {
|
||||
fieldset.dispatchEvent(new Event('update'));
|
||||
}
|
||||
setCookie(`fieldset_${fieldset.id}_state`, 'collapsed', 365);
|
||||
}
|
||||
|
||||
function showFieldsetContent(fieldset, options) {
|
||||
|
@ -39,6 +40,7 @@
|
|||
if (!options.animation) {
|
||||
fieldset.dispatchEvent(new Event('update'));
|
||||
}
|
||||
setCookie(`fieldset_${fieldset.id}_state`, 'expanded', 365);
|
||||
}
|
||||
|
||||
function doToggle(fieldset, setting) {
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
{% from 'bootstrap/form.html' import render_form %}
|
||||
|
||||
{% block app_content %}
|
||||
<script src="/static/js/coolfieldset.js?v=2"></script>
|
||||
<script src="/static/js/coolfieldset.js?v=3"></script>
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-8 position-relative add_reply main_pane">
|
||||
<fieldset class="coolfieldset mt-4"><legend class="w-auto">Original post</legend>
|
||||
<fieldset id="post_reply_op" class="coolfieldset {{ 'collapsed' if request.cookies.get('fieldset_post_reply_op_state', 'collapsed') == 'collapsed' }} mt-3"><legend class="w-auto">Original post</legend>
|
||||
<h3>{{ post.title }}</h3>
|
||||
{{ post.body_html | safe if post.body_html else '' }}
|
||||
</fieldset>
|
||||
<fieldset class="coolfieldset mt-4"><legend class="w-auto">Comment you are replying to</legend>
|
||||
<fieldset id="post_reply_comment" class="coolfieldset {{ 'collapsed' if request.cookies.get('fieldset_post_reply_comment_state', 'collapsed') == 'collapsed' }} mt-4 mb-4"><legend class="w-auto">Comment you are replying to</legend>
|
||||
{{ comment.body_html | safe}}
|
||||
</fieldset>
|
||||
<div class="position-relative">
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
{% from 'bootstrap/form.html' import render_form, render_field %}
|
||||
|
||||
{% block app_content %}
|
||||
<script src="/static/js/coolfieldset.js?v=2"></script>
|
||||
<script src="/static/js/coolfieldset.js?v=3"></script>
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-8 position-relative main_pane">
|
||||
{% block title %}<h1>{{ _('Edit post') }}</h1>{% endblock %}
|
||||
|
@ -116,7 +116,7 @@
|
|||
{{ render_field(form.tags) }}
|
||||
<small class="field_hint">{{ _('Separate each tag with a comma.') }}</small>
|
||||
|
||||
<fieldset id="post_more_options" class="mt-4 mb-4 coolfieldset {{ 'collapsed' if request.cookies.get('fieldset_post_more_options_state') == 'collapsed' }}">
|
||||
<fieldset id="post_more_options" class="mt-4 mb-4 coolfieldset {{ 'collapsed' if request.cookies.get('fieldset_post_more_options_state', 'collapsed') == 'collapsed' }}">
|
||||
<legend class="w-auto">{{ _('More options') }}</legend>
|
||||
{{ render_field(form.notify_author) }}
|
||||
{{ render_field(form.sticky) }}
|
||||
|
|
|
@ -6,15 +6,15 @@
|
|||
{% from 'bootstrap/form.html' import render_form %}
|
||||
|
||||
{% block app_content %}
|
||||
<script src="/static/js/coolfieldset.js?v=2"></script>
|
||||
<script src="/static/js/coolfieldset.js?v=3"></script>
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-8 position-relative add_reply main_pane">
|
||||
<fieldset class="coolfieldset mt-4"><legend class="w-auto">Original post</legend>
|
||||
<fieldset id="post_reply_op" class="coolfieldset {{ 'collapsed' if request.cookies.get('fieldset_post_reply_op_state', 'collapsed') == 'collapsed' }} mt-3"><legend class="w-auto">Original post</legend>
|
||||
<h3>{{ post.title }}</h3>
|
||||
{{ post.body_html|safe if post.body_html }}
|
||||
</fieldset>
|
||||
{% if comment %}
|
||||
<fieldset class="coolfieldset mt-4"><legend class="w-auto">Comment you are replying to</legend>
|
||||
<fieldset id="post_reply_comment" class="coolfieldset {{ 'collapsed' if request.cookies.get('fieldset_post_reply_comment_state', 'collapsed') == 'collapsed' }} mt-4 mb-4"><legend class="w-auto">Comment you are replying to</legend>
|
||||
{{ comment.body_html|safe }}
|
||||
</fieldset>
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in a new issue