Add djhtml to pre-commit check (#382)

This commit is contained in:
TAKAHASHI Shuuji 2023-01-10 01:58:17 +09:00 committed by GitHub
parent 024d956e5e
commit 0c1e51322f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
38 changed files with 780 additions and 767 deletions

View File

@ -55,3 +55,10 @@ repos:
types-cachetools, types-cachetools,
types-python-dateutil, types-python-dateutil,
] ]
- repo: https://github.com/rtts/djhtml
rev: v1.5.2
hooks:
- id: djhtml
- id: djcss
- id: djjs

View File

@ -1,4 +1,5 @@
<script type="text/hyperscript"> <script type="text/hyperscript">
{# fmt:off #}
def imageviewer.show(source) def imageviewer.show(source)
set source_url to (<img /> in source) @data-original-url set source_url to (<img /> in source) @data-original-url
set source_alt to (<img /> in source) @alt set source_alt to (<img /> in source) @alt
@ -22,6 +23,7 @@
set <#image-viewer img /> @alt to '' set <#image-viewer img /> @alt to ''
set <#image-viewer figcaption />'s textContent to '' set <#image-viewer figcaption />'s textContent to ''
end end
{# fmt:on #}
</script> </script>
<figure id="image-viewer" _="on click imageviewer.close()"> <figure id="image-viewer" _="on click imageviewer.close()">
<picture> <picture>

View File

@ -1,6 +1,7 @@
{% with name_one=field_name_one|default:"name" name_two=field_name_two|default:"value" %} {% with name_one=field_name_one|default:"name" name_two=field_name_two|default:"value" %}
<script type="text/hyperscript"> <script type="text/hyperscript">
{# fmt:off #}
def {{ field.name }}.collect{{ field.name|title }}Fields() def {{ field.name }}.collect{{ field.name|title }}Fields()
set newdata to [] set newdata to []
for item in <div.{{ field.name }}-row/> for item in <div.{{ field.name }}-row/>
@ -24,12 +25,14 @@
add .{{ field.name }}-row to foo add .{{ field.name }}-row to foo
return foo return foo
end end
{# fmt:on #}
</script> </script>
{% include "forms/_field.html" %} {% include "forms/_field.html" %}
<div class="field multi-option"> <div class="field multi-option">
<section class="icon-menu"> <section class="icon-menu">
{# fmt:off #}
<span id="new_{{ field.name }}" stlye="display: none" <span id="new_{{ field.name }}" stlye="display: none"
_="on load _="on load
get the (value of #id_{{ field.name }}) as Object get the (value of #id_{{ field.name }}) as Object
@ -49,6 +52,7 @@
call {{ field.name }}.addEmptyField() call {{ field.name }}.addEmptyField()
end end
"></span> "></span>
{# fmt:on #}
<div class="option"> <div class="option">
<span class="option-field"> <span class="option-field">

View File

@ -11,7 +11,7 @@
</fieldset> </fieldset>
<fieldset> <fieldset>
<legend>Password</legend> <legend>Password</legend>
<p>To change your password, please trigger a <a href="{% url "trigger_reset" %}">password reset</a>. <p>To change your password, please trigger a <a href="{% url "trigger_reset" %}">password reset</a>.</p>
</fieldset> </fieldset>
</form> </form>
{% endblock %} {% endblock %}