Adding a new notebook now puts you directly into renaming it.
This commit is contained in:
parent
3b2462eff3
commit
c1b4a58f65
|
@ -53,9 +53,10 @@ class Notebooks( object ):
|
|||
note_id = Valid_id(),
|
||||
parent_id = Valid_id(),
|
||||
revision = Valid_revision(),
|
||||
rename = Valid_bool(),
|
||||
user_id = Valid_id( none_okay = True ),
|
||||
)
|
||||
def default( self, notebook_id, note_id = None, parent_id = None, revision = None, user_id = None ):
|
||||
def default( self, notebook_id, note_id = None, parent_id = None, revision = None, rename = False, user_id = None ):
|
||||
"""
|
||||
Provide the information necessary to display the page for a particular notebook. If a
|
||||
particular note id is given without a revision, then the most recent version of that note is
|
||||
|
@ -87,6 +88,7 @@ class Notebooks( object ):
|
|||
result[ "conversion" ] = u"demo"
|
||||
else:
|
||||
result[ "conversion" ] = u"signup"
|
||||
result[ "rename" ] = rename
|
||||
|
||||
return result
|
||||
|
||||
|
@ -739,7 +741,7 @@ class Notebooks( object ):
|
|||
self.__database.commit()
|
||||
|
||||
return dict(
|
||||
redirect = u"/notebooks/%s" % notebook_id,
|
||||
redirect = u"/notebooks/%s?rename=true" % notebook_id,
|
||||
)
|
||||
|
||||
@expose( view = Json )
|
||||
|
|
|
@ -76,6 +76,10 @@ function Wiki( invoker ) {
|
|||
event.stop();
|
||||
} );
|
||||
}
|
||||
|
||||
var rename = evalJSON( getElement( "rename" ).value );
|
||||
if ( rename )
|
||||
this.start_notebook_rename();
|
||||
}
|
||||
|
||||
Wiki.prototype.update_next_id = function ( result ) {
|
||||
|
|
|
@ -83,6 +83,7 @@ function test_Wiki() {
|
|||
<input type="hidden" name="startup_notes" id="startup_notes" value="[]" />
|
||||
<input type="hidden" name="note" id="note" value="" />
|
||||
<input type="hidden" name="note_read_write" id="note_read_write" value="" />
|
||||
<input type="hidden" name="rename" id="rename" value="false" />
|
||||
|
||||
<div id="static_notes">
|
||||
</div>
|
||||
|
|
|
@ -27,6 +27,7 @@ class Main_page( Page ):
|
|||
count = None,
|
||||
http_url = None,
|
||||
conversion = None,
|
||||
rename = False,
|
||||
):
|
||||
startup_note_ids = [ startup_note.object_id for startup_note in startup_notes ]
|
||||
|
||||
|
@ -94,6 +95,7 @@ class Main_page( Page ):
|
|||
Input( type = u"hidden", name = u"startup_notes", id = u"startup_notes", value = json( startup_note_dicts ) ),
|
||||
Input( type = u"hidden", name = u"current_notes", id = u"current_notes", value = json( note_dicts ) ),
|
||||
Input( type = u"hidden", name = u"note_read_write", id = u"note_read_write", value = json( note_read_write ) ),
|
||||
Input( type = u"hidden", name = u"rename", id = u"rename", value = json( rename ) ),
|
||||
Div(
|
||||
id = u"status_area",
|
||||
),
|
||||
|
|
Reference in New Issue