From 337184baa6f3d9259c45ae5aa83229c8564632ad Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Mon, 27 Mar 2017 02:40:01 +0200 Subject: [PATCH] Headers fixed --- templates/domains/obj_edit.html | 2 +- templates/whoisdb/handle_show.html | 8 ++++---- templates/whoisdb/maintainer_edit.html | 21 --------------------- templates/whoisdb/obj_edit.html | 2 +- whoisdb/models.py | 2 +- whoisdb/views.py | 2 +- 6 files changed, 8 insertions(+), 29 deletions(-) delete mode 100644 templates/whoisdb/maintainer_edit.html diff --git a/templates/domains/obj_edit.html b/templates/domains/obj_edit.html index 046e9df..6d3668d 100644 --- a/templates/domains/obj_edit.html +++ b/templates/domains/obj_edit.html @@ -6,7 +6,7 @@
-
Header
+
Edit {{ form.instance }} ({{ form.instance.getClassName }})
{% csrf_token %} diff --git a/templates/whoisdb/handle_show.html b/templates/whoisdb/handle_show.html index ce5acca..1d909ba 100644 --- a/templates/whoisdb/handle_show.html +++ b/templates/whoisdb/handle_show.html @@ -12,15 +12,15 @@ {% for field in object|getFields:user %} {{ field.0 }} - {% if field.1.through %}{{ field.1.all|linkObjects }}{% else %}{{ field.1 }}{% endif %} + {% if field.1.through %}{{ field.1.all|linkObjects|default:"-" }}{% else %}{{ field.1|default:"-" }}{% endif %} {% endfor %} {% if object|userCanEdit:user %} Actions - {% with "whoisdb:"|add:object.getClassName|lower|add:"-edit" as editView %} - {% with "whoisdb:"|add:object.getClassName|lower|add:"-delete" as deleteView %} - Edit object, Delete object + {% with request.resolver_match.namespaces.0|add:":"|add:object.getClassName|lower|add:"-edit" as editView %} + {% with request.resolver_match.namespaces.0|add:":"|add:object.getClassName|lower|add:"-delete" as deleteView %} + Edit object, Delete object {% endwith %} {% endwith %} diff --git a/templates/whoisdb/maintainer_edit.html b/templates/whoisdb/maintainer_edit.html deleted file mode 100644 index 691f4df..0000000 --- a/templates/whoisdb/maintainer_edit.html +++ /dev/null @@ -1,21 +0,0 @@ -{% extends "base.html" %} - -{% load crispy_forms_tags %} - -{% block content %} -
-
-
-
Header
-
- - {% csrf_token %} - {{ form | crispy }} - - -
-
-
-
-{% endblock %} - diff --git a/templates/whoisdb/obj_edit.html b/templates/whoisdb/obj_edit.html index 046e9df..6d3668d 100644 --- a/templates/whoisdb/obj_edit.html +++ b/templates/whoisdb/obj_edit.html @@ -6,7 +6,7 @@
-
Header
+
Edit {{ form.instance }} ({{ form.instance.getClassName }})
{% csrf_token %} diff --git a/whoisdb/models.py b/whoisdb/models.py index e1ce5ef..c645ded 100644 --- a/whoisdb/models.py +++ b/whoisdb/models.py @@ -84,7 +84,7 @@ class Maintainer(WhoisObject): handle = models.SlugField(max_length=32, unique=True, verbose_name='handle', validators=[HandleValidatorWithSuffix('MNT')], help_text="Must end with -MNT, eg FOO3-MNT") description = models.CharField(max_length=64, blank=True, help_text="Short description what this maintainer is for") - admin_c = models.ManyToManyField("Contact") + admin_c = models.ManyToManyField("Contact", verbose_name="Administrative Contact") rir = models.BooleanField(default=False) lir = models.BooleanField(default=False) diff --git a/whoisdb/views.py b/whoisdb/views.py index e078c0c..fdc1883 100644 --- a/whoisdb/views.py +++ b/whoisdb/views.py @@ -104,7 +104,7 @@ class MaintainerCreate(LoginRequiredMixin, CreateView): class MaintainerEdit(LoginRequiredMixin, UpdateView): - template_name = "whoisdb/maintainer_edit.html" + template_name = "whoisdb/obj_edit.html" model = Maintainer form_class = MntForm slug_field = "handle"