Add release tag string, Melange "badge" image, and Google App Engine version
to base.html template.
Patch by: Todd Larsen
Binary file app/soc/content/images/melange-logo.jpg has changed
--- a/app/soc/logic/system.py Sun Nov 23 06:34:22 2008 +0000
+++ b/app/soc/logic/system.py Sun Nov 23 07:15:13 2008 +0000
@@ -22,6 +22,7 @@
]
+import os
import settings
@@ -32,3 +33,9 @@
more sophisticated in the future.
"""
return settings.DEBUG
+
+def getAppVersion():
+ """Returns the Google App Engine "version" of the running instance.
+ """
+ return os.environ.get('CURRENT_VERSION_ID')
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/app/soc/release.py Sun Nov 23 07:15:13 2008 +0000
@@ -0,0 +1,20 @@
+# Copyright 2008 the Melange authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+__authors__ = [
+ '"Todd Larsen" <tlarsen@google.com>',
+ ]
+
+RELEASE_TAG = '0.0a20081123'
+
--- a/app/soc/templates/soc/base.html Sun Nov 23 06:34:22 2008 +0000
+++ b/app/soc/templates/soc/base.html Sun Nov 23 07:15:13 2008 +0000
@@ -118,10 +118,11 @@
<div id="badge">
{% block badge %}
-<a href="http://code.google.com/p/soc/" target="_blank">Powered by Melange</a>
- <span title=" TODO: need a Melange logo " class="popup">
-<small>*</small>
- </span>
+<a href="http://code.google.com/p/soc/"
+><img src="/soc/content/images/melange-logo.jpg" alt="Powered by Melange"/></a>
+<br>
+<a href="http://code.google.com/p/soc/source/browse/tags/{{ soc_release }}"
+>Release {{ soc_release }}</a>
{% endblock %}
</div>
</div>
@@ -158,7 +159,8 @@
{% block footer %}
©2008 Google -
<a href="http://www.google.com/">Google Home</a> -
-<a href="http://www.google.com/privacy.html">Privacy Policy</a>
+<a href="http://www.google.com/privacy.html">Privacy Policy</a> -
+Version {{ gae_version }}
{% endblock %}
</div>
</div>
--- a/app/soc/views/helper/responses.py Sun Nov 23 06:34:22 2008 +0000
+++ b/app/soc/views/helper/responses.py Sun Nov 23 07:15:13 2008 +0000
@@ -28,6 +28,7 @@
from django import http
from django.template import loader
+from soc import release
from soc.logic import accounts
from soc.logic import system
from soc.logic.models import site
@@ -107,6 +108,9 @@
context['sign_out'] = users.create_logout_url(request.path)
context['sidebar_menu_items'] = sidebar.SIDEBAR
+ context['soc_release'] = release.RELEASE_TAG
+ context['gae_version'] = system.getAppVersion()
+
settings = site.logic.getFromFields(
scope_path=site.logic.DEF_SITE_SCOPE_PATH,
link_id=site.logic.DEF_SITE_LINK_ID)