study.html 8.24 KB
Newer Older
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
1
2
3
4
<!DOCTYPE html>

<html
  xmlns:th="http://www.thymeleaf.org"
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
5
  th:replace="~{layout/main :: layout(title=~{::title}, content=~{::main}, script=~{::script})}"
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
6
7
8
9
10
11
12
13
14
15
>
<head>
  <title>Study <th:block th:text="${model.study.studyType}" />: <th:block th:text="${model.study.studyName}" /></title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>

<body>
<main>
  <h1>Study <th:block th:text="${model.study.studyType}" />: <th:block th:text="${model.study.studyName}" /></h1>

Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
16
17
  <div th:replace="fragments/map::map"></div>

Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
  <div class="f-card mt-4">
    <h2>Identification</h2>
    <div class="f-card-body">
      <div th:replace="fragments/row::text-row(label='Name', text=${model.study.studyName})"></div>
      <div th:replace="fragments/row::text-row(label='Identifier', text=${model.study.studyDbId})"></div>

      <div th:replace="fragments/source::source(source=${model.source}, url=${model.study.url}, entityType='study')"></div>

      <div th:replace="fragments/row::text-row(label='Project name', text=${model.study.programName})"></div>
      <div th:replace="fragments/row::text-row(label='Description', text=${model.study.studyDescription})"></div>
      <th:block th:if="${model.study.active != null}">
        <div th:replace="fragments/row::text-row(label='Active', text=${model.study.active ? 'Yes' : 'No'})"></div>
      </th:block>

      <th:block th:unless="${#lists.isEmpty(model.study.seasons)}">
        <div th:replace="fragments/row::text-row(label='Seasons', text=${#strings.listJoin(model.study.seasons, ',')})"></div>
      </th:block>
      <th:block th:if="${model.study.startDate != null && model.study.endDate != null}">
        <div th:replace="fragments/row::text-row(label='Date', text=${'From ' + #dates.format(model.study.startDate, 'yyyy-MM-dd') + ' to ' + #dates.format(model.study.endDate, 'yyyy-MM-dd') })"></div>
      </th:block>
      <th:block th:if="${model.study.startDate != null && model.study.endDate == null}">
        <div th:replace="fragments/row::text-row(label='Date', text=${'Started on ' + #dates.format(model.study.startDate, 'yyyy-MM-dd')})"></div>
      </th:block>

      <th:block th:if="${model.study.locationDbId}">
        <div th:replace="fragments/row::row(label='Location name', content=~{::#location})">
          <a id="location" th:href="@{/sites/{siteId}(siteId=${model.study.locationDbId})}" th:text="${model.study.locationName}"></a>
        </div>
      </th:block>

      <th:block th:unless="${#lists.isEmpty(model.study.dataLinks)}">
        <div th:replace="fragments/row::row(label='Data files', content=~{::#data-files})">
          <ul id="data-files" class="list-unstyled">
            <li th:each="dataLink : ${model.study.dataLinks}">
              <a target="_blank" th:href="${dataLink.url}" th:text="${dataLink.name}"></a>
            </li>
          </ul>
        </div>
      </th:block>
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
57
    </div>
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
58
  </div>
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
59

Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
60
  <div class="f-card" th:unles="${#lists.isEmpty(model.germplasms)}">
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
61
    <h2>Genotype</h2>
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
62
63
64
    <div class="f-card-body">
      <div class="scroll-table-container scroll-table-container-big">
        <table class="table table-sm table-striped table-sticky table-responsive-sm">
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
          <thead>
            <tr>
              <th scope="col">Accession number</th>
              <th scope="col">Name</th>
              <th scope="col">Taxon</th>
            </tr>
          </thead>
          <tbody>
            <tr th:each="row : ${model.germplasms}">
              <td>
                <a th:href="@{/germplasms/{germplasmId}(germplasmId=${row.germplasmDbId})}" th:text="${row.accessionNumber}"></a>
              </td>
              <td th:text="${row.germplasmName}"></td>
              <td th:text="${(row.genus == null ? '' : row.genus) + ' ' + (row.species == null ? '' : row.species)+ ' ' + (row.subtaxa == null ? '' : row.subtaxa) }"></td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
