diff --git a/qgis-app/.version b/qgis-app/.version new file mode 100644 index 00000000..afaf360d --- /dev/null +++ b/qgis-app/.version @@ -0,0 +1 @@ +1.0.0 \ No newline at end of file diff --git a/qgis-app/models/templatetags/resources_custom_tags.py b/qgis-app/models/templatetags/resources_custom_tags.py index 16d7c18e..59b163a5 100644 --- a/qgis-app/models/templatetags/resources_custom_tags.py +++ b/qgis-app/models/templatetags/resources_custom_tags.py @@ -1,6 +1,9 @@ +import os.path + import markdown from django import template +from django.conf import settings from django.forms import CheckboxInput from django.utils.safestring import mark_safe @@ -57,3 +60,17 @@ def md_to_html(md_string): md = markdown.Markdown() html = md.convert(md_string) return mark_safe(html) + + +# inspired by projecta +@register.simple_tag(takes_context=True) +def version_tag(context): + """Reads current project release from the .version file.""" + version_file = os.path.join(settings.SITE_ROOT, '.version') + try: + with open(version_file, 'r') as file: + version = file.read() + context['version'] = version + except IOError: + context['version'] = 'Unknown' + return context['version'] diff --git a/qgis-app/plugins/templates/plugins/plugin_base.html b/qgis-app/plugins/templates/plugins/plugin_base.html index 4bb7002b..c6bef206 100644 --- a/qgis-app/plugins/templates/plugins/plugin_base.html +++ b/qgis-app/plugins/templates/plugins/plugin_base.html @@ -1,4 +1,5 @@ {% extends BASE_TEMPLATE %}{% load i18n plugins_tagcloud static %} +{% load resources_custom_tags %} {% block extratitle %}{% trans "Python Plugins Repository"%}{% endblock %} {% block app_title %}

{% trans "QGIS Python Plugins Repository"%}

@@ -40,5 +41,5 @@

{% trans "Plugin tags" %}

{% endblock %} {% block "credits" %} -{% trans "This web application was developed by:" %} Alessandro Pasotti and  Kartoza iconKartoza. + {{ block.super }} {% endblock %} diff --git a/qgis-app/templates/base.html b/qgis-app/templates/base.html index be9e9f9e..d0b92916 100644 --- a/qgis-app/templates/base.html +++ b/qgis-app/templates/base.html @@ -1,4 +1,6 @@ -{% load i18n simplemenu_tags static %} +{% load i18n simplemenu_tags static %} +{% load resources_custom_tags %} + QGIS {% block extratitle %}Plugins{% endblock %} @@ -157,11 +159,10 @@
Silver Sponsors

{% trans "All content is licensed under" %} Creative Commons Attribution-ShareAlike 3.0 licence (CC BY-SA).

- -
- {% block "credits" %} -

{% trans "Select graphics from " %}{% trans "The Noun Project collection" %}.

- {% endblock %} + {% block "credits" %} +

{% trans "Select graphics from " %}{% trans "The Noun Project collection" %}.

+

{% trans "This web application was developed by:" %} Alessandro Pasotti and  Kartoza iconKartoza. Version: {% version_tag %}.

+ {% endblock %}
diff --git a/qgis-app/templates/base/base.html b/qgis-app/templates/base/base.html index 1fac01b3..f262f541 100644 --- a/qgis-app/templates/base/base.html +++ b/qgis-app/templates/base/base.html @@ -1,4 +1,5 @@ {% extends BASE_TEMPLATE %}{% load i18n static thumbnail %} +{% load resources_custom_tags %} {% block extratitle %}{{ resource_name }}{% endblock %} {% block app_title %}

QGIS {{ resource_name }}

@@ -83,5 +84,5 @@

{% trans "Style Type" %}

{% endblock %} {% block "credits" %} -{% trans "This web application was developed by:" %} Alessandro Pasotti and  Kartoza iconKartoza. + {{ block.super }} {% endblock %} \ No newline at end of file