update linter
This commit is contained in:
parent
926756a701
commit
efe6536423
10 changed files with 59 additions and 70 deletions
|
@ -25,7 +25,7 @@ repos:
|
||||||
- id: mixed-line-ending
|
- id: mixed-line-ending
|
||||||
|
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
rev: v0.7.1
|
rev: v0.8.4
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
# - id: ruff-format
|
# - id: ruff-format
|
||||||
|
@ -42,7 +42,7 @@ repos:
|
||||||
- id: black
|
- id: black
|
||||||
|
|
||||||
- repo: https://github.com/Riverside-Healthcare/djLint
|
- repo: https://github.com/Riverside-Healthcare/djLint
|
||||||
rev: v1.35.2
|
rev: v1.36.4
|
||||||
hooks:
|
hooks:
|
||||||
- id: djlint-reformat-django
|
- id: djlint-reformat-django
|
||||||
- id: djlint-django
|
- id: djlint-django
|
||||||
|
|
|
@ -132,7 +132,8 @@ class Bangumi(AbstractSite):
|
||||||
if o.get("name_cn"):
|
if o.get("name_cn"):
|
||||||
titles[o.get("name_cn")] = "zh-cn"
|
titles[o.get("name_cn")] = "zh-cn"
|
||||||
localized_title = [
|
localized_title = [
|
||||||
{"lang": l or detect_language(t), "text": t} for t, l in titles.items()
|
{"lang": lang or detect_language(t), "text": t}
|
||||||
|
for t, lang in titles.items()
|
||||||
]
|
]
|
||||||
localized_desc = (
|
localized_desc = (
|
||||||
[{"lang": detect_language(brief), "text": brief}] if brief else []
|
[{"lang": detect_language(brief), "text": brief}] if brief else []
|
||||||
|
|
|
@ -41,14 +41,10 @@
|
||||||
{% if not gallery.items %}style="display:none;"{% endif %}>
|
{% if not gallery.items %}style="display:none;"{% endif %}>
|
||||||
<span class="action">
|
<span class="action">
|
||||||
<span>
|
<span>
|
||||||
<a _="on click set el to the next
|
<a _="on click set el to the next <ul/> then call el.scrollBy({left:-el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-left"></i></a>
|
||||||
<ul/>
|
|
||||||
then call el.scrollBy({left:-el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-left"></i></a>
|
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
<a _="on click set el to the next
|
<a _="on click set el to the next <ul/> then call el.scrollBy({left:el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-right"></i></a>
|
||||||
<ul/>
|
|
||||||
then call el.scrollBy({left:el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-right"></i></a>
|
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<h5>{{ gallery.category.label }}</h5>
|
<h5>{{ gallery.category.label }}</h5>
|
||||||
|
@ -71,14 +67,10 @@
|
||||||
{% if not featured_collections %}style="display:none;"{% endif %}>
|
{% if not featured_collections %}style="display:none;"{% endif %}>
|
||||||
<span class="action">
|
<span class="action">
|
||||||
<span>
|
<span>
|
||||||
<a _="on click set el to the next
|
<a _="on click set el to the next <ul/> then call el.scrollBy({left:-el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-left"></i></a>
|
||||||
<ul/>
|
|
||||||
then call el.scrollBy({left:-el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-left"></i></a>
|
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
<a _="on click set el to the next
|
<a _="on click set el to the next <ul/> then call el.scrollBy({left:el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-right"></i></a>
|
||||||
<ul/>
|
|
||||||
then call el.scrollBy({left:el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-right"></i></a>
|
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<h5>{% trans "Collections" %}</h5>
|
<h5>{% trans "Collections" %}</h5>
|
||||||
|
|
|
@ -79,14 +79,10 @@
|
||||||
<section class="entity-sort shelf" id="sibling">
|
<section class="entity-sort shelf" id="sibling">
|
||||||
<span class="action">
|
<span class="action">
|
||||||
<span>
|
<span>
|
||||||
<a _="on click set el to the next
|
<a _="on click set el to the next <ul/> then call el.scrollBy({left:-el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-left"></i></a>
|
||||||
<ul/>
|
|
||||||
then call el.scrollBy({left:-el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-left"></i></a>
|
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
<a _="on click set el to the next
|
<a _="on click set el to the next <ul/> then call el.scrollBy({left:el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-right"></i></a>
|
||||||
<ul/>
|
|
||||||
then call el.scrollBy({left:el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-right"></i></a>
|
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<h5>{% trans 'other editions' %}</h5>
|
<h5>{% trans 'other editions' %}</h5>
|
||||||
|
|
|
@ -80,6 +80,7 @@
|
||||||
<summary aria-haspopup="listbox">
|
<summary aria-haspopup="listbox">
|
||||||
<span class="avatar">
|
<span class="avatar">
|
||||||
<img alt=""
|
<img alt=""
|
||||||
|
title="{% if request.user.is_authenticated %}{{ request.user.username }}{% else %}{% endif %}"
|
||||||
src="{% if request.user.is_authenticated %}{{ request.user.avatar }}{% else %}{{ user_icon }}{% endif %}" />
|
src="{% if request.user.is_authenticated %}{{ request.user.avatar }}{% else %}{{ user_icon }}{% endif %}" />
|
||||||
</span>
|
</span>
|
||||||
</summary>
|
</summary>
|
||||||
|
|
|
@ -46,17 +46,11 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span class="rating-editor {% if shelf_type == 'wishlist' %}hidden{% endif %}" _="on mousemove(currentTarget, offsetX) set current_value to Math.round((10 * offsetX) / currentTarget.offsetWidth) if current_value <=10 then set star_div to the
|
<span class="rating-editor {% if shelf_type == 'wishlist' %}hidden{% endif %}"
|
||||||
<div/>
|
{# djlint:off #}
|
||||||
in me set star_div.style.width to (current_value * 10) + '%' set @data-tooltip to current_value or '{% trans "not rated" %}' add .yellow to star_div end on click(currentTarget, offsetX) set current_value to Math.round((10 * offsetX) / currentTarget.offsetWidth) if current_value <=10 then set star_div to the
|
_="on mousemove(currentTarget, offsetX) set current_value to Math.round((10 * offsetX) / currentTarget.offsetWidth) if current_value <=10 then set star_div to the <div/> in me set star_div.style.width to (current_value * 10) + '%' set @data-tooltip to current_value or '{% trans "not rated" %}' add .yellow to star_div end on click(currentTarget, offsetX) set current_value to Math.round((10 * offsetX) / currentTarget.offsetWidth) if current_value <=10 then set star_div to the <div/> in me set star_input to the <input/> in me set star_div.style.width to (current_value * 10) + '%' set @data-tooltip to current_value or '{% trans "not rated" %}' set star_input.value to current_value end on mouseleave(currentTarget) set star_div to the <div/> in me set star_input to the <input/> in me set current_value to star_input.value set star_div.style.width to (current_value * 10) + '%' set @data-tooltip to current_value or '{% trans "not rated" %}' end"
|
||||||
<div/>
|
{# djlint:on #}
|
||||||
in me set star_input to the
|
id="rating_editor">
|
||||||
<input/>
|
|
||||||
in me set star_div.style.width to (current_value * 10) + '%' set @data-tooltip to current_value or '{% trans "not rated" %}' set star_input.value to current_value end on mouseleave(currentTarget) set star_div to the
|
|
||||||
<div/>
|
|
||||||
in me set star_input to the
|
|
||||||
<input/>
|
|
||||||
in me set current_value to star_input.value set star_div.style.width to (current_value * 10) + '%' set @data-tooltip to current_value or '{% trans "not rated" %}' end">
|
|
||||||
{{ mark.rating_grade|rating_star }}
|
{{ mark.rating_grade|rating_star }}
|
||||||
<input type="hidden"
|
<input type="hidden"
|
||||||
name="rating_grade"
|
name="rating_grade"
|
||||||
|
|
|
@ -41,14 +41,10 @@
|
||||||
<section class="entity-sort shelf" id="calendar_grid">
|
<section class="entity-sort shelf" id="calendar_grid">
|
||||||
<span class="action">
|
<span class="action">
|
||||||
<span>
|
<span>
|
||||||
<a _="on click set el to the next
|
<a _="on click set el to the next <ul/> then call el.scrollBy({left:-el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-left"></i></a>
|
||||||
<ul/>
|
|
||||||
then call el.scrollBy({left:-el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-left"></i></a>
|
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
<a _="on click set el to the next
|
<a _="on click set el to the next <ul/> then call el.scrollBy({left:el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-right"></i></a>
|
||||||
<ul/>
|
|
||||||
then call el.scrollBy({left:el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-right"></i></a>
|
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<h5>
|
<h5>
|
||||||
|
@ -78,14 +74,10 @@
|
||||||
{% if not shelf.count %}style="display:none;"{% endif %}>
|
{% if not shelf.count %}style="display:none;"{% endif %}>
|
||||||
<span class="action">
|
<span class="action">
|
||||||
<span>
|
<span>
|
||||||
<a _="on click set el to the next
|
<a _="on click set el to the next <ul/> then call el.scrollBy({left:-el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-left"></i></a>
|
||||||
<ul/>
|
|
||||||
then call el.scrollBy({left:-el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-left"></i></a>
|
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
<a _="on click set el to the next
|
<a _="on click set el to the next <ul/> then call el.scrollBy({left:el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-right"></i></a>
|
||||||
<ul/>
|
|
||||||
then call el.scrollBy({left:el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-right"></i></a>
|
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<h5>
|
<h5>
|
||||||
|
@ -117,14 +109,10 @@
|
||||||
{% if not collections_count %}style="display:none;"{% endif %}>
|
{% if not collections_count %}style="display:none;"{% endif %}>
|
||||||
<span class="action">
|
<span class="action">
|
||||||
<span>
|
<span>
|
||||||
<a _="on click set el to the next
|
<a _="on click set el to the next <ul/> then call el.scrollBy({left:-el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-left"></i></a>
|
||||||
<ul/>
|
|
||||||
then call el.scrollBy({left:-el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-left"></i></a>
|
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
<a _="on click set el to the next
|
<a _="on click set el to the next <ul/> then call el.scrollBy({left:el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-right"></i></a>
|
||||||
<ul/>
|
|
||||||
then call el.scrollBy({left:el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-right"></i></a>
|
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<h5>
|
<h5>
|
||||||
|
@ -157,14 +145,10 @@
|
||||||
{% if not liked_collections_count %}style="display:none;"{% endif %}>
|
{% if not liked_collections_count %}style="display:none;"{% endif %}>
|
||||||
<span class="action">
|
<span class="action">
|
||||||
<span>
|
<span>
|
||||||
<a _="on click set el to the next
|
<a _="on click set el to the next <ul/> then call el.scrollBy({left:-el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-left"></i></a>
|
||||||
<ul/>
|
|
||||||
then call el.scrollBy({left:-el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-left"></i></a>
|
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
<a _="on click set el to the next
|
<a _="on click set el to the next <ul/> then call el.scrollBy({left:el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-right"></i></a>
|
||||||
<ul/>
|
|
||||||
then call el.scrollBy({left:el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-right"></i></a>
|
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<h5>
|
<h5>
|
||||||
|
|
|
@ -318,7 +318,9 @@
|
||||||
placeholder="Gargron@mastodon.social">
|
placeholder="Gargron@mastodon.social">
|
||||||
<small id="invalid-helper">{% trans "Once deleted, account data cannot be recovered." %}</small>
|
<small id="invalid-helper">{% trans "Once deleted, account data cannot be recovered." %}</small>
|
||||||
{% if import_status.douban_pending %}
|
{% if import_status.douban_pending %}
|
||||||
<input type="submit" value="{% trans "Importing in progress, can't delete now." %}" disabled />
|
<input type="submit"
|
||||||
|
value="{% trans "Importing in progress, can't delete now." %}"
|
||||||
|
disabled />
|
||||||
{% else %}
|
{% else %}
|
||||||
<input type="submit"
|
<input type="submit"
|
||||||
value="{% trans 'Permanently Delete' %}"
|
value="{% trans 'Permanently Delete' %}"
|
||||||
|
|
|
@ -52,15 +52,21 @@
|
||||||
{% elif allow_any_site %}
|
{% elif allow_any_site %}
|
||||||
<div role="group">
|
<div role="group">
|
||||||
{% if enable_email %}
|
{% if enable_email %}
|
||||||
<button class="platform outline" _="on click add .outline to .platform then remove .outline from me then hide
|
<button class="platform outline"
|
||||||
<form/>
|
{# djlint:off #}
|
||||||
then show #login-email" id="platform-email" title="{% trans "Email" %}">
|
_="on click add .outline to .platform then remove .outline from me then hide <form/> then show #login-email"
|
||||||
|
{# djlint:on #}
|
||||||
|
id="platform-email"
|
||||||
|
title="{% trans 'Email' %}">
|
||||||
<i class="fa-solid fa-envelope"></i>
|
<i class="fa-solid fa-envelope"></i>
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<button class="platform outline" _="on click add .outline to .platform then remove .outline from me then hide
|
<button class="platform outline"
|
||||||
<form/>
|
{# djlint:off #}
|
||||||
then show #login-mastodon" id="platform-mastodon" title="{% trans "Fediverse (Mastodon)" %}">
|
_="on click add .outline to .platform then remove .outline from me then hide <form/> then show #login-mastodon"
|
||||||
|
{# djlint:on #}
|
||||||
|
id="platform-mastodon"
|
||||||
|
title="{% trans "Fediverse (Mastodon)" %}">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg"
|
<svg xmlns="http://www.w3.org/2000/svg"
|
||||||
viewBox="64 163 873 873"
|
viewBox="64 163 873 873"
|
||||||
style="width: 1em;
|
style="width: 1em;
|
||||||
|
@ -71,16 +77,22 @@
|
||||||
<!--<i class="fa-brands fa-mastodon"></i>-->
|
<!--<i class="fa-brands fa-mastodon"></i>-->
|
||||||
</button>
|
</button>
|
||||||
{% if enable_threads %}
|
{% if enable_threads %}
|
||||||
<button class="platform outline" _="on click add .outline to .platform then remove .outline from me then hide
|
<button class="platform outline"
|
||||||
<form/>
|
{# djlint:off #}
|
||||||
then show #login-threads" id="platform-threads" title="{% trans "Threads" %}">
|
_="on click add .outline to .platform then remove .outline from me then hide <form/> then show #login-threads"
|
||||||
|
{# djlint:on #}
|
||||||
|
id="platform-threads"
|
||||||
|
title="{% trans 'Threads' %}">
|
||||||
<i class="fa-brands fa-threads"></i>
|
<i class="fa-brands fa-threads"></i>
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if enable_bluesky %}
|
{% if enable_bluesky %}
|
||||||
<button class="platform outline" _="on click add .outline to .platform then remove .outline from me then hide
|
<button class="platform outline"
|
||||||
<form/>
|
{# djlint:off #}
|
||||||
then show #login-bluesky" id="platform-bluesky" title="{% trans "Bluesky (ATProto)" %}">
|
_="on click add .outline to .platform then remove .outline from me then hide <form/> then show #login-bluesky"
|
||||||
|
{# djlint:on #}
|
||||||
|
id="platform-bluesky"
|
||||||
|
title="{% trans 'Bluesky (ATProto)' %}">
|
||||||
<i class="fa-brands fa-bluesky" style="font-size:85%"></i>
|
<i class="fa-brands fa-bluesky" style="font-size:85%"></i>
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -23,7 +23,14 @@
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<label>
|
<label>
|
||||||
{% blocktrans %}Your username on {{ site_name }}{% endblocktrans %}
|
{% blocktrans %}Your username on {{ site_name }}{% endblocktrans %}
|
||||||
<input name="username" placeholder="{% trans "2-30 alphabets, numbers or underscore, can't be changed once saved" %}" value="{{ form.username.value|default:request.user.username|default:'' }}" required _="on input remove [@aria-invalid] end" {% if request.user.username and not form.username.errors %}aria-invalid="false" readonly{% endif %} {% if form.username.errors %}aria-invalid="true"{% endif %} pattern="^[a-zA-Z0-9_]{2,30}$" />
|
<input name="username"
|
||||||
|
placeholder="{% trans "2-30 alphabets, numbers or underscore, can't be changed once saved" %}"
|
||||||
|
value="{{ form.username.value|default:request.user.username|default:'' }}"
|
||||||
|
required
|
||||||
|
_="on input remove [@aria-invalid] end"
|
||||||
|
{% if request.user.username and not form.username.errors %}aria-invalid="false" readonly{% endif %}
|
||||||
|
{% if form.username.errors %}aria-invalid="true"{% endif %}
|
||||||
|
pattern="^[a-zA-Z0-9_]{2,30}$" />
|
||||||
{% for error in form.username.errors %}<small>{{ error }}</small>{% endfor %}
|
{% for error in form.username.errors %}<small>{{ error }}</small>{% endfor %}
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
|
|
Loading…
Add table
Reference in a new issue