[sagenb] 67/157: fix Sage version missing in the header of several pages

felix salfelder felix-guest at moszumanska.debian.org
Mon Dec 22 16:51:49 UTC 2014


This is an automated email from the git hooks/post-receive script.

felix-guest pushed a commit to branch master
in repository sagenb.

commit 2820511123e3a822422044fbfbf709314179599b
Author: J. Miguel Farto <migeruhito at gmail.com>
Date:   Wed Sep 17 18:55:41 2014 +0200

    fix Sage version missing in the header of several pages
---
 sagenb/flask_version/admin.py             | 7 ++++++-
 sagenb/flask_version/settings.py          | 3 ++-
 sagenb/flask_version/worksheet_listing.py | 3 ++-
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/sagenb/flask_version/admin.py b/sagenb/flask_version/admin.py
index d4d0d7a..0681618 100644
--- a/sagenb/flask_version/admin.py
+++ b/sagenb/flask_version/admin.py
@@ -11,7 +11,9 @@ admin = Module('sagenb.flask_version.admin')
 @admin_required
 @with_lock
 def users(reset=None):
+    from sagenb.misc.misc import SAGE_VERSION
     template_dict = {}
+    template_dict['sage_version'] = SAGE_VERSION
     if reset:
         from random import choice
         import string
@@ -73,8 +75,9 @@ def toggle_admin(user):
 @with_lock
 def add_user():
     from sagenb.notebook.misc import is_valid_username
+    from sagenb.misc.misc import SAGE_VERSION
     template_dict = {'admin': g.notebook.user_manager().user(g.username).is_admin(),
-                     'username': g.username}
+            'username': g.username, 'sage_version': SAGE_VERSION}
     if 'username' in request.values:
         if request.values['cancel']:
             return redirect(url_for('users'))
@@ -103,6 +106,7 @@ def add_user():
 @admin_required
 @with_lock
 def notebook_settings():
+    from sagenb.misc.misc import SAGE_VERSION
     updated = {}
     if 'form' in request.values:
         updated = g.notebook.conf().update_from_form(request.values)
@@ -114,6 +118,7 @@ def notebook_settings():
         current_app.config['BABEL_DEFAULT_LOCALE'] = request.values['default_language']
 
     template_dict = {}
+    template_dict['sage_version'] = SAGE_VERSION
     template_dict['auto_table'] = g.notebook.conf().html_table(updated)
     template_dict['admin'] = g.notebook.user_manager().user(g.username).is_admin()
     template_dict['username'] = g.username
diff --git a/sagenb/flask_version/settings.py b/sagenb/flask_version/settings.py
index 5a90a44..4f9d414 100644
--- a/sagenb/flask_version/settings.py
+++ b/sagenb/flask_version/settings.py
@@ -10,7 +10,7 @@ settings = Module('sagenb.flask_version.settings')
 @with_lock
 def settings_page():
     from sagenb.notebook.misc import is_valid_password, is_valid_email
-
+    from sagenb.misc.misc import SAGE_VERSION
     error = None
     redirect_to_home = None
     redirect_to_logout = None
@@ -65,6 +65,7 @@ def settings_page():
         return redirect(url_for('worksheet_listing.home', username=g.username))
 
     td = {}
+    td['sage_version'] = SAGE_VERSION
     td['username'] = g.username
 
     td['autosave_intervals'] = ((i, ' selected') if nu['autosave_interval']/60 == i else (i, '') for i in range(1, 10, 2))
diff --git a/sagenb/flask_version/worksheet_listing.py b/sagenb/flask_version/worksheet_listing.py
index 5ce705c..10c1933 100644
--- a/sagenb/flask_version/worksheet_listing.py
+++ b/sagenb/flask_version/worksheet_listing.py
@@ -236,10 +236,11 @@ def download_worksheets():
 @worksheet_listing.route('/upload')
 @login_required
 def upload():
+    from sagenb.misc.misc import SAGE_VERSION
     if g.notebook.readonly_user(g.username):
         return current_app.message(_("Account is in read-only mode"), cont=url_for('home', username=g.username))
     return render_template(os.path.join('html', 'upload.html'),
-                           username=g.username)
+                           username=g.username, sage_version=SAGE_VERSION)
 
 class RetrieveError(Exception):
     """

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagenb.git



More information about the debian-science-commits mailing list