browse.jsp 12.1 KB
Newer Older
Ubbo Veentjer's avatar
Ubbo Veentjer committed
1
2
3
<%@ page contentType="text/html" pageEncoding="UTF-8" %>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
4
<%@ taglib prefix="fmt" uri = "http://java.sun.com/jsp/jstl/fmt" %>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
5
6
7
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://textgrid.info/rep/utils" prefix="utils" %>

Ubbo Veentjer's avatar
Ubbo Veentjer committed
8
<c:set var="pagename" value="browse" />
Ubbo Veentjer's avatar
Ubbo Veentjer committed
9
10
11
12
<%@ include file="base/head.jsp" %>

<div class="tgrep wrap">

Ubbo Veentjer's avatar
Ubbo Veentjer committed
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  <c:if test="${browseRootAggregations}">
    <aside class="tgrep sidebar">
      <c:if test="${viewmodes != null}">
        <section class="tgrep sidebar_panel">
          <h3 class="tgrep sidebar_subheading">${i18n['views']}</h3>
          <ul class="tgrep sidebar_list">
            <c:forEach items="${viewmodes}" var="viewmode">
              <li class="tgrep sidebar_item ${viewmode.active? '-current' : ''}">
                <a href="${viewmode.url}" rel="noindex nofollow" class="tgrep sidebar_link">${viewmode.label}</a>
              </li>
            </c:forEach>
          </ul>
          <c:if test="${viewmodes.size() > 6}">
            <button class="tgrep sidebar_expand">${i18n['expand']}</button>
          </c:if>
        </section>
      </c:if>
    </aside>
  </c:if>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
32

Ubbo Veentjer's avatar
Ubbo Veentjer committed
33
34
35
36
37
  <c:if test="${! browseRootAggregations}">
    <div class="tgrep sidebar-toggle">
      <button class="tgrep sidebar-toggle_button -show">${i18n['show-sidebar']}</button>
      <button class="tgrep sidebar-toggle_button -hide">${i18n['hide-sidebar']}</button>
    </div>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
38

Ubbo Veentjer's avatar
Ubbo Veentjer committed
39
    <aside class="tgrep sidebar">
Ubbo Veentjer's avatar
Ubbo Veentjer committed
40

Ubbo Veentjer's avatar
Ubbo Veentjer committed
41
42
43
44
45
      <section class="tgrep sidebar_panel">
        <h3 class="tgrep sidebar_subheading">${i18n['metadata']}</h3>
        <!-- TODO: each for agent, pid, etc -->
        <dl>
          <dt>${i18n['format']}</dt><dd>${metadata.object.generic.provided.format}</dd>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
46

Ubbo Veentjer's avatar
Ubbo Veentjer committed
47
          <!-- show author when available, first agent otherwise -->
48
          <%@ include file="components/authorAndAgents.jsp" %>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
49

Ubbo Veentjer's avatar
Ubbo Veentjer committed
50
51
52
53
54
55
56
57
          <c:if test="${not empty metadata.object.edition.source[0].bibliographicCitation.dateOfPublication.date}">
            <dt>${i18n['date-of-publication']}</dt><dd>${metadata.object.edition.source[0].bibliographicCitation.dateOfPublication.date}</dd>
          </c:if>
          <c:if test="${not empty metadata.object.edition.source[0].bibliographicCitation.placeOfPublication[0].value}">
            <dt>${i18n['place-of-publication']}</dt><dd>${metadata.object.edition.source[0].bibliographicCitation.placeOfPublication[0].value}</dd>
          </c:if>
          <c:if test="${not empty metadata.object.generic.generated.pid[0].value}">
            <dt>${i18n['pid']}</dt>
58
                        <dd><a href="${config.handleHost}/${fn:substringAfter(metadata.object.generic.generated.pid[0].value, 'hdl:')}">${metadata.object.generic.generated.pid[0].value}</a><br/>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
59
                        <a href="#citation">${i18n['citation']}</a></dd>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
60
61
62
          </c:if>
        </dl>
      </section>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
63

Ubbo Veentjer's avatar
Ubbo Veentjer committed
64
65
66
67
68
      <c:if test="${revisions.size() > 1}">
        <section class="tgrep sidebar_panel">
          <h3 class="tgrep sidebar_subheading">${i18n['revisions']}</h3>
          <ul class="tgrep sidebar_list">
            <c:forEach items="${revisions}" var="rev">
