Skip to content

Commit

Permalink
Add djhtml to 'make fmt' and 'make lint' command
Browse files Browse the repository at this point in the history
Easier way to check and fix formatting issues if don't want to go
precommit hooks route
  • Loading branch information
theskumar committed Sep 8, 2023
1 parent 53ed252 commit ebb0212
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ fmt:
python -m ruff --fix .
python -m black .
npx prettier . --write
djhtml hypha/

.PHONY: cov-html
cov-html:
Expand All @@ -52,6 +53,8 @@ lint:
@echo "Checking python code style with ruff"
ruff .
black . --check
@echo "Checking html file indendation."
djhtml hypha/ --check
@echo "Checking js and css code style."
npm run lint
npx prettier . --check
Expand Down
12 changes: 8 additions & 4 deletions hypha/apply/templates/forms/includes/multi_input_field.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
{% load heroicons %}
<div class="form__item{% if field.help_text %} form__group--wrap{% endif %}{% if field.errors %} form__error{% endif %}{% if not field.initial %} multi-input-field-hidden{% endif %}{% if is_application and field.field.group_number > 1 %} field-group field-group-{{ field.field.group_number }}{% endif %}"{% if is_application and field.field.group_number > 1 %} data-hidden="{% if not show_all_group_fields %}true{% else %}false{% endif %}"{% endif %}" data-multi-field-for="{{ field.field.multi_input_id }}">
<div
class="form__item{% if field.help_text %} form__group--wrap{% endif %}{% if field.errors %} form__error{% endif %}{% if not field.initial %} multi-input-field-hidden{% endif %}{% if is_application and field.field.group_number > 1 %} field-group field-group-{{ field.field.group_number }}{% endif %}"
{% if is_application and field.field.group_number > 1 %} data-hidden="{% if not show_all_group_fields %}true{% else %}false{% endif %}"{% endif %}
data-multi-field-for="{{ field.field.multi_input_id }}"
>
{{ field }}

{% if field.errors %}<h6 class="form__error-text">{{ field.errors.as_text|linebreaksbr }}</h6>{% endif %}
</div>

{% if field.field.multi_input_add_button %}
<button class="link link--button link--button--narrow multi-input-add-btn mt-2{% if is_application and field.field.group_number > 1 %} field-group field-group-{{ field.field.group_number }}{% endif %}"
type="button" data-multi-field-id="{{ field.field.multi_input_id }}"
data-multi-visibility-index="{{ field.field.visibility_index }}"
data-multi-max-index="{{ field.field.max_index }}"
type="button" data-multi-field-id="{{ field.field.multi_input_id }}"
data-multi-visibility-index="{{ field.field.visibility_index }}"
data-multi-max-index="{{ field.field.max_index }}"
>
{% heroicon_mini "plus" size=19 class="inline align-text-bottom" aria_hidden="true" %}
{{ field.field.add_button_text }}
Expand Down

0 comments on commit ebb0212

Please sign in to comment.