mirror of
https://github.com/wahyd4/links.git
synced 2026-08-08 21:04:53 +10:00
fix: add missing space between link-field/action-field class and hidden toggle
Template rendered 'action-fieldhidden' / 'link-fieldhidden' (no space) when
the hidden modifier applied, so:
- Tailwind .hidden class never applied -> Discord action card visible on
the new-link page's default Link tab
- JS querySelectorAll('.action-field') failed to match -> could not hide it
Root cause: '{% if %}...{% endif %}' directly appended to the class name
in link_form.html line 212. Verified via Playwright: new Link tab hides
action card, Action tab shows it, edit pages hide the wrong fields.
This commit is contained in:
@@ -209,7 +209,7 @@
|
||||
{% for field in form %}
|
||||
{% if field.name != 'link_type' and field.name != 'action_config' %}
|
||||
<!-- Render fields based on link type -->
|
||||
<div class="space-y-1 {% if field.name == 'original_url' %}link-field{% if is_custom or is_action %}hidden{% endif %}{% elif field.name == 'text' %} custom-field {% if not is_custom %}hidden{% endif %}{% elif field.name == 'action_type' or field.name == 'action_message_template' %}action-field{% if not is_action %}hidden{% endif %}{% endif %}">
|
||||
<div class="space-y-1 {% if field.name == 'original_url' %}link-field {% if is_custom or is_action %}hidden{% endif %}{% elif field.name == 'text' %} custom-field {% if not is_custom %}hidden{% endif %}{% elif field.name == 'action_type' or field.name == 'action_message_template' %}action-field {% if not is_action %}hidden{% endif %}{% endif %}">
|
||||
<label for="{{ field.id_for_label }}" class="block text-sm font-medium text-gray-700 {% if field.name == 'original_url' and is_custom or field.name == 'text' and not is_custom or field.name == 'action_type' and not is_action or field.name == 'action_message_template' and not is_action %}hidden{% endif %} {% if field.name != 'description' and field.name != 'action_type' and field.name != 'action_message_template' %}required-field{% endif %}">
|
||||
{{ field.label }}
|
||||
</label>
|
||||
|
||||
Reference in New Issue
Block a user