فهرست منبع

Fixed organism and feature default templates to handle using a teaser.tpl.php

laceysanderson 14 سال پیش
والد
کامیت
095f7e6d76

+ 7 - 0
theme_tripal/node-chado_feature.tpl.php

@@ -26,6 +26,11 @@
  //print '<pre>'.print_r($variables,TRUE).'</pre>';
 $feature  = $variables['node']->feature;
 ?>
+
+<?php if ($teaser) { 
+  include('tripal_feature/tripal_feature_teaser.tpl.php'); 
+} else { ?>
+
 <script type="text/javascript">
 if (Drupal.jsEnabled) {
    $(document).ready(function() {
@@ -156,3 +161,5 @@ if (Drupal.jsEnabled) {
 
    </ul>
 </div>
+
+<?php } ?>

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

@@ -27,6 +27,11 @@
 $node = $variables['node'];
 $organism = $variables['node']->organism;
 ?>
+
+<?php if ($teaser) { 
+  include('tripal_organism/tripal_organism_teaser.tpl.php'); 
+} else { ?>
+
 <script type="text/javascript">
 if (Drupal.jsEnabled) {
    $(document).ready(function() {
@@ -139,4 +144,4 @@ if (Drupal.jsEnabled) {
    </ul>
 </div>
 
-
+<?php } ?>

+ 51 - 0
theme_tripal/tripal_feature/tripal_feature_teaser.tpl.php

@@ -0,0 +1,51 @@
+<?php
+
+$feature  = $variables['node']->feature;
+$accession = $variables['node']->accession;
+$organism = $variables['node']->organism;
+$org_nid = $variables['node']->org_nid;
+
+?>
+<div id="tripal_feature-base-box" class="tripal_feature-info-box tripal-info-box">
+  <div class="tripal_feature-info-box-title tripal-info-box-title">
+    <?php print l($feature->featurename, 'node/'.$node->nid); ?>
+  </div>
+  <div class="tripal_feature-info-box-desc tripal-info-box-desc"></div>
+
+   <?php if($feature->is_obsolete == 't'){ ?>
+      <div class="tripal_feature-obsolete">This feature is obsolete and no longer used in analysis, but is here for reference</div>
+   <?php }?>
+   <table id="tripal_feature-base-table" class="tripal_feature-table tripal-table tripal-table-vert">
+      <tr class="tripal_feature-table-odd-row tripal-table-even-row">
+        <th>Name</th>
+        <td><?php print $feature->featurename; ?></td>
+      </tr>
+      <tr class="tripal_feature-table-odd-row tripal-table-odd-row">
+        <th nowrap>Unique Name</th>
+        <td><?php print $feature->uniquename; ?></td>
+      </tr>
+      <tr class="tripal_feature-table-odd-row tripal-table-even-row">
+        <th>Internal ID</th>
+        <td><?php print $accession; ?></td>
+      </tr>
+      <tr class="tripal_feature-table-odd-row tripal-table-odd-row">
+        <th>Length</th>
+        <td><?php print $feature->seqlen ?></td>
+      </tr>
+      <tr class="tripal_feature-table-odd-row tripal-table-even-row">
+        <th>Type</th>
+        <td><?php print $feature->cvname; ?></td>
+      </tr>
+      <tr class="tripal_feature-table-odd-row tripal-table-odd-row">
+        <th>Organism</th>
+        <td>
+          <?php if ($node->org_nid) { ?>
+      	   <a href="<?php print url("node/$org_nid") ?>"><?php print $organism->genus ." " . $organism->species ." (" .$organism->common_name ." )"?></a>
+      	 <?php 
+          } else { 
+            print $organism->genus ." " . $organism->species ." (" .$organism->common_name ." )";
+          } ?>
+        </td>
+     	</tr>           	                                
+   </table>
+</div>

+ 27 - 0
theme_tripal/tripal_organism/tripal_organism_teaser.tpl.php

@@ -0,0 +1,27 @@
+<?php
+$organism = $variables['node']->organism;
+?>
+<div id="tripal_organism-base-box" class="tripal_organism-info-box tripal-info-box">
+  <div class="tripal_organism-info-box-title tripal-info-box-title">
+    <?php print l($organism->common_name . ' ('.$organism->genus.' '.$organism->species.')', 'node/'.$node->nid); ?>
+  </div>
+  <div class="tripal_organism-info-box-desc tripal-info-box-desc"></div>
+   <table id="tripal_organism-table-base" class="tripal_organism-table tripal-table tripal-table-vert">
+      <tr class="tripal_organism-table-odd-row tripal-table-even-row">
+        <th>Common Name</th>
+        <td><?php print $organism->common_name; ?></td>
+      </tr>
+      <tr class="tripal_organism-table-odd-row tripal-table-odd-row">
+        <th>Genus</th>
+        <td><?php print $organism->genus; ?></td>
+      </tr>
+      <tr class="tripal_organism-table-odd-row tripal-table-even-row">
+        <th>Species</th>
+        <td><?php print $organism->species; ?></td>
+      </tr>
+      <tr class="tripal_organism-table-odd-row tripal-table-odd-row">
+        <th>Abbreviation</th>
+        <td><?php print $organism->abbreviation; ?></td>
+      </tr>         	                                
+   </table>
+</div>

+ 2 - 2
theme_tripal/tripal_stock/tripal_stock_base.tpl.php

@@ -24,7 +24,7 @@
  //print '<pre>'.print_r($node,TRUE).'</pre>';
 ?>
 
-<?php $organism = $node->organism; ?>
+<?php $organism = $node->organism->organism; ?>
 
 <div id="tripal_stock-base-box" class="tripal_stock-info-box tripal-info-box">
   <div class="tripal_stock-info-box-title tripal-info-box-title">Stock Details</div>
@@ -69,7 +69,7 @@
       <tr class="tripal_stock-table-odd-row tripal-table-even-row">
         <th>Organism</th>
         <td>
-          <?php if ($organism->nid) { ?>
+          <?php if ($node->organism->nid) { ?>
       	   <a href="<?php print url("node/$organism->nid") ?>"><?php print $organism->genus ." " . $organism->species ." (" .$organism->common_name ." )"?></a>
       	 <?php 
           } else { 

+ 2 - 2
theme_tripal/tripal_stock/tripal_stock_teaser.tpl.php

@@ -24,7 +24,7 @@
  //print '<pre>'.print_r($node,TRUE).'</pre>';
 ?>
 
-<?php $organism = $node->organism; ?>
+<?php $organism = $node->organism->organism; ?>
 
 <div id="tripal_stock-base-box" class="tripal_stock-info-box tripal-info-box">
   <div class="tripal_stock-info-box-title tripal-info-box-title">
@@ -71,7 +71,7 @@
       <tr class="tripal_stock-table-odd-row tripal-table-even-row">
         <th>Organism</th>
         <td>
-          <?php if ($organism->nid) { ?>
+          <?php if ($node->organism->nid) { ?>
       	   <a href="<?php print url("node/$organism->nid") ?>"><?php print $organism->genus ." " . $organism->species ." (" .$organism->common_name ." )"?></a>
       	 <?php 
           } else {