node-chado_feature.tpl.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <?php
  2. // Purpose: This template provides the layout of the feature node (page)
  3. // using the same templates used for the various feature content blocks.
  4. //
  5. // To Customize the Featture Node Page:
  6. // - This Template: customize basic layout and which elements are included
  7. // - Using Panels: Override the node page using Panels3 and place the blocks
  8. // of content as you please. This method requires no programming. See
  9. // the Tripal User Guide for more details
  10. // - Block Templates: customize the content/layout of each block of stock
  11. // content. These templates are found in the tripal_stock subdirectory
  12. //
  13. // Variables Available:
  14. // - $node: a standard object which contains all the fields associated with
  15. // nodes including nid, type, title, taxonomy. It also includes stock
  16. // specific fields such as stock_name, uniquename, stock_type, synonyms,
  17. // properties, db_references, object_relationships, subject_relationships,
  18. // organism, etc.
  19. // NOTE: For a full listing of fields available in the node object the
  20. // print_r $node line below or install the Drupal Devel module which
  21. // provides an extra tab at the top of the node page labelled Devel
  22. ?>
  23. <?php
  24. //uncomment this line to see a full listing of the fields avail. to $node
  25. //print '<pre>'.print_r($variables,TRUE).'</pre>';
  26. $feature = $variables['node']->feature;
  27. ?>
  28. <?php if ($teaser) {
  29. include('tripal_feature/tripal_feature_teaser.tpl.php');
  30. } else { ?>
  31. <script type="text/javascript">
  32. if (Drupal.jsEnabled) {
  33. $(document).ready(function() {
  34. // hide all tripal info boxes at the start
  35. $(".tripal-info-box").hide();
  36. // iterate through all of the info boxes and add their titles
  37. // to the table of contents
  38. $(".tripal-info-box-title").each(function(){
  39. var parent = $(this).parent();
  40. var id = $(parent).attr('id');
  41. var title = $(this).text();
  42. $('#tripal_feature_toc_list').append('<li><a href="#'+id+'" class="tripal_feature_toc_item">'+title+'</a></li>');
  43. });
  44. // when a title in the table of contents is clicked, then
  45. // show the corresponding item in the details box
  46. $(".tripal_feature_toc_item").click(function(){
  47. $(".tripal-info-box").hide();
  48. href = $(this).attr('href');
  49. $(href).fadeIn('slow');
  50. // we want to make sure our table of contents and the details
  51. // box stay the same height
  52. $("#tripal_feature_toc").height($(href).parent().height());
  53. return false;
  54. });
  55. // we want the base details to show up when the page is first shown
  56. $("#tripal_feature-base-box").show();
  57. $("#tripal_organism_toc").height($("#tripal_feature-base-box").parent().height());
  58. });
  59. }
  60. </script>
  61. <style type="text/css">
  62. /* these styles are specific for this template and is not included
  63. in the main CSS files for the theme as it is anticipated that the
  64. elements on this page may not be used for other customizations */
  65. #tripal_feature_toc {
  66. float: left;
  67. width: 20%;
  68. background-color: #EEEEEE;
  69. -moz-border-radius: 15px;
  70. border-radius: 15px;
  71. -moz-box-shadow: 3px 3px 4px #000;
  72. -webkit-box-shadow: 3px 3px 4px #000;
  73. box-shadow: 3px 3px 4px #000;
  74. padding: 20px;
  75. min-height: 500px;
  76. border-style:solid;
  77. border-width:1px;
  78. }
  79. #tripal_feature_toc ul {
  80. margin-left: 0px;
  81. margin-top: 5px;
  82. padding-left: 15px;
  83. }
  84. #tripal_feature_toc_title {
  85. font-size: 1.5em;
  86. line-height: 110%;
  87. }
  88. #tripal_feature_toc_desc {
  89. font-style: italic;
  90. }
  91. #tripal_feature_details {
  92. float: left;
  93. width: 70%;
  94. background-color: #FFFFFF;
  95. -moz-border-radius: 15px;
  96. border-radius: 15px;
  97. -moz-box-shadow: 3px 3px 4px #000;
  98. -webkit-box-shadow: 3px 3px 4px #000;
  99. box-shadow: 3px 3px 4px #000;
  100. padding: 20px;
  101. min-height: 500px;
  102. margin-right: 10px;
  103. margin-bottom: 10px;
  104. border-style:solid;
  105. border-width:1px;
  106. }
  107. </style>
  108. <div id="tripal_feature_details">
  109. <!-- Basic Details Theme -->
  110. <?php include('tripal_feature/tripal_feature_base.tpl.php'); ?>
  111. <!-- Database References -->
  112. <?php include('tripal_feature/tripal_feature_references.tpl.php'); ?>
  113. <!-- Properties -->
  114. <?php include('tripal_feature/tripal_feature_properties.tpl.php'); ?>
  115. <!-- Synonyms -->
  116. <?php include('tripal_feature/tripal_feature_synonyms.tpl.php'); ?>
  117. <!-- Sequence -->
  118. <?php include('tripal_feature/tripal_feature_sequence.tpl.php'); ?>
  119. <!-- Formatted Sequences -->
  120. <?php include('tripal_feature/tripal_feature_featureloc_sequences.tpl.php'); ?>
  121. <!-- Object Relationships -->
  122. <?php include('tripal_feature/tripal_feature_relationships_as_object.tpl.php'); ?>
  123. <!-- Subject Relationships -->
  124. <?php include('tripal_feature/tripal_feature_relationships_as_subject.tpl.php'); ?>
  125. <!-- Feature locations as Child -->
  126. <?php include('tripal_feature/tripal_feature_featurelocs_as_child.tpl.php'); ?>
  127. <!-- Subject Relationships -->
  128. <?php include('tripal_feature/tripal_feature_featurelocs_as_parent.tpl.php'); ?>
  129. <?php print $content ?>
  130. </div>
  131. <!-- Table of contents -->
  132. <div id="tripal_feature_toc">
  133. <div id="tripal_feature_toc_title">Resources for <?php print $feature->cvname?><br><?php print $feature->featurename ?></div>
  134. <span id="tripal_feature_toc_desc">Select a link below for more information</span>
  135. <ul id="tripal_feature_toc_list">
  136. </ul>
  137. </div>
  138. <?php } ?>