Skip to content

Commit

Permalink
Uncrispify seedDB
Browse files Browse the repository at this point in the history
  • Loading branch information
johannaengland committed Oct 9, 2024
1 parent 23050b1 commit 6e3ace3
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 51 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
1 change: 1 addition & 0 deletions python/nav/web/seeddb/page/management_profile/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from django import forms

from nav.models.manage import ManagementProfile
from nav.web.crispyforms import set_flat_form_attributes
from nav.web.seeddb.forms import get_single_layout

PROTOCOL_CHOICES = dict(ManagementProfile.PROTOCOL_CHOICES)
Expand Down
10 changes: 1 addition & 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,7 @@ <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 %}
{% include 'custom_crispy_templates/_form_content.html' %}
</fieldset>
<input type="submit" name="submit" value="Save {{ verbose_name }}" class="submit button small left" id="submit-id-submit">
</form>
Expand Down
7 changes: 1 addition & 6 deletions python/nav/web/templates/seeddb/edit_prefix.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{% extends "seeddb/edit.html" %}
{% load crispy_forms_tags %}
{% block crispyfields %}
{{ block.super }}
{% if vlan_form.attrs %}
{% include 'custom_crispy_templates/_form_content.html' with form=vlan_form %}
{% else %}
{{ vlan_form }}
{% endif %}
{% include 'custom_crispy_templates/_form_content.html' with form=vlan_form %}
{% endblock %}
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
12 changes: 2 additions & 10 deletions python/nav/web/templates/seeddb/management-profile/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ <h4>Add new management profile</h4>
<div class="columns large-4">
<fieldset>
<legend>Basic profile data</legend>
{% if form.attrs %}
{% include 'custom_crispy_templates/_form_content.html' %}
{% else %}
{{ form }}
{% endif %}
{% include 'custom_crispy_templates/_form_content.html' %}
</fieldset>
</div>

Expand All @@ -41,11 +37,7 @@ <h4>Add new management profile</h4>
{% if form.NOTABENE %}
<div class="alert-box warning with-icon">{{ form.NOTABENE }}</div>
{% endif %}
{% if form.attrs %}
{% include 'custom_crispy_templates/_form_content.html' %}
{% else %}
{{ form }}
{% endif %}
{% include 'custom_crispy_templates/_form_content.html' %}
</fieldset>
{% endfor %}
</div>
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 6e3ace3

Please sign in to comment.