Skip to content

Commit

Permalink
Remove fallback form rendering from uncrispified forms
Browse files Browse the repository at this point in the history
For more information see #3140 and #3157
  • Loading branch information
johannaengland committed Nov 13, 2024
1 parent 8bc62b0 commit 835e11c
Show file tree
Hide file tree
Showing 22 changed files with 23 additions and 115 deletions.
6 changes: 1 addition & 5 deletions python/nav/web/templates/alertprofiles/base_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ <h4>
</h4>

<form action="{% block url_edit %}{% endblock %}" method="post" >
{% if form.attrs %}
{% include 'custom_crispy_templates/_form_content.html' %}
{% else %}
{{ form }}
{% endif %}
{% include 'custom_crispy_templates/_form_content.html' %}

{% block form_additional_fields %}
{% endblock %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,7 @@ <h5>{{ editing|yesno:"Edit,Add new" }} subscription</h5>
<a href="{% url 'alertprofiles-filter_groups-new' %}">Add your first filter group</a> to fix this problem.
</div>
{% endif %}
{% if form.attrs %}
{% include 'custom_crispy_templates/_form_content.html' %}
{% else %}
{{ form }}
{% endif %}
{% include 'custom_crispy_templates/_form_content.html' %}
<input type="submit" value="{{ editing|yesno:"Save,Add" }}" class="button small"/>
</div>
</form>
Expand Down
6 changes: 1 addition & 5 deletions python/nav/web/templates/alertprofiles/timeperiod_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

<form action="{% url 'alertprofiles-profile-timeperiod-add' %}" method="post">
<input type="hidden" name="valid_during" value="{{ time_period.valid_during }}" />
{% if time_period_form.attrs %}
{% include 'custom_crispy_templates/_form_content.html' with form=time_period_form %}
{% else %}
{{ time_period_form }}
{% endif %}
{% include 'custom_crispy_templates/_form_content.html' with form=time_period_form %}
</form>
{% endblock %}
6 changes: 1 addition & 5 deletions python/nav/web/templates/alertprofiles/timeperiod_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@ <h4>Edit time period</h4>
<h4>Add new time period</h4>
{% endif %}

{% if time_period_form.attrs %}
{% include 'custom_crispy_templates/_form_content.html' with form=time_period_form %}
{% else %}
{{ time_period_form }}
{% endif %}
{% include 'custom_crispy_templates/_form_content.html' with form=time_period_form %}
6 changes: 1 addition & 5 deletions python/nav/web/templates/arnold/justifications.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,7 @@

{% comment %} Form for creating new justifications {% endcomment %}
<div class="medium-6 column">
{% if form.attrs %}
{% include 'custom_crispy_templates/flat_form.html' %}
{% else %}
{{ form }}
{% endif %}
{% include 'custom_crispy_templates/flat_form.html' %}
</div>

</div>
Expand Down
6 changes: 1 addition & 5 deletions python/nav/web/templates/devicehistory/history_search.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
<form action="{% url 'devicehistory-search' %}" method="get">
<div class="row">
<div class="large-8 column">
{% if form.attrs %}
{% include 'custom_crispy_templates/_form_content.html' %}
{% else %}
{{ form }}
{% endif %}
{% include 'custom_crispy_templates/_form_content.html' %}
</div>
</div>
<div class="row">
Expand Down
6 changes: 1 addition & 5 deletions python/nav/web/templates/devicehistory/history_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@
<input type="hidden" name="{{ type }}" value="{{ id }}" />
{% endfor %}
{% endfor %}
{% if form.attrs %}
{% include 'custom_crispy_templates/_form_content.html' %}
{% else %}
{{ form }}
{% endif %}
{% include 'custom_crispy_templates/_form_content.html' %}
<input type="submit" class="button small" value="Filter">
</form>
</div>
Expand Down
6 changes: 1 addition & 5 deletions python/nav/web/templates/ipdevinfo/modules.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ <h5>
<div class="row">
<div class="medium-6 column">
<form id="switchport_activity_recheck" action="" method="get">
{% if activity_interval_form.attrs %}
{% include 'custom_crispy_templates/_form_content.html' with form=activity_interval_form %}
{% else %}
{{ activity_interval_form }}
{% endif %}
{% include 'custom_crispy_templates/_form_content.html' with form=activity_interval_form %}
</form>
</div>
<div class="medium-6 column">
Expand Down
6 changes: 1 addition & 5 deletions python/nav/web/templates/ipdevinfo/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ <h4>IP Device search</h4>

<div class="row">
<div class="column medium-6">
{% if search_form.attrs %}
{% include 'custom_crispy_templates/flat_form.html' with form=search_form %}
{% else %}
{{ search_form }}
{% endif %}
{% include 'custom_crispy_templates/flat_form.html' with form=search_form %}
</div>
</div>

Expand Down
6 changes: 1 addition & 5 deletions python/nav/web/templates/ipdevinfo/sensor-details.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,7 @@ <h4>Display values</h4>
Add to dashboard
</button>
<form method="post">
{% if form.attrs %}
{% include 'custom_crispy_templates/_form_content.html' %}
{% else %}
{{ form }}
{% endif %}
{% include 'custom_crispy_templates/_form_content.html' %}
<button type="submit" class="button small">Update settings</button>
</form>
{% else %}
Expand Down
6 changes: 1 addition & 5 deletions python/nav/web/templates/macwatch/addmacwatch.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
<div class="row">
<div class="large-4 column">
<a href="{% url 'listwatch' %}" class="button small secondary">Back</a>
{% if form.attrs %}
{% include 'custom_crispy_templates/flat_form.html' %}
{% else %}
{{ form }}
{% endif %}
{% include 'custom_crispy_templates/flat_form.html' %}
</div>
</div>

Expand Down
6 changes: 1 addition & 5 deletions python/nav/web/templates/maintenance/new_task.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ <h4>{{ heading }}</h4>
<div class="large-4 columns">
<fieldset>
<legend>Details</legend>
{% if task_form.attrs %}
{% include 'custom_crispy_templates/_form_content.html' with form=task_form %}
{% else %}
{{ task_form }}
{% endif %}
{% include 'custom_crispy_templates/_form_content.html' with form=task_form %}
</fieldset>
</div>

Expand Down
6 changes: 1 addition & 5 deletions python/nav/web/templates/messages/save.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ <h3>{{ caption }}</h3>

<div class="row">
<div class="column medium-6">
{% if form.attrs %}
{% include 'custom_crispy_templates/flat_form.html' %}
{% else %}
{{ form }}
{% endif %}
{% include 'custom_crispy_templates/flat_form.html' %}
</div>
</div>

Expand Down
6 changes: 1 addition & 5 deletions python/nav/web/templates/navlets/alert_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@
</p>

<form action="{% url 'get-user-navlet' navlet.navlet_id %}" method="post">
{% if form.attrs %}
{% include 'custom_crispy_templates/_form_content.html' %}
{% else %}
{{ form }}
{% endif %}
{% include 'custom_crispy_templates/_form_content.html' %}
<input type="submit" class="button tiny" value="Save">
<a class="button tiny secondary cancel-button">Cancel</a>
</form>
Expand Down
6 changes: 1 addition & 5 deletions python/nav/web/templates/portadmin/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@

{% block page_content %}

{% if form.attrs %}
{% include 'custom_crispy_templates/flat_form.html' %}
{% else %}
{{ form }}
{% endif %}
{% include 'custom_crispy_templates/flat_form.html' %}

{% block content %}
{% if form.is_bound %}
Expand Down
6 changes: 1 addition & 5 deletions python/nav/web/templates/seeddb/netbox_wizard.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ <h4>{{ title }}</h4>
</div>

<form id="seeddb-netbox-form" method="post">
{% if form.attrs %}
{% include 'seeddb/_seeddb_netbox_form_content.html' %}
{% else %}
{{ form }}
{% endif %}
{% include 'seeddb/_seeddb_netbox_form_content.html' %}
<input type="submit" name="save_ip_device" value="Save IP device" class="submit button small left" id="submit-id-save_ip_device" />
</form>

Expand Down
6 changes: 1 addition & 5 deletions python/nav/web/templates/sortedstats/sortedstats.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@
</div>
{% endif %}

{% if form.attrs %}
{% include 'custom_crispy_templates/flat_form.html' %}
{% else %}
{{ form }}
{% endif %}
{% include 'custom_crispy_templates/flat_form.html' %}

{# Display view if exists #}
{% if result %}
Expand Down
6 changes: 1 addition & 5 deletions python/nav/web/templates/status2/status.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@
{# Form for filtering events #}
<a href="javascript:void(0);" class="button small secondary toggle-panel"></a>
<div id="status-panel" class="hidden panel">
{% if form.attrs %}
{% include 'custom_crispy_templates/flat_form.html' %}
{% else %}
{{ form }}
{% endif %}
{% include 'custom_crispy_templates/flat_form.html' %}
<hr>
<a href="javascript:void(0);" class="button small secondary set-default">Save as my default status filter</a>
<button id="clear-status-form" class="small secondary">Clear form</button>
Expand Down
6 changes: 1 addition & 5 deletions python/nav/web/templates/threshold/set_threshold.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ <h4>{{ heading }}</h4>
data-url="{% url 'threshold-search' %}"
data-renderurl="{% url 'threshold-graph' %}"
data-metric="{{ metric|default_if_none:'' }}">
{% if form.attrs %}
{% include 'custom_crispy_templates/flat_form.html' %}
{% else %}
{{ form }}
{% endif %}
{% include 'custom_crispy_templates/flat_form.html' %}
</div>
{% if id %}
<a href="#" data-dropdown="confirm-delete" class="button alert">Delete</a>
Expand Down
6 changes: 1 addition & 5 deletions python/nav/web/templates/useradmin/group_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,7 @@ <h4>Create new group</h4>
{% endif %}

<h6>Add group member</h6>
{% if account_form.attrs %}
{% include 'custom_crispy_templates/flat_form.html' with form=account_form %}
{% else %}
{{ account_form }}
{% endif %}
{% include 'custom_crispy_templates/flat_form.html' with form=account_form %}
</fieldset>
</div>
{# END GROUP MEMBERS #}
Expand Down
6 changes: 1 addition & 5 deletions python/nav/web/templates/webfront/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@
</div>
{% endif %}

{% if form.attrs %}
{% include 'custom_crispy_templates/flat_form.html' %}
{% else %}
{{ form }}
{% endif %}
{% include 'custom_crispy_templates/flat_form.html' %}

<small>
<a href="#" data-reveal-id="auditlog-information">About audit logging in NAV</a>
Expand Down
12 changes: 2 additions & 10 deletions python/nav/web/templates/webfront/preferences.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@
</div>

<div class="column medium-6 large-7">
{% if columns_form.attrs %}
{% include 'custom_crispy_templates/flat_form.html' with form=columns_form %}
{% else %}
{{ columns_form }}
{% endif %}
{% include 'custom_crispy_templates/flat_form.html' with form=columns_form %}
</div>

</div>
Expand All @@ -79,11 +75,7 @@
</p>
{% else %}
<form method="post" id="change-password-form" action="{% url 'webfront-preferences-changepassword' %}">
{% if password_form.attrs %}
{% include 'custom_crispy_templates/_form_content.html' with form=password_form %}
{% else %}
{{ password_form }}
{% endif %}
{% include 'custom_crispy_templates/_form_content.html' with form=password_form %}
</form>
{% endif %}

Expand Down

0 comments on commit 835e11c

Please sign in to comment.