Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add big warning at the top of the worksheet listing and any worksheet…

… pages when an account becomes readonly.
  • Loading branch information...
commit fd26e4ab4722cf8bc9d29a35582c2e1ea14adf09 1 parent 740c2a4
@jasongrout jasongrout authored
View
2  flask_version/worksheet_listing.py
@@ -36,7 +36,7 @@ def render_worksheet_list(args, pub, username):
search = unicode_str(args['search']) if 'search' in args else None
sort = args['sort'] if 'sort' in args else 'last_edited'
reverse = (args['reverse'] == 'True') if 'reverse' in args else False
-
+ readonly = g.notebook.readonly_user(g.username)
try:
if not pub:
worksheets = g.notebook.worksheet_list_for_user(username, typ=typ, sort=sort,
View
4 sagenb/data/sage/html/notebook/base.html
@@ -93,6 +93,10 @@
{% endblock %}
{% block main %}
+{% if notebook is defined and notebook.readonly_user(username) %}
+<h1>{{ gettext('Account is read only. You may download or delete worksheets or data.') }}</h1>
+{% endif %}
+
<div id="worksheet-bar">
<div class="worksheet_title">
<a id="worksheet_title" class="worksheet_title"
View
4 sagenb/data/sage/html/worksheet_listing.html
@@ -4,6 +4,7 @@
- pub -- a boolean stating whether to show in public mode.
- typ -- a string stating what kind of worksheets this listing shows
- worksheets -- list of Worksheet objects
+- readonly -- a boolean stating whether the user is read only
#}
{% if pub %}
{% set worksheet_heading=gettext('Published Worksheets') %}
@@ -40,6 +41,9 @@
{% block main %}
+{% if readonly is defined and readonly %}
+<h1>{{ gettext('Account is read only. You may download or delete worksheets or data.') }}</h1>
+{% endif %}
<div id="user-main-controls" class="user-controls">
{% if pub is not defined or not pub %}
<a href="/new_worksheet" target="_blank">{{ gettext('New Worksheet') }}</a>
Please sign in to comment.
Something went wrong with that request. Please try again.