Add open_details preference

Add a preference to open details by default.
This commit is contained in:
Cy 2020-05-31 00:51:15 +00:00
parent 39f13d64fd
commit 543a83cb81
No known key found for this signature in database
GPG Key ID: F66D599380F88521
3 changed files with 27 additions and 2 deletions

View File

@ -54,7 +54,10 @@ class Preference(models.Model):
default=False,
help_text=_(
'Show preview for media marked as "sensitive"'))
open_detail = models.BooleanField(
default=False,
help_text=_(
'Open details (posts with subjects) by default'))
no_javascript = models.BooleanField(
default=False,
help_text=_(

View File

@ -41,7 +41,11 @@
{% endif %}
</p>
{% if toot.spoiler_text %}
<details class="toot">
<details class="toot"
{% if preferences.open_detail %}
open=""
{% endif %}
>
<summary><strong>{{ toot.spoiler_text }} </strong></summary>
<div class="toot">
{{ toot.content | relink_toot | fix_emojos:toot.emojis | strip_html | safe }}

View File

@ -37,6 +37,24 @@
{% render_field form.preview_sensitive class+="checkbox" %}
{{ form.preview_sensitive.label }}
</label>
</div>
<div class="column is-quarter">
<p class="notification is-info preferences-help">
{{ form.preview_sensitive.help_text }}
</p>
</div>
</div>
<div class="columns">
<div class="column is-quarter">
<label class="label checkbox" for="id_open_details">
{% render_field form.open_detail class+="checkbox" %}
{{ form.open_detail.label }}
</label>
</div>
<div class="column is-quarter">
<p class="notification is-info preferences-help">
{{ form.open_detail.help_text }}
</p>
</div>
</div>
<h2 class="subtitle">Timeline Options</h2>