Skip to content

Commit

Permalink
Uncrispify seedDB
Browse files Browse the repository at this point in the history
This removes all checks if a form has been uncrispified, since all are by now
  • Loading branch information
johannaengland committed Oct 11, 2024
1 parent e78f275 commit 86be235
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 37 deletions.
2 changes: 1 addition & 1 deletion python/nav/web/seeddb/forms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def cut_branch(field, klass, pk):
return [c for c in field.choices if c[0] not in descendant_ids]


# non-crispy helpers
# helpers


def get_single_layout(heading, row):
Expand Down
12 changes: 3 additions & 9 deletions python/nav/web/templates/seeddb/edit.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{% extends "seeddb/base.html" %}
{% load crispy_forms_tags %}


{% block base_header_additional_head %}
{{ block.super }}
Expand Down Expand Up @@ -41,13 +39,9 @@ <h4>{{ title }}
<form class="seeddb-edit" action="" method="post">
<fieldset>
<legend>Attributes</legend>
{% if form.attrs %}
{% include 'custom_crispy_templates/_form_content.html' %}
{% else %}
{% block crispyfields %}
{{ form|crispy }}
{% endblock %}
{% endif %}
{% block formfields %}
{% include 'custom_crispy_templates/_form_content.html' %}
{% endblock %}
</fieldset>
<input type="submit" name="submit" value="Save {{ verbose_name }}" class="submit button small left" id="submit-id-submit">
</form>
Expand Down
2 changes: 1 addition & 1 deletion python/nav/web/templates/seeddb/edit_prefix.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "seeddb/edit.html" %}
{% block crispyfields %}
{% block formfields %}
{{ block.super }}
{% include 'custom_crispy_templates/_form_content.html' with form=vlan_form %}
{% endblock %}
2 changes: 1 addition & 1 deletion python/nav/web/templates/seeddb/edit_vlan.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "seeddb/edit.html" %}
{% block crispyfields %}
{% block formfields %}
<div>
<p>Net type<br/>
{{ object.net_type }}</p>
Expand Down
11 changes: 1 addition & 10 deletions python/nav/web/templates/seeddb/list.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
{% extends "seeddb/base.html" %}
{% load crispy_forms_tags %}

{% block content %}

{% if filter_form %}
{% if filter_form.base_fields|length >= 3 %}
{% if filter_form.attrs %}
{% include 'custom_crispy_templates/flat_form.html' with form=filter_form %}
{% else %}
{{ filter_form }}
{% endif %}
{% include 'custom_crispy_templates/flat_form.html' with form=filter_form %}
{% else %}
<div class="row">
<div class="medium-6 column">
{% if filter_form.attrs %}
{% include 'custom_crispy_templates/flat_form.html' with form=filter_form %}
{% else %}
{% crispy filter_form %}
{% endif %}
</div>
</div>
{% endif %}
Expand Down
6 changes: 1 addition & 5 deletions python/nav/web/templates/seeddb/service_netbox_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ <h4>
<form id="service_checker_add_form" action="" method="post">
<fieldset>
<legend>Add new service checker</legend>
{% if choice_form.attrs %}
{% include 'custom_crispy_templates/_form_content.html' with form=choice_form %}
{% else %}
{{ choice_form }}
{% endif %}
{% include 'custom_crispy_templates/_form_content.html' with form=choice_form %}
<input type="submit" value="Continue" class="button small"/>
</fieldset>
</form>
Expand Down
12 changes: 2 additions & 10 deletions python/nav/web/templates/seeddb/service_property_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,9 @@ <h4>
<form action="" method="post">
<fieldset>
<legend>Attributes</legend>
{% if service_form.attrs %}
{% include 'custom_crispy_templates/_form_content.html' with form=service_form %}
{% else %}
{{ service_form }}
{% endif %}
{% include 'custom_crispy_templates/_form_content.html' with form=service_form %}
{% if property_form.fields %}
{% if property_form.attrs %}
{% include 'custom_crispy_templates/_form_content.html' with form=property_form %}
{% else %}
{{ property_form }}
{% endif %}
{% include 'custom_crispy_templates/_form_content.html' with form=property_form %}
{% else %}
<div class="alert-box">
There are no attributes for this service.
Expand Down

0 comments on commit 86be235

Please sign in to comment.