mirror of https://gitlab.com/brutaldon/brutaldon
Merge pull request #71 from cyisfor/preview_sensitive
Preview sensitive media
This commit is contained in:
commit
a536c35dfd
|
@ -50,6 +50,11 @@ class Preference(models.Model):
|
||||||
timezone = models.CharField(
|
timezone = models.CharField(
|
||||||
max_length=80, blank=True, null=True, choices=timezones, default="UTC"
|
max_length=80, blank=True, null=True, choices=timezones, default="UTC"
|
||||||
)
|
)
|
||||||
|
preview_sensitive = models.BooleanField(
|
||||||
|
default=False,
|
||||||
|
help_text=_(
|
||||||
|
'Show preview for media marked as "sensitive"'))
|
||||||
|
|
||||||
no_javascript = models.BooleanField(
|
no_javascript = models.BooleanField(
|
||||||
default=False,
|
default=False,
|
||||||
help_text=_(
|
help_text=_(
|
||||||
|
|
|
@ -101,7 +101,7 @@
|
||||||
<figure class="column attachment-image">
|
<figure class="column attachment-image">
|
||||||
<a href="{{ media.url }}">
|
<a href="{{ media.url }}">
|
||||||
<noscript class="loading-lazy">
|
<noscript class="loading-lazy">
|
||||||
{% if toot.sensitive %}
|
{% if toot.sensitive and not preferences.preview_sensitive %}
|
||||||
<img loading="lazy" src="{% static "images/sensitive.png" %}"
|
<img loading="lazy" src="{% static "images/sensitive.png" %}"
|
||||||
{% else %}
|
{% else %}
|
||||||
<img loading="lazy" src="{{ media.preview_url }}"
|
<img loading="lazy" src="{{ media.preview_url }}"
|
||||||
|
@ -127,7 +127,7 @@
|
||||||
<source src="{{ media.url }}" type="video/mp4">
|
<source src="{{ media.url }}" type="video/mp4">
|
||||||
<a href="{{ media.url }}">
|
<a href="{{ media.url }}">
|
||||||
<noscript class="loading-lazy">
|
<noscript class="loading-lazy">
|
||||||
{% if toot.sensitive %}
|
{% if toot.sensitive and not preferences.preview_sensitive %}
|
||||||
<img loading="lazy" src="{% static "images/sensitive.png" %}"
|
<img loading="lazy" src="{% static "images/sensitive.png" %}"
|
||||||
{% else %}
|
{% else %}
|
||||||
<img loading="lazy" src="{{ media.preview_url }}"
|
<img loading="lazy" src="{{ media.preview_url }}"
|
||||||
|
|
|
@ -30,6 +30,15 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<h2 class="subtitle">Options</h2>
|
||||||
|
<div class="columns">
|
||||||
|
<div class="column is-quarter">
|
||||||
|
<label class="label checkbox" for="id_preview_sensitive">
|
||||||
|
{% render_field form.preview_sensitive class+="checkbox" %}
|
||||||
|
{{ form.preview_sensitive.label }}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<h2 class="subtitle">Timeline Options</h2>
|
<h2 class="subtitle">Timeline Options</h2>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label class="label checkbox">
|
<label class="label checkbox">
|
||||||
|
|
Loading…
Reference in New Issue