69
70
71
                <li class="tgrep sidebar_item ${rev.key == metadata.object.generic.generated.revision ? '-current' : ''}">
                  <a href="/browse/${rev.value}">${rev.key}</a>
                </li>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
72
73
74
75
76
            </c:forEach>
          </ul>
        </section>
      </c:if>

Ubbo Veentjer's avatar
Ubbo Veentjer committed
77
78
79
80
      <section class="tgrep sidebar_panel">
        <h3 class="tgrep sidebar_subheading">${i18n['download']}</h3>
        <ul class="tgrep sidebar_list">
          <li>
81
            <a href="${config.textgridHost}/1.0/tgcrud-public/rest/${metadata.object.generic.generated.textgridUri.value}/data">
Ubbo Veentjer's avatar
Ubbo Veentjer committed
82
83
84
              ${i18n['object']} <c:if test="${isTEI}">(TEI)</c:if>
            </a>
          </li>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
85
                    <li>
86
            <a href="${config.textgridHost}/1.0/tgcrud-public/rest/${metadata.object.generic.generated.textgridUri.value}/metadata">
Ubbo Veentjer's avatar
Ubbo Veentjer committed
87
88
89
              ${i18n['metadata']} (XML)
            </a>
          </li>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
90
                    <li>
91
            <a href="${config.textgridHost}/1.0/tgcrud-public/rest/${metadata.object.generic.generated.textgridUri.value}/tech">
Ubbo Veentjer's avatar
Ubbo Veentjer committed
92
93
94
95
96
              ${i18n['techmd']} (XML)
            </a>
          </li>
          <c:if test="${isTEI}">
            <li>
97
              <a href="${config.textgridHost}/1.0/aggregator/text/${metadata.object.generic.generated.textgridUri.value}">
98
99
100
                Plain Text (txt)
              </a>
            </li>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
101
            <li>
102
              <a href="${config.textgridHost}/1.0/aggregator/epub/${metadata.object.generic.generated.textgridUri.value}">
Ubbo Veentjer's avatar
Ubbo Veentjer committed
103
104
105
106
                E-Book (epub)
              </a>
            </li>
            <li>
107
              <a href="${config.textgridHost}/1.0/aggregator/html/${metadata.object.generic.generated.textgridUri.value}">
Ubbo Veentjer's avatar
Ubbo Veentjer committed
108
109
110
111
                HTML
              </a>
            </li>
            <li>
112
              <a href="${config.textgridHost}/1.0/aggregator/zip/${metadata.object.generic.generated.textgridUri.value}">
Ubbo Veentjer's avatar
Ubbo Veentjer committed
113
114
115
116
117
                ZIP
              </a>
            </li>
          </c:if>
          <c:if test="${fn:contains(metadata.object.generic.provided.format, 'aggregation')}">
118
            <a href="${config.textgridHost}/1.0/aggregator/teicorpus/${metadata.object.generic.generated.textgridUri.value}">
Ubbo Veentjer's avatar
Ubbo Veentjer committed
119
120
121
122
123
              TEI-Corpus (XML)
            </a>
          </c:if>
        </ul>
      </section>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
124

Ubbo Veentjer's avatar
Ubbo Veentjer committed
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
      <c:if test="${viewmodes != null}">
        <section class="tgrep sidebar_panel">
          <h3 class="tgrep sidebar_subheading">${i18n['views']}</h3>
          <ul class="tgrep sidebar_list">
            <c:forEach items="${viewmodes}" var="viewmode">
              <li class="tgrep sidebar_item ${viewmode.active? '-current' : ''}">
                <a href="${viewmode.url}" rel="noindex nofollow" class="tgrep sidebar_link">${viewmode.label}</a>
              </li>
            </c:forEach>
          </ul>
          <c:if test="${viewmodes.size() > 6}">
            <button class="tgrep sidebar_expand">${i18n['expand']}</button>
          </c:if>
        </section>
      </c:if>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
140

