Only use one create template, get title from Form's Model

This commit is contained in:
Jens Langhammer
2019-02-27 16:06:20 +01:00
parent 5584f5bda8
commit d7c4697625
10 changed files with 36 additions and 21 deletions

View File

@ -1,11 +1,12 @@
{% extends "generic/form.html" %}
{% load utils %}
{% load i18n %}
{% block above_form %}
<h1>{% blocktrans with type=type %}Create {{ type }}{% endblocktrans %}</h1>
<h1>{% blocktrans with type=form|form_verbose_name %}Create {{ type }}{% endblocktrans %}</h1>
{% endblock %}
{% block action %}
{% blocktrans with type=type %}Create {{ type }}{% endblocktrans %}
{% blocktrans with type=form|form_verbose_name %}Create {{ type }}{% endblocktrans %}
{% endblock %}

View File

@ -1,11 +0,0 @@
{% extends "generic/create.html" %}
{% load i18n %}
{% block title %}
{% blocktrans with type=request.GET.type %}Create {{ type }}{% endblocktrans %}
{% endblock %}
{% block above_form %}
<h1>{% blocktrans with type=request.GET.type %}Create {{ type }}{% endblocktrans %}</h1>
{% endblock %}

View File

@ -1,11 +1,12 @@
{% extends "generic/form.html" %}
{% load utils %}
{% load i18n %}
{% block above_form %}
<h1>{% trans 'Update' %}</h1>
<h1>{% blocktrans with type=form|form_verbose_name %}Update {{ type }}{% endblocktrans %}</h1>
{% endblock %}
{% block action %}
{% trans 'Update' %}
{% blocktrans with type=form|form_verbose_name %}Update {{ type }}{% endblocktrans %}
{% endblock %}