From: Matthijs Kooijman Date: Sun, 10 Feb 2008 14:17:03 +0000 (+0100) Subject: * Split off the detail and list templates into a normal one that generates a full... X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=bf8c3434c59c55704ce931a0954bd1e30c4e02f1;p=matthijs%2Fprojects%2Fxerxes.git * 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. --- 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" %}