[sagenb] 126/157: Make snapshots work again

felix salfelder felix-guest at moszumanska.debian.org
Mon Dec 22 16:52:00 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 b34f9bc4035208886a7199895c5b547586a84acc
Author: Karl-Dieter Crisman <kcrisman at gmail.com>
Date:   Thu Oct 23 16:06:39 2014 -0400

    Make snapshots work again
    
    Clicking on a revision now actually takes
    you to the correct revision.  Also fixed
    some presentation issues for clarity.
---
 sagenb/data/sage/css/main.css                               | 1 +
 sagenb/data/sage/html/notebook/worksheet_revision_list.html | 2 +-
 sagenb/notebook/notebook.py                                 | 7 ++++---
 sass/src/main.scss                                          | 6 +++++-
 4 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/sagenb/data/sage/css/main.css b/sagenb/data/sage/css/main.css
index 3909d52..e306c9d 100644
--- a/sagenb/data/sage/css/main.css
+++ b/sagenb/data/sage/css/main.css
@@ -274,6 +274,7 @@ button.add_new_worksheet_menu { font-size: 14px; }
 
 /* line 479, ../../../../sass/src/main.scss */
 #specific-revision-page #revision-data { padding: 1em 0.5em; border-top: 1px solid #c9d7f1; border-bottom: 1px solid #c9d7f1; }
+#specific-revision-page .sharebar a { color: white; border-left: 2px white solid; padding-left: 1em; }
 
 /* line 485, ../../../../sass/src/main.scss */
 #revision-list-page #revision-list { width: 100%; }
diff --git a/sagenb/data/sage/html/notebook/worksheet_revision_list.html b/sagenb/data/sage/html/notebook/worksheet_revision_list.html
index 11c698e..c5b8739 100644
--- a/sagenb/data/sage/html/notebook/worksheet_revision_list.html
+++ b/sagenb/data/sage/html/notebook/worksheet_revision_list.html
@@ -3,7 +3,7 @@
 {% block page_id %}revision-list-page{% endblock %}
 
 {% block sharebar_title %}
-{{ gettext('Revision History -- Previous sessions') }}
+{{ gettext('Revision History -- List of Snapshots') }}
 {% endblock %}
 
 {% set select = "revisions" %}
diff --git a/sagenb/notebook/notebook.py b/sagenb/notebook/notebook.py
index b70cd91..7fa0189 100644
--- a/sagenb/notebook/notebook.py
+++ b/sagenb/notebook/notebook.py
@@ -451,11 +451,11 @@ class Notebook(object):
         try:
             return self.__scratch_worksheet
         except AttributeError:
-            W = self.create_new_worksheet('scratch', '_sage_', add_to_list=False)
+            W = self.create_new_worksheet('scratch', '_sage_')
             self.__scratch_worksheet = W
             return W
 
-    def create_new_worksheet(self, worksheet_name, username, add_to_list=True):
+    def create_new_worksheet(self, worksheet_name, username):
         if username!='pub' and self.user_manager().user_is_guest(username):
             raise ValueError("guests cannot create new worksheets")
 
@@ -1355,6 +1355,7 @@ class Notebook(object):
         filename = ws.get_snapshot_text_filename(rev)
         txt = bz2.decompress(open(filename).read())
         W = self.scratch_worksheet()
+        W.set_name('Revision of ' + ws.name())
         W.delete_cells_directory()
         W.edit_save(txt)
 
@@ -1371,7 +1372,7 @@ class Notebook(object):
 
         return template(os.path.join("html", "notebook", 
                                      "specific_revision.html"),
-                        worksheet = ws,
+                        worksheet = W, # the revision, not the original!
                         username = username, rev = rev, prev_rev = prev_rev,
                         next_rev = next_rev, time_ago = time_ago)
 
diff --git a/sass/src/main.scss b/sass/src/main.scss
index dddc1f2..10f57c6 100644
--- a/sass/src/main.scss
+++ b/sass/src/main.scss
@@ -485,7 +485,11 @@ button.add_new_worksheet_menu {
   #revision-data {
     padding: 1em 0.5em;
     border-top: 1px solid #c9d7f1;
-    border-bottom: 1px solid #c9d7f1; } }
+    border-bottom: 1px solid #c9d7f1; }
+  .sharebar a {
+    color: white;
+    border-left: 2px white solid;
+    padding-left: 1em;} }
 
 #revision-list-page {
   #revision-list {

-- 
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