commit/galaxy-central: carlfeberhard: History page: register panel in Galaxy object
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/44c9f3a305cc/ Changeset: 44c9f3a305cc User: carlfeberhard Date: 2013-12-09 17:36:20 Summary: History page: register panel in Galaxy object Affected #: 1 file diff -r 7bdadc81eee2640002b8fa1ed56cc92249a8abac -r 44c9f3a305ccbf31b7338d966a62f06f94e10a07 templates/webapps/galaxy/root/history.mako --- a/templates/webapps/galaxy/root/history.mako +++ b/templates/webapps/galaxy/root/history.mako @@ -4,7 +4,8 @@ ${_('Galaxy History')} </%def> -<%namespace file="/history/history_panel.mako" import="bootstrapped_history_panel" /> +<%namespace file="/history/history_panel.mako" import="history_panel_javascripts" /> +<%namespace file="/galaxy.masthead.mako" import="get_user_json" /> ## ----------------------------------------------------------------------------- <%def name="stylesheets()"> @@ -27,20 +28,47 @@ "mvc/user/user-model" )} ${h.templates( "helpers-common-templates" )} + <script type="text/javascript"> - <% - user_data = trans.webapp.api_controllers[ 'users' ].show( trans, 'current' ) - #HACK - the above sets the response type - trans.response.set_content_type( "text/html" ) - %> - ## bc this is in it's own frame we can't reference the global Galaxy obj or the quotameter's User obj - window.Galaxy = {}; - Galaxy.currUser = new User(${user_data}); + if( !window.Galaxy ){ + window.Galaxy = {}; + Galaxy.currUser = new User(${h.to_json_string( get_user_json() )}); + } + $(function(){ $( 'body' ).addClass( 'historyPage' ).addClass( 'history-panel' ); }); </script> -${bootstrapped_history_panel( history, hdas, selector_to_attach_to='body.historyPage', \ - show_deleted=show_deleted, show_hidden=show_hidden, hda_id=hda_id )} +${history_panel_javascripts()} + +<script type="text/javascript"> +function onModuleReady( historyPanel ){ + // attach a panel to selector_to_attach_to and use a history model with bootstrapped data + + // history module is already in the dpn chain from the panel. We can re-scope it here. + var historyModel = require( 'mvc/history/history-model' ), + debugging = JSON.parse( sessionStorage.getItem( 'debugging' ) ) || false, + historyJSON = ${h.to_json_string( history )}, + hdaJSON = ${h.to_json_string( hdas )}; + + var history = new historyModel.History( historyJSON, hdaJSON, { + logger: ( debugging )?( console ):( null ) + }); + + var panel = new historyPanel.HistoryPanel({ + show_deleted : ${ 'true' if show_deleted == True else ( 'null' if show_deleted == None else 'false' ) }, + show_hidden : ${ 'true' if show_hidden == True else ( 'null' if show_hidden == None else 'false' ) }, + el : $( "body.historyPage" ), + model : history, + onready : function(){ + this.render(); + if( Galaxy ){ + Galaxy.currHistoryPanel = this; + } + } + }); +} +</script> + </%def> Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org