mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-08 22:17:34 +01:00
Clean up various things
This commit is contained in:
parent
c7b215fcca
commit
a29345bd10
@ -135,8 +135,7 @@ from .utils import clear_notifications, is_safe_url, create_session
|
|||||||
|
|
||||||
@app.before_request
|
@app.before_request
|
||||||
def check_for_notifications():
|
def check_for_notifications():
|
||||||
if current_user.is_authenticated:
|
clear_notifications(request.path)
|
||||||
clear_notifications(request.path)
|
|
||||||
|
|
||||||
|
|
||||||
@app.errorhandler(404)
|
@app.errorhandler(404)
|
||||||
|
@ -98,9 +98,8 @@ def make_thumbnail(img, level):
|
|||||||
mkdir(output_dir)
|
mkdir(output_dir)
|
||||||
|
|
||||||
cache_filepath = os.path.join(output_dir, img)
|
cache_filepath = os.path.join(output_dir, img)
|
||||||
source_filepath = find_source_file(img)
|
|
||||||
|
|
||||||
if not os.path.isfile(cache_filepath):
|
if not os.path.isfile(cache_filepath):
|
||||||
|
source_filepath = find_source_file(img)
|
||||||
resize_and_crop(source_filepath, cache_filepath, (w, h))
|
resize_and_crop(source_filepath, cache_filepath, (w, h))
|
||||||
|
|
||||||
res = send_file(cache_filepath)
|
res = send_file(cache_filepath)
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
<a href="{{ package.get_url('packages.view') }}" class="btn btn-sm btn-secondary me-1">
|
<a href="{{ package.get_url('packages.view') }}" class="btn btn-sm btn-secondary me-1">
|
||||||
{{ _("View package") }}
|
{{ _("View package") }}
|
||||||
</a>
|
</a>
|
||||||
<a href="{{ package.donate_url_actual }}" class="btn btn-sm btn-primary" rel="nofollow">
|
<a href="{{ package.donate_url_actual }}" class="btn btn-sm btn-primary" rel="ugc">
|
||||||
<i class="fas fa-heart me-1"></i>
|
<i class="fas fa-heart me-1"></i>
|
||||||
{{ _("Donate") }}
|
{{ _("Donate") }}
|
||||||
</a>
|
</a>
|
||||||
|
@ -150,8 +150,7 @@
|
|||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% for warning in package.content_warnings %}
|
{% for warning in package.content_warnings %}
|
||||||
<a class="badge bg-warning" rel="nofollow" href="/help/content_flags/"
|
<a class="badge bg-warning" href="/help/content_flags/" title="{{ warning.description }}">
|
||||||
title="{{ warning.description }}">
|
|
||||||
<i class="fas fa-exclamation-circle" style="margin-right: 0.3em;"></i>
|
<i class="fas fa-exclamation-circle" style="margin-right: 0.3em;"></i>
|
||||||
{{ warning.title }}
|
{{ warning.title }}
|
||||||
</a>
|
</a>
|
||||||
@ -425,7 +424,7 @@
|
|||||||
{% if package.donate_url_actual %}
|
{% if package.donate_url_actual %}
|
||||||
<div class="alert alert-secondary mb-4">
|
<div class="alert alert-secondary mb-4">
|
||||||
<p>{{ _("Like this package? Help support its development by making a donation", display_name=package.author.display_name) }}</p>
|
<p>{{ _("Like this package? Help support its development by making a donation", display_name=package.author.display_name) }}</p>
|
||||||
<a class="btn d-block btn-primary" href="{{ package.donate_url_actual }}" rel="nofollow">
|
<a class="btn d-block btn-primary" href="{{ package.donate_url_actual }}" rel="ugc">
|
||||||
<i class="fas fa-heart me-2"></i>
|
<i class="fas fa-heart me-2"></i>
|
||||||
{{ _("Donate now") }}
|
{{ _("Donate now") }}
|
||||||
</a>
|
</a>
|
||||||
|
@ -89,7 +89,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if user.website_url %}
|
{% if user.website_url %}
|
||||||
<a class="btn" href="{{ user.website_url }}" rel="nofollow">
|
<a class="btn" href="{{ user.website_url }}" rel="ugc">
|
||||||
<i class="fas fa-globe-europe"></i>
|
<i class="fas fa-globe-europe"></i>
|
||||||
<span class="count">
|
<span class="count">
|
||||||
{{ _("Website") }}
|
{{ _("Website") }}
|
||||||
@ -98,7 +98,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if user.donate_url %}
|
{% if user.donate_url %}
|
||||||
<a class="btn" href="{{ user.donate_url }}" rel="nofollow">
|
<a class="btn" href="{{ user.donate_url }}" rel="ugc">
|
||||||
<i class="fas fa-donate"></i>
|
<i class="fas fa-donate"></i>
|
||||||
<span class="count">
|
<span class="count">
|
||||||
{{ _("Donate") }}
|
{{ _("Donate") }}
|
||||||
|
Loading…
Reference in New Issue
Block a user