Compare commits

...

4 Commits

Author SHA1 Message Date
Jason McBrayer 9afe69316e Allow height and width in attribute filtering
Needed so the fix_emojos filter can add the width and height
2023-10-29 14:34:45 -04:00
Jason McBrayer a45dbc13a0 Template changes to better support non-CSS graphical browsers
Currently, I'm testing this in Dillo, but I want to have it working in
Netscape 3 on Mac System 7.
2023-10-29 13:55:21 -04:00
Jason McBrayer 81a7356988 Support and prefer Django 4.1.x.
Backwards compatibility for 3.2 LTS is provided for now, but you'll
have to change the pipfile if you insist on it.
2023-10-29 13:08:47 -04:00
Jason McBrayer 5034f706f8 Fullbrutalism font size tweak 2023-10-29 11:19:43 -04:00
16 changed files with 48 additions and 23 deletions

View File

@ -21,9 +21,10 @@ requests = "*"
six = "*"
"urllib3" = "*"
webencodings = "*"
Django = "~=3.2"
Django = "~=4.2"
django-html_sanitizer = "*"
inscriptis = "*"
lxml = "*"
[dev-packages]
python-lsp-server = {extras = ["pyflakes", "rope", "yapf"], version = "*"}

View File

@ -12,6 +12,14 @@ https://docs.djangoproject.com/en/2.0/ref/settings/
import os
# Work around issue in sanitizer
import django
try:
from django.utils.encoding import smart_text
except:
from django.utils.encoding import smart_str
django.utils.encoding.smart_text = smart_str
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@ -187,7 +195,7 @@ SANITIZER_ALLOWED_TAGS = [
"span",
"u",
]
SANITIZER_ALLOWED_ATTRIBUTES = ["href", "src", "title", "alt", "class", "lang"]
SANITIZER_ALLOWED_ATTRIBUTES = ["href", "src", "title", "alt", "class", "lang", "width", "height"]
# File upload settings.
# Important: media will not work if you change this.

View File

@ -16,7 +16,7 @@ html, body, body div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquot
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font-size: 1.1rem;
font-weight: normal;
vertical-align: baseline;
background: transparent;

View File

@ -2,7 +2,8 @@
<figure class="media-left">
<p class="image is-64x64">
<img src="{{ account.user.avatar_static }}"
alt="{{ account.user.acct }}">
alt="{{ account.user.acct }}"
height="64" width="64">
</p>
</figure>
<div class="media-content">

View File

@ -82,9 +82,13 @@
{% if own_acct %}
<img src="{{ own_acct.avatar_static }}"
class="image is-32x32 avatar"
height="32" width="32"
alt="Brutaldon ('{{ own_acct.username }}')">
{% else %}
<img loading="lazy" src="{% static "images/brutaldon.png" %}"
<img loading="lazy"
height="32"
width="32"
src="{% static "images/brutaldon.png" %}"
class="image is-32x32" alt="Brutaldon">
{% endif %}
</a>

View File

@ -15,7 +15,8 @@
<figure class="media-left">
<p class="image is-64x64">
<a href="{% url "user" user.acct %}">
<img src="{{ user.avatar }}"
<img src="{{ user.avatar }}"
height="64" width="64"
alt="">
</a>
</p>

View File

@ -17,7 +17,8 @@
<figure class="media-left">
<p class="image is-64x64">
<a href="{% url "user" user.acct %}">
<img src="{{ user.avatar }}"
<img src="{{ user.avatar }}"
height="64" width="64"
alt="">
</a>
</p>

View File

@ -15,7 +15,8 @@
<figure class="media-left">
<p class="image is-64x64">
<a href="{% url "user" user.acct %}">
<img src="{{ user.avatar }}"
<img src="{{ user.avatar }}"
height="64" width="64"
alt="">
</a>
</p>

View File

@ -83,7 +83,8 @@ mastodon.notifications()[0]
<article class="media">
<figure class="media-left">
<p class="image is-64x64">
<img src="{{ note.account.avatar_static }}" alt="">
<img src="{{ note.account.avatar_static }}" alt=""
height="64" width="64">
</p>
</figure>
<div class="media-content" >

View File

@ -30,7 +30,8 @@
<div class="field has-addons">
<div class="control level is-mobile">
<a href="{% url "user" own_acct.acct %}" class="image avatar is-48x48 level-item">
<img src="{{ own_acct.avatar_static }}" alt="[{{ own_acct.acct }}]">
<img src="{{ own_acct.avatar_static }}" alt="[{{ own_acct.acct }}]"
height="48" width="48">
</a>
<input type="submit" class="button is-primary level-item"
name="toot" value="Toot">

View File

@ -125,7 +125,8 @@
<div class="field has-addons">
<div class="control level is-mobile">
<a href="{% url "user" own_acct.acct %}" class="image avatar is-48x48 level-item" >
<img src="{{ own_acct.avatar_static }}" alt="[{{ own_acct.acct }}]">
<img src="{{ own_acct.avatar_static }}" alt="[{{ own_acct.acct }}]"
height="48" width="48">
</a>
<input type="submit" class="button is-primary level-item"
name="toot" value="Toot">

View File

@ -46,7 +46,8 @@ mastodon.search("<query>")
<p class="image is-64x64">
<a href="{% url "user" user.acct %}">
<img src="{{ user.avatar }}"
alt="">
alt=""
height="64" width="64">
</a>
</p>
</figure>

View File

@ -12,18 +12,20 @@
{% endif %}
<figure class="media-left">
<p class="image is-64x64 account-avatar">
<a href="{% url "user" toot.account.acct %}">
<img loading="auto" src="{{ toot.account.avatar_static }}"
alt="">
<div class="image is-64x64 account-avatar">
<a href="{% url "user" toot.account.acct %}">
<img loading="auto" src="{{ toot.account.avatar_static }}"
height="64" width="64" float="left"
alt="">
</a>
</p>
</div>
{% if reblog %}
<p class="image is-32x32 reblog-icon" >
<div class="image is-32x32 reblog-icon">
<a href="{% url "user" reblog_by %}">
<img loading="auto" src ="{{ reblog_icon }}" alt="">
<img loading="auto" src ="{{ reblog_icon }}" alt=""
height="32" width="32">
</a>
</p>
</div>
{% endif %}
</figure>
<div class="media-content">

View File

@ -21,7 +21,8 @@ Brutaldon ({{ own_acct.username }}) - {{ user.acct }} timelime
</a>
</div>
<figure class="image is-96x96 card-header-icon">
<img src="{{ user.avatar }}" alt="Avatar">
<img src="{{ user.avatar }}" alt="Avatar"
height="96" width="96">
{% if user.locked %}
<span class="fa fa-lock account-locked">
<span class="is-hidden">Private</span>

View File

@ -2,7 +2,8 @@
<figure class="media-left">
<p class="image is-64x64">
<img src="{{ request.avatar_static }}"
alt="{{ request.acct }}">
alt="{{ request.acct }}"
height="64" width="64">
</p>
</figure>
<div class="media-content">

View File

@ -86,7 +86,7 @@ def fix_emojos(value, emojos):
try:
value = value.replace(
":%(shortcode)s:" % emojo,
'<img src="%(url)s" title=":%(shortcode)s:" alt=":%(shortcode)s:" class="emoji">'
'<img src="%(url)s" title=":%(shortcode)s:" alt=":%(shortcode)s:" class="emoji" height="24" width="24">'
% emojo,
)
except: