PageRenderTime 45ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/bio/webapp/resources/webapp/model/mouseAllelesDisplayer.jsp

https://gitlab.com/jsr38/intermine
JavaServer Pages | 142 lines | 132 code | 10 blank | 0 comment | 8 complexity | 46b3f176ce5a01d078ef79c059defd03 MD5 | raw file
  1. <%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
  2. <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
  3. <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
  4. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
  5. <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
  6. <%@ taglib uri="/WEB-INF/functions.tld" prefix="imf" %>
  7. <!-- mouseAllelesDisplayer.jsp -->
  8. <div class="collection-of-collections" id="mouse-alleles">
  9. <style>
  10. #mouse-alleles span.size-1 { font-size:10px; }
  11. #mouse-alleles span.size-2 { font-size:14px; }
  12. #mouse-alleles span.size-3 { font-size:22px; }
  13. #mouse-alleles div.header h3 { border:0; }
  14. #mouse-alleles ul li { display:inline; }
  15. #mouse-alleles ul li:not(:last-child) { margin-right:10px; }
  16. #mouse-alleles ul li:not(.top) { display:none; }
  17. #mouse-alleles ul li a span { display:none; }
  18. #mouse-alleles div.toggle { margin:0 auto; margin-bottom:20px; text-align:center; }
  19. #mouse-alleles div.inline-list { margin:0; }
  20. #mouse-alleles-collection { margin-top:20px; }
  21. </style>
  22. <div class="header">
  23. <h3>Mouse Allele Phenotypes</h3>
  24. <c:choose>
  25. <c:when test="${isThisAMouser}">
  26. <p><img class="tinyQuestionMark" src="images/icons/information-small-blue.png" alt="?"> Most frequent phenotypes associated with the mouse alleles (MGI) by gene</p>
  27. </c:when>
  28. <c:otherwise>
  29. <p><img class="tinyQuestionMark" src="images/icons/information-small-blue.png" alt="?"> From the mouse orthologue(s), most frequent phenotypes associated with the mouse alleles (MGI) of this gene</p>
  30. </c:otherwise>
  31. </c:choose>
  32. </div>
  33. <c:choose>
  34. <c:when test="${not empty counts}">
  35. <c:forEach var="homologue" items="${counts}">
  36. <c:if test="${not homologue.value['isMouser']}">
  37. <div class="header"><h3>${homologue.key} Mouse Homologue with ${homologue.value['alleleCount']} alleles</h3></div>
  38. </c:if>
  39. <div class="inline-list">
  40. <ul>
  41. <c:forEach var="term" items="${homologue.value['terms']}">
  42. <li <c:if test="${term.value.top}">class="top"</c:if>>
  43. <span class="size-<c:choose>
  44. <c:when test="${term.value.count < 2}">1</c:when>
  45. <c:when test="${term.value.count < 5}">2</c:when>
  46. <c:otherwise>3</c:otherwise>
  47. </c:choose>"><html:link action="/loadQuery.do">
  48. <span>${term.value.url}</span> ${term.key}</html:link> (${term.value.count})</span>
  49. </li>
  50. </c:forEach>
  51. </ul>
  52. </div>
  53. <div class="toggle"><a class="more" title="Show more terms">Show more terms</a></div>
  54. </c:forEach>
  55. </c:when>
  56. <c:otherwise>
  57. <c:choose>
  58. <c:when test="${alleleCount != 1}">
  59. <p style="font-style:italic;">No data found for ${alleleCount} alleles</p>
  60. </c:when>
  61. <c:otherwise>
  62. <p style="font-style:italic;">No data found for 1 allele</p>
  63. </c:otherwise>
  64. </c:choose>
  65. </c:otherwise>
  66. </c:choose>
  67. <script type="text/javascript">
  68. jQuery("#mouse-alleles div.toggle a").click(function() {
  69. jQuery('#mouse-alleles ul li').css('display', 'inline');
  70. jQuery("#mouse-alleles div.toggle").remove();
  71. });
  72. jQuery("#mouse-alleles ul li a").each(function() {
  73. var span = jQuery(this).find('span');
  74. var xml = encodeURIComponent(span.html());
  75. jQuery(this).attr('href', jQuery(this).attr('href') + "?skipBuilder=true&method=xml&trail=%7Cquery&query=" + xml);
  76. });
  77. </script>
  78. </div>
  79. <c:if test="${collection != null}">
  80. <div id="mouse-alleles-collection" class="collection-table">
  81. <div class="header">
  82. <h3>Mouse Alleles </h3>
  83. <p><img class="tinyQuestionMark" src="images/icons/information-small-blue.png" alt="?"> Most frequent phenotypes associated with the mouse alleles (MGI) by gene</p>
  84. </div>
  85. <c:set var="inlineResultsTable" value="${collection}" />
  86. <tiles:insert page="/reportCollectionTable.jsp">
  87. <tiles:put name="inlineResultsTable" beanName="inlineResultsTable" />
  88. <tiles:put name="object" beanName="reportObject.object" />
  89. <tiles:put name="fieldName" value="alleles" />
  90. </tiles:insert>
  91. <div class="toggle">
  92. <a class="more" style="float:right;"><span>Show more rows</span></a>
  93. </div>
  94. <div class="show-in-table">
  95. <html:link action="/collectionDetails?id=${reportObject.object.id}&amp;field=alleles&amp;trail=${param.trail}">
  96. Show all in a table &raquo;
  97. </html:link>
  98. </div>
  99. </div>
  100. <script type="text/javascript">
  101. (function() {
  102. var bodyRows = jQuery("#mouse-alleles-collection.collection-table table tbody tr");
  103. if (bodyRows.length > 10) {
  104. bodyRows.each(function(i) {
  105. if (i > 9) {
  106. jQuery(this).hide();
  107. }
  108. });
  109. jQuery("#mouse-alleles-collection.collection-table div.toggle").show();
  110. jQuery('#mouse-alleles-collection.collection-table div.toggle a.more').click(function(e) {
  111. jQuery("#mouse-alleles-collection.collection-table table tbody tr:hidden").each(function(i) {
  112. if (i < 10) {
  113. jQuery(this).show();
  114. }
  115. });
  116. jQuery("#mouse-alleles-collection.collection-table div.toggle a.less").show();
  117. if (jQuery("#mouse-alleles-collection.collection-table table tbody tr:hidden").length == 0) {
  118. jQuery('#mouse-alleles-collection.collection-table div.toggle a.more').hide();
  119. }
  120. });
  121. }
  122. jQuery('#mouse-alleles-collection input.toggle-table').click(function() {
  123. jQuery('#mouse-alleles-collection.collection-table').toggle();
  124. if (jQuery('#mouse-alleles-collection.collection-table:visible')) {
  125. jQuery("#mouse-alleles-collection.collection-table").scrollTo('fast', 'swing', -20);
  126. jQuery(this).hide();
  127. }
  128. });
  129. })();
  130. </script>
  131. </c:if>
  132. <!-- /mouseAllelesDisplayer.jsp -->