Made a dynamic way of adding div dynamically to the east panel.
authorBrandon King <kingb@caltech.edu>
Wed, 24 Jun 2009 22:55:55 +0000 (22:55 +0000)
committerBrandon King <kingb@caltech.edu>
Wed, 24 Jun 2009 22:55:55 +0000 (22:55 +0000)
  * see app_base.html template for example.

htsworkflow/frontend/static/js/htsw.js
htsworkflow/frontend/templates/app_base.html
htsworkflow/frontend/templates/flowcell_libraries_app.html [new file with mode: 0644]

index 3f1e243cfc03d4824545a271b1b9f556c533b562..2d12e87b93965d0c38581cbc56c149385f54e49e 100644 (file)
@@ -61,9 +61,9 @@ $(document).ready(function(){
         region: 'west',
         collapsible: true,
        split: true,
+       collapseMode: 'mini',
         margins: '4 0 0 0',
         //cmargins: '2 2 0 2',
-        collapseMode: 'mini',
         width: 200,
         minWidth: 150,
         border: false,
@@ -78,6 +78,46 @@ $(document).ready(function(){
        items: create_dynamic_panels().concat([panel_bcmagic])
     });
     
+    var get_east_panel_content = function(){
+      // East panel contentEl id is supplied in html div id of east_region_config.
+      var east_id = Ext.fly('east_region_config').dom.textContent;
+      
+      // If no element exists with the supplied content id, report and error.
+      if (Ext.fly(east_id) == null){
+       return 'east_region_config_error';
+      }
+      return east_id;
+    }
+    
+    var east_panel_content_id = get_east_panel_content();
+    if (east_panel_content_id.length > 0){
+      var eastPanel = new Ext.Panel({
+         region: 'east',
+         layout: 'auto',
+         //margins: '0 2 0 2',
+         width: 180,
+         collapsible: true,
+         split: true,
+         collapseMode: 'mini',
+         autoScroll: true,
+         contentEl: east_panel_content_id
+      });
+    } else {
+      var eastPanel = new Ext.Panel({
+         region: 'east',
+         layout: 'auto',
+         //margins: '0 2 0 2',
+         width: 180,
+         collapsible: true,
+         split: true,
+         hidden: true,
+         collapseMode: 'mini',
+         autoScroll: true
+         //contentEl: ''
+      });
+    }
+    
+
     //-------------------------------
     // Main Viewport Setup
     //-------------------------------
@@ -113,13 +153,13 @@ $(document).ready(function(){
            //autoScroll: true,
             layout: 'fit',
             margins: '2 2 2 2',
-            items: {
+            items: [{
                 //title: 'Inner Panel',
                 contentEl: 'body_content',
                 border: true,
                autoScroll: true
-            }
-       }]
+            }]
+           },eastPanel]
     });
     
     //-------------------------------
index 4e59ef50d109c9edd4b0bf30b942c47221540740..a28e16c61c929cb17b75acfeba5d1f323b234058 100644 (file)
         {% include "magic.html" %}
     </div>
     
+    {% block east_region %}
+    <div id="east_region_config" class="x-hidden"></div>
+    {% endblock %}
+    <div id="east_region_config_error">Check contents of div w/ id east_region_config, as the id supplied in text block does not exist.</div>
+    
     <!-- Left side tool bar -->
     <div id="left_tbar_data" class="x-hidden">
         {% block left_tbar_menu %}
diff --git a/htsworkflow/frontend/templates/flowcell_libraries_app.html b/htsworkflow/frontend/templates/flowcell_libraries_app.html
new file mode 100644 (file)
index 0000000..ef7c3e5
--- /dev/null
@@ -0,0 +1,29 @@
+{% extends "app_base.html" %}
+
+{% block additional_css %}
+    <link rel="stylesheet" type="text/css" href="{% load adminmedia %}{% admin_media_prefix %}css/base.css" />
+    {% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% admin_media_prefix %}css/rtl.css{% endblock %}" />{% endif %}
+    {% block extrastyle %}{% endblock %}
+    {% block extrahead %}{% endblock %}
+    {% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %}
+    <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/data-browse-index.css" />
+{% endblock %}
+
+{% block dynamic_panels %}
+    <ul id="Libraries" class="x-hidden">
+            <li>
+                <img src="/static/img/s.gif" class="icon-show-all" />
+                <a href="{% url htsworkflow.frontend.samples.views.library %}">Index</a><br />
+            </li>
+    </ul>
+    <ul id="Flowcells" class="x-hidden">
+            <li>
+                <img src="/static/img/s.gif" class="icon-show-all" />
+                <a href="/runfolders/">Run Folders</a><br />
+            </li>
+    </ul>
+{% endblock %}
+
+{% block east_region %}
+<div id="east_region_config" class="x-hidden">changelist-filter</div>
+{% endblock %}
\ No newline at end of file