diff --git a/HISTORY.rst b/HISTORY.rst index 3282232228..2e325badbe 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -31,6 +31,8 @@ - Remove code statistics from the documentation. - Remove the pending work chapter. This is now available in the Wiki: wiki.mayan-edms.com +- Unify template title rendering. +- Add support for template subtitles. 3.0.1 (2018-07-08) ================= diff --git a/mayan/apps/appearance/templates/appearance/about.html b/mayan/apps/appearance/templates/appearance/about.html index bfab90fcfa..cdbbe04919 100644 --- a/mayan/apps/appearance/templates/appearance/about.html +++ b/mayan/apps/appearance/templates/appearance/about.html @@ -54,9 +54,6 @@ {% endblock stylesheets %} {% block content %} -

{% trans 'About' %}

-
- {% build as build_number %}

{% project_information '__title__' %} ({% trans 'Version' %} {% project_information '__version__' %})

diff --git a/mayan/apps/appearance/templates/appearance/base.html b/mayan/apps/appearance/templates/appearance/base.html index 677f8c7758..7d9b43915f 100644 --- a/mayan/apps/appearance/templates/appearance/base.html +++ b/mayan/apps/appearance/templates/appearance/base.html @@ -45,6 +45,7 @@ {% else %}
{% endif %} + {% include 'appearance/calculate_form_title.html' %} {% block content %}{% endblock %} {% block footer %}{% endblock %}
diff --git a/mayan/apps/appearance/templates/appearance/calculate_form_title.html b/mayan/apps/appearance/templates/appearance/calculate_form_title.html index 907b90511e..47f7a93419 100644 --- a/mayan/apps/appearance/templates/appearance/calculate_form_title.html +++ b/mayan/apps/appearance/templates/appearance/calculate_form_title.html @@ -4,25 +4,37 @@ {% smart_setting 'APPEARANCE_MAXIMUM_TITLE_LENGTH' as maximum_title_length %} -{# Avoid horizontal scroll on small displays #} -{% if not html_title %} - +{% if not non_html_title %} +

{% endif %} {% if title %} {{ title|truncatechars:maximum_title_length }} {% else %} - {% if read_only %} - {% blocktrans %}Details for: {{ object }}{% endblocktrans %} + {% if delete_view %} + {% trans 'Confirm delete' %} {% else %} - {% if object %} - {% blocktrans with object as object %}Edit: {{ object }}{% endblocktrans %} + {% if form %} + {% trans 'Confirm' %} {% else %} - {% trans 'Create' %} + {% if read_only %} + {% blocktrans %}Details for: {{ object }}{% endblocktrans %} + {% else %} + {% if object %} + {% blocktrans with object as object %}Edit: {{ object }}{% endblocktrans %} + {% else %} + {% trans 'Create' %} + {% endif %} + {% endif %} {% endif %} {% endif %} {% endif %} -{% if not html_title %} - +{% if not non_html_title %} +

+ + {% if subtitle %} + {{ subtitle }} + {% endif %} +
{% endif %} diff --git a/mayan/apps/appearance/templates/appearance/generic_confirm.html b/mayan/apps/appearance/templates/appearance/generic_confirm.html index 18aa5c6faf..3227c3d9f2 100644 --- a/mayan/apps/appearance/templates/appearance/generic_confirm.html +++ b/mayan/apps/appearance/templates/appearance/generic_confirm.html @@ -3,30 +3,15 @@ {% load i18n %} {% load static %} -{% block title %}{% trans 'Confirm' %} {{ title }}{% endblock %} +{% block title %}{% include 'appearance/calculate_form_title.html' with non_html_title=True %}{% endblock %} {% block content %} -

- {% if delete_view %} - {% trans 'Confirm delete' %} - {% else %} - {% trans 'Confirm' %} - {% endif %} -

-
-