From: Brandon King Date: Tue, 23 Jun 2009 01:03:08 +0000 (+0000) Subject: Updated left side of toolbar to be generated from html X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=49798d7c1dd7c7287f29dbe200298b4a78c5b185 Updated left side of toolbar to be generated from html --- diff --git a/templates/app.html b/templates/app.html index a673869..26e1ee7 100644 --- a/templates/app.html +++ b/templates/app.html @@ -2,13 +2,7 @@ {% block title %}{{ app_name }} - {{ page_name }}{% endblock %} - - @@ -16,15 +10,6 @@ -
+ {% block dynamic_panels %} + {% endblock %}
@@ -79,21 +66,34 @@ {% include "magic.html" %} + +
+ {% block left_tbar_menu %} +
+ {% endblock %} +
+ +
+ {% block right_tbar_menu %}
+ {% endblock %}
+ +
+
{% block msg %}
{{ msg }}
{% endblock %} - {% block content %} + {% block content %} {{ body }} - {% endblock %} + {% endblock %}
diff --git a/www/js/htsw.js b/www/js/htsw.js index d51ef2c..b0cc257 100644 --- a/www/js/htsw.js +++ b/www/js/htsw.js @@ -96,10 +96,10 @@ $(document).ready(function(){ id: 'main_toolbar', xtype: 'toolbar', //height: 100, - items: [{ + /*items: [{ text: "Demo Button", handler: function() { quick_msg('Messages can be fun!'); } - }], + }],*/ margins: '2 0 0 0' }], height: 60 @@ -122,7 +122,26 @@ $(document).ready(function(){ //------------------------------- var main_tb = Ext.getCmp('main_toolbar'); - var add_buttons_from_html = function(main_tb){ + var add_buttons_from_html_left = function(main_tb){ + var left_tbar_data = Ext.fly('left_tbar_data'); + var div_array = left_tbar_data.query('div'); + var div_id = null; + // Loop through each div since it defines a button and link or a spacer and add it to the right side of the toolbar + Ext.each(div_array, function(divobj) { + div_id = divobj.id; + if (div_id == 'spacer'){ + main_tb.add('-'); + } else { + main_tb.add({ + text: div_id, + handler: function() { goto_url(divobj.getAttribute('href')); } + }); + } + }); + //return right_tbar_data; + } + + var add_buttons_from_html_right = function(main_tb){ var right_tbar_data = Ext.fly('right_tbar_data'); var div_array = right_tbar_data.query('div'); var div_id = null; @@ -141,6 +160,9 @@ $(document).ready(function(){ //return right_tbar_data; } + add_buttons_from_html_left(main_tb); + + // Shifts the remaining toolbar options to the right side. main_tb.add({ xtype: 'tbfill' }); var user_info = Ext.fly('login_info'); var logout_url = user_info.getAttribute('logouturl'); @@ -152,7 +174,7 @@ $(document).ready(function(){ text: 'User: ' + user_info.getAttribute('user') }); main_tb.add('-'); - add_buttons_from_html(main_tb); + add_buttons_from_html_right(main_tb); main_tb.add('-'); main_tb.add({ text: 'Logout',