about summary refs log tree commit diff
path: root/wqflask
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/static/new/javascript/show_trait.js11
-rw-r--r--wqflask/wqflask/templates/show_trait.html9
2 files changed, 18 insertions, 2 deletions
diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js
index d09fbee9..c5214947 100644
--- a/wqflask/wqflask/static/new/javascript/show_trait.js
+++ b/wqflask/wqflask/static/new/javascript/show_trait.js
@@ -83,7 +83,16 @@ statTableRows.push(
   }
 );
 
-var add, blockByAttributeValue, blockByIndex, blockOutliers, changeStatsValue, createValueDropdown, editDataChange, exportSampleTableData, getSampleTableData, hideNoValue, hideTabs, makeTable, onCorrMethodChange, openTraitSelection, populateSampleAttributesValuesDropdown, processId, updateBarChart, updateHistogram, updateProbPlot, resetSamplesTable, sampleGroupTypes, sampleLists, showHideOutliers, statsMdpChange, updateStatValues;
+toggleDescription = function() {
+  if ($('.truncDesc').is(':visible')) {
+    $('.truncDesc').hide();
+    $('.fullDesc').show();
+  } else {
+    $('.truncDesc').show();
+    $('.fullDesc').hide();
+  }
+}
+
 add = function() {
   var trait;
   trait = $("input[name=trait_hmac]").val();
diff --git a/wqflask/wqflask/templates/show_trait.html b/wqflask/wqflask/templates/show_trait.html
index aff12571..dd054ffc 100644
--- a/wqflask/wqflask/templates/show_trait.html
+++ b/wqflask/wqflask/templates/show_trait.html
@@ -24,7 +24,14 @@
     <div class="container">
       <h2>Trait Data and Analysis for <b>{{ this_trait.display_name }}</b></h2>
       {% if this_trait.dataset.type != 'Publish' %}
-	<h3>{{ this_trait.description_fmt[0]|upper }}{{ this_trait.description_fmt[1:]|safe }}</h3>
+	    <h3>
+        {% set trait_description = this_trait.description_fmt[0]|upper + this_trait.description_fmt[1:]|safe %}
+        {% if trait_description|length < 100 %}
+        {{ trait_description }}
+        {% else %}
+        <span class="truncDesc" style="display: block;">{{ trait_description[:99] }}... (<a onclick="toggleDescription()" href="#">Show More</a>)</span><span class="fullDesc" style="display: none;">{{ trait_description }} (<a onclick="toggleDescription()" href="#">Show Less</a>)</span>
+        {% endif %}
+      </h3>
       {% endif %}
 
       <form method="post" action="" target="_blank" name="trait_page" id="trait_data_form" class="form-horizontal">