From bf8c3434c59c55704ce931a0954bd1e30c4e02f1 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Sun, 10 Feb 2008 15:17:03 +0100 Subject: [PATCH] * Split off the detail and list templates into a normal one that generates a full page, by including the _block variant, which generates the actual content. * Make the index template use the character_block and influence_block templates, to reduce duplicate template code. --- templates/influences/character_detail.html | 18 +---------- .../influences/character_detail_block.html | 15 ++++++++++ templates/influences/character_list.html | 16 +--------- .../influences/character_list_block.html | 15 ++++++++++ templates/influences/index.html | 30 ++++--------------- templates/influences/influence_detail.html | 11 +------ .../influences/influence_detail_block.html | 11 +++++++ templates/influences/influence_list.html | 5 ++++ .../influences/influence_list_block.html | 14 +++++++++ 9 files changed, 69 insertions(+), 66 deletions(-) create mode 100644 templates/influences/character_detail_block.html create mode 100644 templates/influences/character_list_block.html create mode 100644 templates/influences/influence_detail_block.html create mode 100644 templates/influences/influence_list.html create mode 100644 templates/influences/influence_list_block.html diff --git a/templates/influences/character_detail.html b/templates/influences/character_detail.html index 09afc68..1f31ec9 100644 --- a/templates/influences/character_detail.html +++ b/templates/influences/character_detail.html @@ -1,21 +1,5 @@ {% extends "base/base.html" %} -{% load i18n %} {% block content %} - -

{{ object.name }}

-{% ifequal object.status "N" %} -{% trans "This character was not yet approved by the SLs" %} -{% else %} -{% trans "This character is approved by the SLs" %} -{% endifequal %} -

{% blocktrans with object.name as name %}Influences for {{ name }}{% endblocktrans %}

- - -{% trans "Submit influence" %} - +{% include "influences/character_detail_block.html" %} {% endblock %} diff --git a/templates/influences/character_detail_block.html b/templates/influences/character_detail_block.html new file mode 100644 index 0000000..6c0a67b --- /dev/null +++ b/templates/influences/character_detail_block.html @@ -0,0 +1,15 @@ +{% load i18n %} +

{{ object.name }}

+{% ifequal object.status "N" %} +{% trans "This character was not yet approved by the SLs" %} +{% else %} +{% trans "This character is approved by the SLs" %} +{% endifequal %} +

{% blocktrans with object.name as name %}Influences for {{ name }}{% endblocktrans %}

+ + +{% trans "Submit influence" %} diff --git a/templates/influences/character_list.html b/templates/influences/character_list.html index 8b2c3d3..d089d09 100644 --- a/templates/influences/character_list.html +++ b/templates/influences/character_list.html @@ -1,19 +1,5 @@ {% extends "base/base.html" %} -{% load i18n %} {% block content %} - -

{% trans "Your characters"%}

-{% if object_list %} - -{% else %} -

{% trans "No characters. Add a character first, so you can submit your influences." %}

-{% endif %} - -

{% trans "Add character" %}

- +{% include "influences/character_list_block.html" %} {% endblock %} diff --git a/templates/influences/character_list_block.html b/templates/influences/character_list_block.html new file mode 100644 index 0000000..27ca771 --- /dev/null +++ b/templates/influences/character_list_block.html @@ -0,0 +1,15 @@ +{% load i18n %} + +

{% trans "Your characters"%}

+{% if object_list %} + +{% else %} +

{% trans "No characters. Add a character first, so you can submit your influences." %}

+{% endif %} + +

{% trans "Add character" %}

+ diff --git a/templates/influences/index.html b/templates/influences/index.html index ccd2da9..02596e1 100644 --- a/templates/influences/index.html +++ b/templates/influences/index.html @@ -1,33 +1,15 @@ {% extends "base/base.html" %} -{% load i18n %} {% block content %} -

{% trans "Your characters"%}

-{% if characters %} - -{% else %} -

{% trans "No characters. Add a character first, so you can submit your influences." %}

-{% endif %} - -

{% trans "Add character" %}

+{% with characters as object_list %} +{% include "influences/character_list_block.html" %} +{% endwith %} {% if characters %} -

{% trans "Your influences" %}

-{% if influences %} - -{% else %} -

{% trans "No influences yet." %}

+{% with influences as object_list %} +{% include "influences/influence_list_block.html" %} +{% endwith %} {% endif %} -

{% trans "Submit influence" %}

-{% endif %} {% endblock %} diff --git a/templates/influences/influence_detail.html b/templates/influences/influence_detail.html index 1794579..b06ed88 100644 --- a/templates/influences/influence_detail.html +++ b/templates/influences/influence_detail.html @@ -2,14 +2,5 @@ {% load i18n %} {% block content %} - -

{{ object.summary }}

- - - -{% if object.longterm %} - -{% endif %} -
{% trans "Contact" %}:{{ object.contact }}
{% trans "Character" %}:{{ object.character }}
{% trans "Long term" %}:{{ object.longterm|yesno|capfirst }}
-

{{ object.description }}

+{% include "influences/influence_detail_block.html" %} {% endblock %} diff --git a/templates/influences/influence_detail_block.html b/templates/influences/influence_detail_block.html new file mode 100644 index 0000000..d2c1c3a --- /dev/null +++ b/templates/influences/influence_detail_block.html @@ -0,0 +1,11 @@ +{% load i18n %} + +

{{ object.summary }}

+ + + +{% if object.longterm %} + +{% endif %} +
{% trans "Contact" %}:{{ object.contact }}
{% trans "Character" %}:{{ object.character }}
{% trans "Long term" %}:{{ object.longterm|yesno|capfirst }}
+

{{ object.description }}

diff --git a/templates/influences/influence_list.html b/templates/influences/influence_list.html new file mode 100644 index 0000000..3f50a1f --- /dev/null +++ b/templates/influences/influence_list.html @@ -0,0 +1,5 @@ +{% extends "base/base.html" %} + +{% block content %} +{% include "influences/influence_list_block.html" %} +{% endblock %} diff --git a/templates/influences/influence_list_block.html b/templates/influences/influence_list_block.html new file mode 100644 index 0000000..e59216f --- /dev/null +++ b/templates/influences/influence_list_block.html @@ -0,0 +1,14 @@ +{% load i18n %} + +

{% trans "Your influences" %}

+{% if object_list %} + +{% else %} +

{% trans "No influences yet." %}

+{% endif %} + +

{% trans "Submit influence" %}

-- 2.30.2