Explorar el Código

playing with node template

Stephen Ficklin hace 11 años
padre
commit
44ee80b0ba

+ 36 - 113
tripal_core/theme/css/tripal.css

@@ -8,62 +8,6 @@
    padding-bottom: 10px;
 }
 
-.tripal-table {
-   width: 100%; 
-}
-.tripal-table th, 
-.tripal-table td {
-   vertical-align:text-top;
-   padding-left: 10px;
-   padding-right: 10px;
-   padding-top: 5px;
-   padding-bottom: 5px;
-}
-.tripal-table-horz {
-   border-top: 1px solid #999999;
-   border-bottom: 1px solid #999999; 
-}
-
-/* settings for vertical tables (headers across left-side) */
-table.tripal-table-vert .tripal-table-even-row th {
-   background-color: #EEEEEE;
-   font-weight: none;
-   text-align: right;
-}
-table.tripal-table-vert .tripal-table-odd-row th {
-   background-color: #FFFFFF;
-   text-align: right;
-}
-table.tripal-table-vert .tripal-table-even-row {
-   background-color: #EEEEEE;
-   border-top: 1px solid #CCCCCC;
-   border-bottom: 1px solid #CCCCCC;
-}
-table.tripal-table-vert .tripal-table-odd-row {
-   background-color: #FFFFFF;
-   border-top: 1px solid #CCCCCC;
-   border-bottom: 1px solid #CCCCCC;
-}
-/* settings for horizontal tables (headers across top) */
-table.tripal-table-horz th {
-   background-color: #EEEEFF;
-   font-weight: none;
-   text-align: left;
-}
-table.tripal-table-horz .tripal-table-even-row {
-   background-color: #FFFFFF;
-   font-weight: none;
-   text-align: left;
-   border-top: 1px solid #CCCCCC;
-   border-bottom: 1px solid #CCCCCC;
-}
-table.tripal-table-horz .tripal-table-odd-row {
-   background-color: #EEEEEE;
-   text-align: left;
-   border-top: 1px solid #CCCCCC;
-   border-bottom: 1px solid #CCCCCC;
-}
-
 .tripal-info-box-title {
   font-size: 1.5em;
   padding-bottom: 15px;
@@ -85,32 +29,6 @@ table.tripal-table-horz .tripal-table-odd-row {
    height: 0px;
 }
 
-/* Ajax loader */
-#tripal_ajaxLoading {
-   position: fixed;
-   top: 40%;
-   left: 40%;
-   padding: 15px;
-   border: 1px solid #000000;
-   background-color: #EEEEEE;
-   opacity: 0.75;
-   -moz-opacity: 0.75;
-   z-index: 10;
-}
-
-#tripal_ajaxLoading #loadingText {
-   font-weight: bold;
-   font-size: 1.5em;
-   color: #000000;
-}
-
-/* Restrict the list of checkboxes in a 300px window */
-.form-checkboxes {
-   height: auto;
-   max-height: 300px;
-   overflow: auto;
-}
-
 /* no results message */
 .tripal-no-results {
    font-style: italic;
@@ -123,32 +41,50 @@ table.tripal-table-horz .tripal-table-odd-row {
  */
 .tripal_contents {
   width: 100%;
+  position: relative;
+}
+
+#tripal_contents_table {
+  padding: 0px !important;
+  margin: 0px !important;
+  
+}
+
+#tripal_contents_table tbody {
+  padding: 0px !important;
+  margin: 0px !important;
+  border: 0px solid #FFFFFF;
+}
+
+.tripal_contents_table_td { 
+  border: 0px solid #FFFFFF !important;
+  padding: 0px !important;
+  text-align: left;
+  vertical-align: top;
+}
+.tripal_contents_table_tr {
+background-color: transparent;
 }
 
 /**
  * Resources Sidebar
  */
 .tripal_toc {
-  float: right;  
-  background-color: #EEEEEE;
-
-  -moz-border-radius: 15px;
-  -webkit-border-radius: 15px;
-  -khtml-border-radius: 15px;
-  border-radius: 15px;
-
-  -moz-box-shadow: 3px 3px 4px #888888;
-  -webkit-box-shadow: 3px 3px 4px #888888;
-  box-shadow: 3px 3px 4px #888888;
-
-  padding: 20px;
-  min-height: 500px;
-  border-style:solid;
-  border-width:1px;
+  padding: 0px; 
+  margin-right: 0px;
 }
 .tripal_toc ul {
   margin: 0 !important;
-  padding: 0 0 0.25em 1em !important;
+  padding: 0 !important;
+  list-style-type: none;
+}
+.tripal_toc li {
+	background-color: #EEEEEE;
+  border-style:solid;
+  border-width:1px;
+  border-color: #999999;
+  padding: 3px 20px 3px 20px;
+  margin: 2px 0 2px 0;
 }
 .tripal_toc_title {
   font-size: 1.5em;
@@ -161,23 +97,10 @@ table.tripal-table-horz .tripal-table-odd-row {
  * Details Section
  */
 .tripal_details {
-  float: left;
-  background-color: #FFFFFF;
-  -moz-border-radius: 15px;
-  -webkit-border-radius: 15px;
-  -khtml-border-radius: 15px;
-  border-radius: 15px;
-
-  -moz-box-shadow: 3px 3px 4px #888888;
-  -webkit-box-shadow: 3px 3px 4px #888888;
-  box-shadow: 3px 3px 4px #888888;
-  padding: 20px;
+  padding: 0px 20px 20px 20px;
   min-height: 500px;
   margin-right: 10px;
   margin-bottom: 10px;
-  border-style:solid;
-  border-width:1px;
-  
   overflow:auto;
 }
 

+ 1 - 89
tripal_core/theme/js/tripal.js

@@ -1,97 +1,9 @@
 if (Drupal.jsEnabled) {
 
-   //------------------------------------------------------------
-   // On document load we want to make sure the analysis result is shown
-   var path = '';
-   var tripal_AjaxRequests = 0;
-   //--------------------------------------------
-   function tripal_startAjax(){
-      $("#tripal_ajaxLoading").show();
-      tripal_AjaxRequests++;
-   }
-   //--------------------------------------------
-   function tripal_stopAjax(){
-      tripal_AjaxRequests--;
-      if(tripal_AjaxRequests == 0){
-         $("#tripal_ajaxLoading").hide();
-      }
-   }
-
-   //------------------------------------------------------------
-   // On document load we want to make sure that the expandable boxes
-   // are closed
-   $(document).ready(function(){
-      // setup the expandable boxes used for showing blast results
-      tripal_set_dropable_box();
-      // tripal_set_dropable_subbox();
-      var selected = location.hash;
-      if(selected.substring(0,1) == '#'){
-         $('#' + selected.substring(1)).next().show();
-         $('#' + selected.substring(1)).css("background", "#E1CFEA");
-      }
-      
-      // hide the transparent ajax loading popup
-      $("#tripal_ajaxLoading").hide();
-   });
-
-   //------------------------------------------------------------
-   function tripal_set_dropable_box(){
-      //$('.tripal_expandableBoxContent').hide();
-      
-      $('.tripal_expandableBox').hover(
-         function() {
-            $(this).css("text-decoration", "none");
-            $(this).css("background-color", "#EEFFEE");
-         } ,
-         function() {
-            $(this).css("text-decoration", "none");
-            $(this).css("background-color", "#EEEEFF");
-         }
-      );
-      $('.tripal_expandableBox').click(
-         function() {
-            $(this).next().slideToggle('fast',
-            function(){               
-               var icon_url = $(this).prev().css("background-image");             
-               if($(this).css("display") == "none" ){
-            	  var changed_icon_url = icon_url.replace(/arrow-up-48x48.png/,"arrow-down-48x48.png");
-                  $(this).prev().css("background-image", changed_icon_url);
-                  $(this).prev().css("background-repeat","no-repeat");
-                  $(this).prev().css("background-position","top right");
-               } else {
-            	   var changed_icon_url = icon_url.replace(/arrow-down-48x48.png/,"arrow-up-48x48.png");
-                  $(this).prev().css("background-image", changed_icon_url);
-                  $(this).prev().css("background-repeat","no-repeat");
-                  $(this).prev().css("background-position","top right");
-               }
-            });
-         }
-      );
-   }
-   //------------------------------------------------------------
-   // Toggle the tripal_expandableBox
-   function toggleExpandableBoxes(){
-	   var status = $('#tripal_expandableBox_toggle_button').html();
-	   var icon_url = $('.tripal_expandableBox').css("background-image");
-	   icon_url = icon_url.toString().match(/.+\//);
-	   icon_up = icon_url + "arrow-up-48x48.png\")";
-	   icon_down = icon_url + "arrow-down-48x48.png\")";
-	   
-	   if (status == '[-] Collapse All') {
-		   $('.tripal_expandableBoxContent').hide();
-		   $('.tripal_expandableBox').css("background-image", icon_down);
-		   $('#tripal_expandableBox_toggle_button').html('[+] Expand All');
-	   } else {
-		   $('.tripal_expandableBoxContent').show();
-		   $('.tripal_expandableBox').css("background-image", icon_up);
-		   $('#tripal_expandableBox_toggle_button').html('[-] Collapse All');
-	   }
-   }
-   //------------------------------------------------------------
    function tripal_get_base_url() {
 
        // Get the base url. Drupal can not pass it through a form so we need 
-	     // to get it ourself. Use different patterns to match the url in case
+       // to get it ourself. Use different patterns to match the url in case
        // the Clean URL function is turned on
        var baseurl = location.href.substring(0,location.href.lastIndexOf('/?q=/node'));
        if(!baseurl) {

+ 46 - 69
tripal_core/theme/node--chado-generic.tpl.php

@@ -32,21 +32,7 @@ else { ?>
       } 
       // use default resource sidebar
       else { ?>        
-        $(".tripal-info-box").hide();
-
-        // set the widths of the details and sidebar sections so they can work 
-        // seemlessly with any theme.
-        total_width = $(".tripal_contents").width();
-        details_width = (total_width * 0.70) - 52; // 52 == 20  x 2 left/right padding + 10 right margin + 2pt border
-        toc_width = (total_width * 0.30) - 42;  // 42 == 20 x 2 left/right padding + 2pt border
-        // don't let sidebar get wider than 200px
-        if (toc_width > 200) {
-          details_width += toc_width - 200;
-          toc_width = 200;
-        }
-        $('#tripal_<?php print $ttype?>_toc').width(toc_width);
-        $('#tripal_<?php print $ttype?>_details').width(details_width);
-        <?php
+        $(".tripal-info-box").hide(); <?php
       } ?>
  
       // iterate through all of the info boxes and add their titles
@@ -72,9 +58,7 @@ else { ?>
           //alert("fixed: " + href);
         }
         $(href).fadeIn('slow');
-        // we want to make sure our table of contents and the details
-        // box stay the same height
-        $("#tripal_<?php print $ttype?>_toc").height($(href).parent().height());
+
         return false;
       }); 
 
@@ -90,64 +74,57 @@ else { ?>
       else {
         $("#tripal_<?php print $ttype?>-base-box").show();
       }
-
-      // make sure the sidebar and details sections are the same hieght
-      base_height = $("#tripal_<?php print $ttype?>_details").height();
-      toc_height = $("#tripal_<?php print $ttype?>_toc").height();
-      if (toc_height > base_height) {
-        $("#tripal_<?php print $ttype?>_details").height(toc_height);
-      }
-      else {
-        $("#tripal_<?php print $ttype?>_toc").height(base_height);
-      }
     }
   };
 })(jQuery);
 </script>
 
 <div id="tripal_<?php print $ttype?>_content" class="tripal_contents">
-  <div id="tripal_<?php print $ttype?>_details" class="tripal_details">
-  
-     <!-- Resource Blocks CCK elements --> <?php
-     if (property_exists($node, 'field_resource_titles')) {
-       for ($i = 0; $i < count($node->field_resource_titles); $i++){
-         if ($node->field_resource_titles[$i]['value']){ ?>
-           <div id="tripal_<?php print $ttype?>-resource_<?php print $i?>-box" class="tripal_<?php print $ttype?>-info-box tripal-info-box">
-             <div class="tripal_<?php print $ttype?>-info-box-title tripal-info-box-title"><?php print $node->field_resource_titles[$i]['value'] ?></div>
-             <?php print $node->field_resource_blocks[$i]['value']; ?>
-           </div> <?php
-         }
-       } 
-     }?>
-     <!-- Let modules add more content -->
-     <?php
-       foreach ($content as $key => $values) {
-         if (array_key_exists('#value', $values)) {
-           print $content[$key]['#value'];
-         }
-       }
-     ?>
-     
-  </div>
-  
-  <!-- Table of contents -->
-  <div id="tripal_<?php print $ttype?>_toc" class="tripal_toc">
-     <div id="tripal_<?php print $ttype?>_toc_title" class="tripal_toc_title">Resources</i></div>
-     <span id="tripal_<?php print $ttype?>_toc_desc" class="tripal_toc_desc"></span>
-     <ul id="tripal_<?php print $ttype?>_toc_list" class="tripal_toc_list">
-     
-       <!-- Resource Links CCK elements --><?php
-       if(property_exists($node, 'field_resource_links')) {
-         for($i = 0; $i < count($node->field_resource_links); $i++){
-           if($node->field_resource_links[$i]['value']){
-             $matches = preg_split("/\|/",$node->field_resource_links[$i]['value']);?>
-             <li><a href="<?php print $matches[1] ?>" target="_blank"><?php print $matches[0] ?></a></li><?php
+  <table id="tripal_contents_table">
+    <tr class="tripal_contents_table_tr">
+      <td nowrap class="tripal_contents_table_td"  align="left">
+        <div id="tripal_<?php print $ttype?>_toc" class="tripal_toc">
+          <ul id="tripal_<?php print $ttype?>_toc_list" class="tripal_toc_list">
+          
+           <!-- Resource Links CCK elements --><?php
+           if(property_exists($node, 'field_resource_links')) {
+             for($i = 0; $i < count($node->field_resource_links); $i++){
+               if($node->field_resource_links[$i]['value']){
+                 $matches = preg_split("/\|/",$node->field_resource_links[$i]['value']);?>
+                 <li><a href="<?php print $matches[1] ?>" target="_blank"><?php print $matches[0] ?></a></li><?php
+               }
+             }
            }
-         }
-       }
-       ?> 
-     </ul>
-  </div>
+           ?> 
+            </ul>
+          </div>
+        </td>
+        <td class="tripal_contents_table_td" align="left" width="100%">
+          <div id="tripal_<?php print $ttype?>_details" class="tripal_details">
+        
+           <!-- Resource Blocks CCK elements --> <?php
+           if (property_exists($node, 'field_resource_titles')) {
+             for ($i = 0; $i < count($node->field_resource_titles); $i++){
+               if ($node->field_resource_titles[$i]['value']){ ?>
+                 <div id="tripal_<?php print $ttype?>-resource_<?php print $i?>-box" class="tripal_<?php print $ttype?>-info-box tripal-info-box">
+                   <div class="tripal_<?php print $ttype?>-info-box-title tripal-info-box-title"><?php print $node->field_resource_titles[$i]['value'] ?></div>
+                   <?php print $node->field_resource_blocks[$i]['value']; ?>
+                 </div> <?php
+               }
+             } 
+           }?>
+           <!-- Let modules add more content -->
+           <?php
+             foreach ($content as $key => $values) {
+               if (array_key_exists('#value', $values)) {
+                 print $content[$key]['#value'];
+               }
+             }
+           ?>
+        </div>
+      </td>
+    </tr>
+  </table>
 </div> 
 <?php 
 } ?>