Compare commits
4 Commits
cc63a6f0d8
...
9afe69316e
Author | SHA1 | Date |
---|---|---|
Jason McBrayer | 9afe69316e | |
Jason McBrayer | a45dbc13a0 | |
Jason McBrayer | 81a7356988 | |
Jason McBrayer | 5034f706f8 |
3
Pipfile
3
Pipfile
|
@ -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 = "*"}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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" >
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue