Added new option to the web theme app, 'WEB_THEME_VERBOSE_LOGIN' that display a more information on the login screen (version, copyright, logos)
This commit is contained in:
@@ -5,29 +5,11 @@
|
||||
{% block title %} :: {% trans "About this program" %}{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
<div class="content tc">
|
||||
<h3>{% project_name %} ({% trans "Version" %} {% app_version "main" %})</h3>
|
||||
<p>
|
||||
{% trans "Open source, Django based electronic document manager with custom metadata, indexing, tagging, file serving integration and OCR capabilities" %}
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://bit.ly/mayan-edms">http://bit.ly/mayan-edms</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.github.com/rosarior/mayan/">http://www.github.com/rosarior/mayan/</a>
|
||||
</p>
|
||||
<p>
|
||||
{% trans "Released under the GPL V3 License" %}
|
||||
</p>
|
||||
<div class="tc">
|
||||
<img src="{{ MEDIA_URL }}images/392336_7079-small.png"/>
|
||||
</div>
|
||||
<div class="tc">
|
||||
<img src="{{ MEDIA_URL }}images/gplv3-127x51.png"/>
|
||||
<img src="{{ MEDIA_URL }}images/djangopowered126x54.gif"/>
|
||||
<div class="content tc">
|
||||
<h3>{% project_name %} ({% trans "Version" %} {% app_version "main" %})</h3>
|
||||
</div>
|
||||
{% include "project_description.html" %}
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block footer %}
|
||||
<div id="footer">
|
||||
|
||||
23
apps/main/templates/project_description.html
Normal file
23
apps/main/templates/project_description.html
Normal file
@@ -0,0 +1,23 @@
|
||||
{% load i18n %}
|
||||
<link rel="stylesheet" href="{{ MEDIA_URL }}css/override.css" type="text/css" media="screen" />
|
||||
<link rel="stylesheet" href="{{ MEDIA_URL }}css/famfamfam-silk-sprite.css" type="text/css" media="screen" />
|
||||
|
||||
<p class="tc">
|
||||
{% trans "Open source, Django based electronic document manager with custom metadata, indexing, tagging, file serving integration and OCR capabilities" %}
|
||||
</p>
|
||||
<p class="tc">
|
||||
<span class="famfam active famfam-world_go"></span><a href="http://bit.ly/mayan-edms">http://bit.ly/mayan-edms</a>
|
||||
</p>
|
||||
<p class="tc">
|
||||
<span class="famfam active famfam-wrench"></span><a href="http://www.github.com/rosarior/mayan/">http://www.github.com/rosarior/mayan/</a>
|
||||
</p>
|
||||
<p class="tc">
|
||||
{% trans "Released under the GPL V3 License" %}
|
||||
</p>
|
||||
<div class="tc">
|
||||
<img src="{{ MEDIA_URL }}images/392336_7079-small.png"/>
|
||||
</div>
|
||||
<div class="tc">
|
||||
<img src="{{ MEDIA_URL }}images/gplv3-127x51.png"/>
|
||||
<img src="{{ MEDIA_URL }}images/djangopowered126x54.gif"/>
|
||||
</div>
|
||||
9
apps/main/templates/verbose_login.html
Normal file
9
apps/main/templates/verbose_login.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{% load i18n %}
|
||||
{% load version_tags %}
|
||||
|
||||
<p>{% trans "Version" %} {% app_version "main" %}</p>
|
||||
|
||||
<p>Copyright © 2011 Roberto Rosario.</p>
|
||||
|
||||
{% include "project_description.html" %}
|
||||
|
||||
@@ -9,5 +9,6 @@ register_settings(
|
||||
settings=[
|
||||
{'name': u'THEME', 'global_name': u'WEB_THEME_THEME', 'default': u'default', 'description': _(u'CSS theme to apply, options are: amro, bec, bec-green, blue, default, djime-cerulean, drastic-dark, kathleene, olive, orange, red, reidb-greenish and warehouse.')},
|
||||
{'name': u'ENABLE_SCROLL_JS', 'global_name': u'WEB_THEME_ENABLE_SCROLL_JS', 'default': True, 'hidden': True},
|
||||
{'name': u'VERBOSE_LOGIN', 'global_name': u'WEB_THEME_VERBOSE_LOGIN', 'default': True, 'description': _(u'Display extra information in the login screen.')},
|
||||
]
|
||||
)
|
||||
|
||||
@@ -45,5 +45,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% get_web_theme_setting "VERBOSE_LOGIN" as verbose_login %}
|
||||
{% if verbose_login %}
|
||||
{% include "verbose_login.html" %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
|
||||
@@ -47,3 +47,30 @@ class LoginRedirectNode(Node):
|
||||
@register.tag
|
||||
def get_login_redirect_url(parser, token):
|
||||
return LoginRedirectNode()
|
||||
|
||||
|
||||
class SettingsNode(Node):
|
||||
def __init__(self, format_string, var_name):
|
||||
self.format_string = format_string
|
||||
self.var_name = var_name
|
||||
|
||||
def render(self, context):
|
||||
context[self.var_name] = getattr(web_theme_settings, self.format_string, '')
|
||||
return ''
|
||||
|
||||
|
||||
@register.tag
|
||||
def get_web_theme_setting(parser, token):
|
||||
# This version uses a regular expression to parse tag contents.
|
||||
try:
|
||||
# Splitting by None == splitting by spaces.
|
||||
tag_name, arg = token.contents.split(None, 1)
|
||||
except ValueError:
|
||||
raise TemplateSyntaxError('%r tag requires arguments' % token.contents.split()[0])
|
||||
m = re.search(r'(.*?) as (\w+)', arg)
|
||||
if not m:
|
||||
raise TemplateSyntaxError('%r tag had invalid arguments' % tag_name)
|
||||
format_string, var_name = m.groups()
|
||||
if not (format_string[0] == format_string[-1] and format_string[0] in ('"', "'")):
|
||||
raise TemplateSyntaxError('%r tag\'s argument should be in quotes' % tag_name)
|
||||
return SettingsNode(format_string[1:-1], var_name)
|
||||
|
||||
Reference in New Issue
Block a user