Ubbo Veentjer's avatar
Ubbo Veentjer committed
141
142
143
144
145
146
147
      <c:if test="${tools != null and tools.size() > 0}">
        <section class="tgrep sidebar_panel">
          <h3 class="tgrep sidebar_subheading">${i18n['tools']}</h3>
          <ul class="tgrep sidebar_list">
            <c:forEach items="${tools}" var="tool">
              <li class="tgrep sidebar_item">
                <a href="${tool.url}" rel="noindex nofollow" class="tgrep sidebar_link ${tool.cssClass}">${tool.label}</a>
148
149
150
                <c:if test="${tool.helpLink != null}">
                  <a href ="${tool.helpLink}" class=""><icon class="info-link"></a>
                </c:if>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
151
152
153
154
155
156
157
158
              </li>
            </c:forEach>
          </ul>
          <c:if test="${tools.size() > 6}">
            <button class="tgrep sidebar_expand">${i18n['expand']}</button>
          </c:if>
        </section>
      </c:if>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
159

Ubbo Veentjer's avatar
Ubbo Veentjer committed
160
      <c:if test="${tocHtml != null and metadata.object.generic.generated.project.value eq 'Digitale Bibliothek'}">
Ubbo Veentjer's avatar
Ubbo Veentjer committed
161

Ubbo Veentjer's avatar
Ubbo Veentjer committed
162
163
164
165
166
      <section class="tgrep sidebar_panel">
        <h3 class="tgrep sidebar_subheading">${i18n['toc']}</h3>
          ${tocHtml}
      </section>
      </c:if>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
167

Ubbo Veentjer's avatar
Ubbo Veentjer committed
168
169
    </aside>
  </c:if>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
170

Ubbo Veentjer's avatar
Ubbo Veentjer committed
171
  <main class="tgrep main">
172
173
174
  
    <c:if test="${higherRevisionAvailable}">
      <fieldset class="tgrep advanced-search_fieldset">
175
176
        <legend class="tgrep advanced-search_legend">${i18n['higher-revision-available']}</legend>
        ${i18n['higher-rev-msg-pt1']} ${metadata.object.generic.generated.revision} ${i18n['higher-rev-msg-pt2']}
Ubbo Veentjer's avatar
Ubbo Veentjer committed
177
        <a href="/browse/${latestRevisionUri}?mode=${mode}">Revision ${latestRevision}</a>.
178
179
180
      </fieldset>
    </c:if>

Ubbo Veentjer's avatar
Ubbo Veentjer committed
181
    <%@ include file="components/path.jsp" %>
182
183
184
185
186
    
    <c:if test="${isProject}">
        <h1>${project.title}</h1>
        <p>${project.description} <a href="#README">[more...]</a></p>
    </c:if>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
187

Ubbo Veentjer's avatar
Ubbo Veentjer committed
188
189
190
191
192
    <c:choose>
      <c:when test="${results != null}">
        <c:if test="${format == 'text/tg.work+xml'}">
          <h1 class="tgrep main_heading">${i18n['editions-for-this-work']}</h1>
        </c:if>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
193

Ubbo Veentjer's avatar
Ubbo Veentjer committed
194
195
196
197
198
199
200
201
202
        <div class="tgrep results">
          <c:choose>
            <c:when test="${mode eq 'gallery'}">
              <ol class="tgrep results_gallery">
                <c:forEach items="${results}" var="result">
                  <%@ include file="components/singleGalleryResult.jsp" %>
                </c:forEach>
              </ol>
            </c:when>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
203

Ubbo Veentjer's avatar
Ubbo Veentjer committed
204
205
206
207
208
209
210
211
212
213
            <c:otherwise>
              <ol class="tgrep results_list">
                <c:forEach items="${results}" var="result">
                  <%@ include file="components/singleListResult.jsp" %>
                </c:forEach>
              </ol>
            </c:otherwise>
          </c:choose>
        </div>
      </c:when>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
214

Ubbo Veentjer's avatar
Ubbo Veentjer committed
215
216
217
218
219
      <c:when test="${teiHtml != null}">
        <div class="teiXsltView">
          ${teiHtml}
        </div>
      </c:when>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
220