84
  </div>
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
85

Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
86
  <div class="f-card" th:unless="${#lists.isEmpty(model.variables)}">
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
87
    <h2>Variables</h2>
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
88
89
90
    <div class="f-card-body">
      <div class="scroll-table-container">
        <table class="table table-sm table-striped table-sticky table-responsive-sm">
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
          <thead>
            <tr>
              <th scope="col">Variable ID</th>
              <th scope="col">Variable short name</th>
              <th scope="col">Variable long name</th>
              <th scope="col">Ontology name</th>
              <th scope="col">Trait description</th>
            </tr>
          </thead>
          <tbody>
            <tr th:each="row : ${model.variables}">
              <td>
                <a th:unless="${#strings.isEmpty(row.documentationURL)}" th:href="${row.documentationURL}" th:text="${row.observationVariableDbId}" target="_blank" ></a>
                <span th:if="${#strings.isEmpty(row.documentationURL)}" th:text="${row.observationVariableDbId}"></span>
              </td>
              <td th:text="${row.name}"></td>
              <td th:text="${#lists.isEmpty(row.synonyms) ? '' : row.synonyms[0]}"></td>
              <td th:text="${row.ontologyName}"></td>
              <td th:text="${row.trait.description}"></td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
115
  </div>
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
116

Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
117
  <div class="f-card" th:unless="${#lists.isEmpty(model.trials)}">
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
118
    <h2>Data Set</h2>
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
119
120
121
    <div class="f-card-body">
      <div class="scroll-table-container scroll-table-container-big">
        <table class="table table-sm table-striped table-sticky table-responsive-sm">
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
          <thead>
            <tr>
              <th scope="col">Name</th>
              <th scope="col">Type</th>
              <th scope="col">Linked studies identifier</th>
            </tr>
          </thead>
          <tbody>
            <tr th:each="row : ${model.trials}">
              <td>
                <a th:unless="${#strings.isEmpty(row.documentationURL)}" th:href="${row.documentationURL}" th:text="${row.trialName}" target="_blank" ></a>
                <span th:if="${#strings.isEmpty(row.documentationURL)}" th:text="${row.trialName}"></span>
              </td>
              <td th:text="${row.trialType}"></td>
              <td style="width: 60%">
                <th:block th:each="trialStudy, iterStat : ${row.studies}"
                          th:if="${trialStudy.studyDbId != model.study.studyDbId}">
                  <a th:href="@{/studies/{studyId}(studyId=${trialStudy.studyDbId})}"
                     th:text="${trialStudy.studyName.trim()}">
                  </a><th:block th:if="${iterStat.last}">; </th:block>
                </th:block>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
149
  </div>
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
150

Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
151
  <div class="f-card" th:unless="${#lists.isEmpty(model.study.contacts)}">
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
152
    <h2>Contact</h2>
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
153
154
155
    <div class="f-card-body">
      <div class="scroll-table-container">
        <table class="table table-sm table-striped table-sticky table-responsive-sm">
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
          <thead>
            <tr>
              <th scope="col">Role</th>
              <th scope="col">Name</th>
              <th scope="col">Email</th>
              <th scope="col">Institution</th>
            </tr>
          </thead>
          <tbody>
            <tr th:each="row : ${model.study.contacts}">
              <td th:text="${row.type}"></td>
              <td th:text="${row.name}"></td>
              <td th:text="${row.email}"></td>
              <td th:text="${row.institutionName}"></td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
175
  </div>
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
176

Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
177
  <div class="f-card" th:unless="${#lists.isEmpty(model.additionalInfoProperties)}">
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
178
    <h2>Additional information</h2>
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
179
180
181
    <div class="f-card-body">
      <div class="scroll-table-container">
        <table class="table table-sm">
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
182
183
          <tbody>
            <tr th:each="row : ${model.additionalInfoProperties}">
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
184
              <th class="label" style="width: 33.33%" th:text="${row.key}" scope="row"></th>
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
185
186
187
188
189
190
              <td th:text="${row.value}"></td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
191
  </div>
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
192
193
194

  <div th:replace="fragments/xrefs::xrefs(crossReferences=${model.crossReferences})"></div>
</main>
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
195
196
197
198

<script th:inline="javascript">
  faidare.initializeMap({
    contextPath: [[${#request.getContextPath()}]],
Exbrayat Cédric's avatar
Exbrayat Cédric committed
199
    locations: /* TODO [[${model.mapLocations}]]*/ []
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
200
201
  });
</script>
Jean-Baptiste Nizet's avatar
Jean-Baptiste Nizet committed
202
203
</body>
</html>