On Aug 9, 11:19 am, Nils Bruin <[email protected]> wrote:
> Absolutely. My inquiry is much more modest, though: Can we have, next
> to the "save" and "cancel" button above the editor, also a "tear-off"
> or "open in separate editor window" option?

Even more modestly, a "save and keep editing" button. And with a
little experimenting, we can! I tried it on the twistd notebook. One
little change to download_or_delete_datafile.html (line 51):

-    <input type="submit" value="Save Changes" name="button_save" />
<input type="submit" value="Cancel" name="button_cancel"
style="display:block" />
+    <input type="submit" value="Save Changes" name="button_save" />
+    <input type="submit" value="Save and keep editing"
+    name="button_save_and_keep_editing" />
+    <input type="submit" value="Cancel" name="button_cancel"
style="display:block" />

and in notebook/twist.py (line 577):

-        if ctx.args.has_key('button_save'):
+        if ctx.args.has_key('button_save') or
ctx.args.has_key('button_save_and_keep_editing'):

and a couple of lines further down:

-        return RedirectResponse('/home/'+self.worksheet.filename())
+        if ctx.args.has_key('button_save_and_keep_editing'):
+            return RedirectResponse('/
home/'+self.worksheet.filename() + '/datafile?name=%s'%filename)
+        else:
+            return RedirectResponse('/
home/'+self.worksheet.filename())

A patch probably makes little sense because this is against old code,
but someone with more experience in notebook development can probably
comment on how to implement this change best.

-- 
-- 
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org



Reply via email to