Ubbo Veentjer's avatar
Ubbo Veentjer committed
221
222
223
224
225
226
227
228
229
230
231
232
233
      <c:when test="${image}">
       <!-- TODO: openseadragon without inline javscript 
        <div id="openseadragon1" style="width: 800px; height: 1200px;"></div>
        <script src="/js/openseadragon.min.js"></script>
        <script type="text/javascript">
          var viewer = OpenSeadragon({
              id: "openseadragon1",
              preserveViewport: true,
              visibilityRatio:    1,
              minZoomLevel:       1,
              defaultZoomLevel:   1,
              //sequenceMode:       true,
              prefixUrl: "/images/openseadragon/",
234
              tileSources: "${config.textgridHost}/1.0/digilib/rest/IIIF/${metadata.object.generic.generated.textgridUri.value}/info.json"
Ubbo Veentjer's avatar
Ubbo Veentjer committed
235
236
237
          });
       </script>
       -->
238
        <img src="${config.textgridHost}/1.0/digilib/rest/IIIF/${metadata.object.generic.generated.textgridUri.value}/full/,1000/0/native.jpg"/>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
239
      </c:when>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
240

Ubbo Veentjer's avatar
Ubbo Veentjer committed
241
242
243
      <c:when test="${metadata.object.generic.provided.identifier[0].type eq 'METSXMLID'}">
        ${i18n['dfg-viewer-mets-message']}
      </c:when>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
244

Ubbo Veentjer's avatar
Ubbo Veentjer committed
245
246
247
248
      <c:when test="${metadata.object.generic.provided.format eq 'text/html'}">
        <p>
          ${i18n['iframe-html-message']}
        </p>
249
250
        <a target="_blank" href="${config.textgridHost}/1.0/tgcrud-public/rest/${metadata.object.generic.generated.textgridUri.value}/data">${i18n['open-html-in-new-window']}</a>
        <iframe id="htmlIframe" width="560" height="600" frameborder="0" src="${config.textgridHost}/1.0/tgcrud-public/rest/${metadata.object.generic.generated.textgridUri.value}/data"></iframe>
251
252
253
254
255
      </c:when>

      <c:when test="${metadata.object.generic.provided.format eq 'text/markdown'}">
        ${htmlContent}
      </c:when>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
256

Ubbo Veentjer's avatar
Ubbo Veentjer committed
257
258
      <c:otherwise>
        <p>${i18n['dont-know-what-todo']} ${format}</p>
259
        <a target="_blank" href="${config.textgridHost}/1.0/tgcrud-public/rest/${metadata.object.generic.generated.textgridUri.value}/data">${i18n['open-html-in-new-window']}</a>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
260
      </c:otherwise>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
261

Ubbo Veentjer's avatar
Ubbo Veentjer committed
262
    </c:choose>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
263

Ubbo Veentjer's avatar
Ubbo Veentjer committed
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
    <!-- Notes and License (e.g. for editions) -->
    <c:if test="${not empty metadata.object.edition.license.value or not empty metadata.object.generic.provided.notes}">
      <div class="clearboth">
      <hr/>
      <dl>
        <c:if test="${not empty metadata.object.generic.provided.notes}">
          <dt>${i18n['notes']}</dt><dd>${metadata.object.generic.provided.notes}</dd>
        </c:if>
        <c:if test="${not empty metadata.object.item.rightsHolder[0].value}">
          <dt>${i18n['rightsholder']}</dt><dd>${metadata.object.item.rightsHolder[0].value}</dd>
        </c:if>
        <c:if test="${not empty metadata.object.edition.license.value}">
          <dt>${i18n['license']}</dt>
            <dd>
              ${metadata.object.edition.license.value}
              <c:if test="${not empty metadata.object.edition.license.licenseUri}">
                <br/><a href="${metadata.object.edition.license.licenseUri}">${i18n['licenseUri']}</a>
              </c:if>
            </dd>
        </c:if>
      </dl>
      </div>
    </c:if>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
287

288
289
290
291
292
293
    <c:if test="${not empty readme}">
    <hr id="README">
      ${readme}
    </c:if>


Ubbo Veentjer's avatar
Ubbo Veentjer committed
294
295
296
297
    <!-- Citation examples -->
    <div id="citation" class="clearboth">
    <hr/>
    <%@ include file="components/citation.jsp" %>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
298

Ubbo Veentjer's avatar
Ubbo Veentjer committed
299
  </main>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
300
301
302

</div>

Stefan Funk's avatar
Stefan Funk committed
303
<%@ include file="base/foot.jsp" %>