Browse Source

Fixed missing Feature Browser

spficklin 14 năm trước cách đây
mục cha
commit
5121a61fbf

+ 8 - 6
theme_tripal/node-chado_organism.tpl.php

@@ -59,8 +59,13 @@ if (Drupal.jsEnabled) {
          return false;
       }); 
 
-      // we want the base details to show up when the page is first shown
-      $("#tripal_organism-base-box").show();
+      // we want the base details to show up when the page is first shown 
+      // unless we're using the feature browser then we want that page to show
+      if(window.location.href.match(/\?page=\d+/)){
+         $("#tripal_organism-feature_browser-box").show();
+      } else {
+         $("#tripal_organism-base-box").show();
+      }
       $("#tripal_organism_toc").height($("#tripal_organism-base-box").parent().height());
    });
 }
@@ -117,7 +122,7 @@ if (Drupal.jsEnabled) {
   }
   #tripal_organism-table-base {
     float: left;
-    width: 400px;
+    width: 330px;
     margin-left: 10px;
     margin-bottom: 10px;
   }
@@ -129,9 +134,6 @@ if (Drupal.jsEnabled) {
    <!-- Basic Details Theme -->
    <?php include('tripal_organism/tripal_organism_base.tpl.php'); ?>
 
-   <!-- Feature Browser -->
-   <?php include('tripal_organism/tripal_organism_feature_browser.tpl.php'); ?>
-
    <?php print $content ?>
 </div>
 

+ 9 - 2
theme_tripal/tripal_organism/tripal_organism_feature_browser.tpl.php

@@ -2,6 +2,9 @@
 $organism = $variables['node']->organism;
 $features = $variables['tripal_feature']['browser']['features'];
 $pager = $variables['tripal_feature']['browser']['pager'];
+$enabled = $variables['tripal_feature']['browser']['enabled'];
+
+if($enabled == 'show_feature_browser'){
 ?>
 <div id="tripal_organism-feature_browser-box" class="tripal_organism-info-box tripal-info-box">
   <div class="tripal_organism-info-box-title tripal-info-box-title">Feature Browser</div>
@@ -36,10 +39,14 @@ $pager = $variables['tripal_feature']['browser']['pager'];
       $i++;  
     } ?>
    </table>
-  <?php } ?>
+  <?php } else {?>
+    <div class="tripal-no-results">There are no features available for browsing</div> 
+  <?php }?>
   <?php print $pager ?>
-
 </div>
+<?php 
+} 
+?>