|
25 | 25 | <h1 id="collectionName"><h:outputText value="#{manifest.label}" escape="false" /></h1>
|
26 | 26 | </div>
|
27 | 27 |
|
28 |
| - <div class="options"> |
29 |
| - <div class="option_links"> |
30 |
| - Manifest options: |
31 |
| - <a href="search.xhtml?iiif-content=#{manifest.URI}"><i class="fas fa-wrench"></i> Configure IIIF Search</a> | |
32 |
| - <a href="#" data-toggle="modal" data-target="#importAnnotations" onclick="hideMessage('importAnnoMessage');"><i class="fas fa-wrench"></i> Import Annotations</a> | |
33 |
| -<!-- <a href="#{manifest.URI}" target="_blank">Manifest Link</a>--> |
| 28 | + <c:if test="#{manifest != null}"> |
| 29 | + <div class="options"> |
| 30 | + <div class="option_links"> |
| 31 | + Manifest options: |
| 32 | + <a href="search.xhtml?iiif-content=#{manifest.URI}"><i class="fas fa-wrench"></i> Configure IIIF Search</a> | |
| 33 | + <a href="#" data-toggle="modal" data-target="#importAnnotations" onclick="hideMessage('importAnnoMessage');"><i class="fas fa-wrench"></i> Import Annotations</a> | |
| 34 | + <!-- <a href="#{manifest.URI}" target="_blank">Manifest Link</a>--> |
34 | 35 |
|
35 |
| - <ui:include src="WEB-INF/templates/content-state.xhtml"> |
36 |
| - <ui:param name="url" value="#{manifest.URI}" /> |
37 |
| - <ui:param name="description" value="Link to Manifest. Also draggable using IIIF Content State." /> |
38 |
| - <ui:param name="mode" value="full" /> |
39 |
| - </ui:include> |
40 |
| - </div> |
41 |
| - <div class="right_options"> |
42 |
| - List: <a href="#" id="all" onClick="toggleAnnotated(this)">all</a> | <a id="annotated" class="selected" href="#" onClick="toggleAnnotated(this)">annotated</a> |
| 36 | + <ui:include src="WEB-INF/templates/content-state.xhtml"> |
| 37 | + <ui:param name="url" value="#{manifest.URI}" /> |
| 38 | + <ui:param name="description" value="Link to Manifest. Also draggable using IIIF Content State." /> |
| 39 | + <ui:param name="mode" value="full" /> |
| 40 | + </ui:include> |
| 41 | + </div> |
| 42 | + <div class="right_options"> |
| 43 | + List: <a href="#" id="all" onClick="toggleAnnotated(this)">all</a> | <a id="annotated" class="selected" href="#" onClick="toggleAnnotated(this)">annotated</a> |
| 44 | + </div> |
43 | 45 | </div>
|
44 |
| - </div> |
45 |
| - <hr/> |
46 |
| - <c:set var="canvases" value="#{storeService.listAnnoPages(manifest)}" /> |
47 |
| - <ul id="canvases" class="media-list"> |
48 |
| - <c:forEach items="#{canvases}" var="annoPage" varStatus="iterMetadata"> |
49 |
| - <c:set var="short_id" value="#{annoPage.canvas.shortId}" /> |
50 |
| - <c:set var="isEmpty" value="#{annoPage.count == 0}" /> |
51 |
| - <c:set var="className" value="canvas" /> |
52 |
| - <c:if test="#{not isEmpty}"> |
53 |
| - <c:set var="className" value="anno_canvas" /> |
54 |
| - </c:if> |
55 |
| - <li class="manifestSummary #{className}" id="shortId"> |
56 |
| - <div class="media-header-div"> |
57 |
| - <h3 class="box_type"> |
58 |
| - <c:if test="#{not isEmpty}"> |
59 |
| - Annotated Canvas |
60 |
| - </c:if> |
61 |
| - <c:if test="#{isEmpty}"> |
62 |
| - Canvas |
63 |
| - </c:if> |
64 |
| - </h3> |
65 |
| - </div> |
66 |
| - <div class="media-heading"> |
67 |
| - <h5> |
68 |
| - <c:if test="#{not empty annoPage.canvas.label}"> |
69 |
| - Label: <h:outputText value="#{annoPage.canvas.label}"/> |
70 |
| - </c:if> |
71 |
| - <c:if test="#{empty annoPage.canvas.label}"> |
72 |
| - Label: unlabelled |
73 |
| - </c:if> |
74 |
| - </h5> |
75 |
| - </div> |
76 |
| - <div class="media"> |
77 |
| - <a class="align-self-center" href="annotations.xhtml?iiif-content=#{annoPage.canvas.id}"> |
78 |
| - <img class="align-self-center mr-3 media-img canvas_thum" data-canvas-id="#{annoPage.canvas.id}" src=""/> |
79 |
| - </a> |
80 |
| - <div class="media-body"> |
81 |
| - <a href="view.xhtml?collection=#{collection.id}&manifest=#{manifest.URI}&canvas=#{annoPage.canvas.id}" class="btn btn-primary mb-2" title="Open manifest for editing"><i class="far fa-edit"></i> Annotate this page</a> |
82 |
| - <c:if test="#{not isEmpty}"> |
83 |
| - <a href="annotations.xhtml?iiif-content=#{annoPage.canvas.id}&collection=#{request.getParameter('collection')}&manifest=#{param['iiif-content']}" class="btn btn-secondary mb-2" ><i class="fas fa-list"></i> List Annotations (<h:outputText value="#{annoPage.count}"/>)</a> |
84 |
| - </c:if> |
| 46 | + <hr/> |
| 47 | + <c:set var="canvases" value="#{storeService.listAnnoPages(manifest)}" /> |
| 48 | + <ul id="canvases" class="media-list"> |
| 49 | + <c:forEach items="#{canvases}" var="annoPage" varStatus="iterMetadata"> |
| 50 | + <c:set var="short_id" value="#{annoPage.canvas.shortId}" /> |
| 51 | + <c:set var="isEmpty" value="#{annoPage.count == 0}" /> |
| 52 | + <c:set var="className" value="canvas" /> |
| 53 | + <c:if test="#{not isEmpty}"> |
| 54 | + <c:set var="className" value="anno_canvas" /> |
| 55 | + </c:if> |
| 56 | + <li class="manifestSummary #{className}" id="shortId"> |
| 57 | + <div class="media-header-div"> |
| 58 | + <h3 class="box_type"> |
| 59 | + <c:if test="#{not isEmpty}"> |
| 60 | + Annotated Canvas |
| 61 | + </c:if> |
| 62 | + <c:if test="#{isEmpty}"> |
| 63 | + Canvas |
| 64 | + </c:if> |
| 65 | + </h3> |
| 66 | + </div> |
| 67 | + <div class="media-heading"> |
| 68 | + <h5> |
| 69 | + <c:if test="#{not empty annoPage.canvas.label}"> |
| 70 | + Label: <h:outputText value="#{annoPage.canvas.label}"/> |
| 71 | + </c:if> |
| 72 | + <c:if test="#{empty annoPage.canvas.label}"> |
| 73 | + Label: unlabelled |
| 74 | + </c:if> |
| 75 | + </h5> |
| 76 | + </div> |
| 77 | + <div class="media"> |
| 78 | + <a class="align-self-center" href="annotations.xhtml?iiif-content=#{annoPage.canvas.id}"> |
| 79 | + <img class="align-self-center mr-3 media-img canvas_thum" data-canvas-id="#{annoPage.canvas.id}" src=""/> |
| 80 | + </a> |
| 81 | + <div class="media-body"> |
| 82 | + <a href="view.xhtml?collection=#{collection.id}&manifest=#{manifest.URI}&canvas=#{annoPage.canvas.id}" class="btn btn-primary mb-2" title="Open manifest for editing"><i class="far fa-edit"></i> Annotate this page</a> |
| 83 | + <c:if test="#{not isEmpty}"> |
| 84 | + <a href="annotations.xhtml?iiif-content=#{annoPage.canvas.id}&collection=#{request.getParameter('collection')}&manifest=#{param['iiif-content']}" class="btn btn-secondary mb-2" ><i class="fas fa-list"></i> List Annotations (<h:outputText value="#{annoPage.count}"/>)</a> |
| 85 | + </c:if> |
85 | 86 |
|
86 |
| - <p></p><p></p> |
87 |
| - <div id="actionBar"> |
88 |
| - <span> |
89 |
| - <c:if test="#{not isEmpty}"> |
90 |
| - <a class="actionLink" href="annotations/#{user.shortId}/#{short_id}.json" download="#{short_id}.json">Download annotations</a> | |
91 |
| - <a class="actionLink" href="#" data-count="#{annoPage.count}" data-canvas-id="#{annoPage.canvas.id}" data-mode="remove_annotations" data-manifest="#{param['iiif-content']}" data-collection="#{param['collection']}" onClick="showConfirm(event); return false;">Remove annotations</a> |
92 |
| - </c:if> |
93 |
| - </span> |
| 87 | + <p></p><p></p> |
| 88 | + <div id="actionBar"> |
| 89 | + <span> |
| 90 | + <c:if test="#{not isEmpty}"> |
| 91 | + <a class="actionLink" href="annotations/#{user.shortId}/#{short_id}.json" download="#{short_id}.json">Download annotations</a> | |
| 92 | + <a class="actionLink" href="#" data-count="#{annoPage.count}" data-canvas-id="#{annoPage.canvas.id}" data-mode="remove_annotations" data-manifest="#{param['iiif-content']}" data-collection="#{param['collection']}" onClick="showConfirm(event); return false;">Remove annotations</a> |
| 93 | + </c:if> |
| 94 | + </span> |
| 95 | + </div> |
94 | 96 | </div>
|
95 | 97 | </div>
|
96 |
| - </div> |
97 |
| - </li> |
98 |
| - </c:forEach> |
99 |
| - </ul> |
| 98 | + </li> |
| 99 | + </c:forEach> |
| 100 | + </ul> |
100 | 101 |
|
101 |
| - <script> |
102 |
| - let canvas_ids = document.getElementsByClassName("canvas_thum"); |
103 |
| - fetch('#{manifest.URI}') |
104 |
| - .then(response => response.json()) |
105 |
| - .then(function(manifest) { |
106 |
| - for (let thumb of canvas_ids) { |
107 |
| - let url = getCanvasThumbnail(manifest, thumb.dataset.canvasId, 0, 100); |
108 |
| - thumb.src = url; |
109 |
| - }; |
110 |
| - }); |
| 102 | + <script> |
| 103 | + let canvas_ids = document.getElementsByClassName("canvas_thum"); |
| 104 | + fetch('#{manifest.URI}') |
| 105 | + .then(response => response.json()) |
| 106 | + .then(function(manifest) { |
| 107 | + for (let thumb of canvas_ids) { |
| 108 | + let url = getCanvasThumbnail(manifest, thumb.dataset.canvasId, 0, 100); |
| 109 | + thumb.src = url; |
| 110 | + }; |
| 111 | + }); |
111 | 112 |
|
112 |
| - if (document.getElementsByClassName("anno_canvas").length === 0) { |
113 |
| - toggleAnnotated(document.getElementById("all")); |
114 |
| - } |
| 113 | + if (document.getElementsByClassName("anno_canvas").length === 0) { |
| 114 | + toggleAnnotated(document.getElementById("all")); |
| 115 | + } |
115 | 116 |
|
116 |
| - function toggleAnnotated(link) { |
117 |
| - let mode = ""; |
118 |
| - if (link.id === "all") { |
119 |
| - link.className = "selected"; |
| 117 | + function toggleAnnotated(link) { |
| 118 | + let mode = ""; |
| 119 | + if (link.id === "all") { |
| 120 | + link.className = "selected"; |
120 | 121 |
|
121 |
| - let annotatedLink = document.getElementById("annotated"); |
122 |
| - annotatedLink.className = ""; |
| 122 | + let annotatedLink = document.getElementById("annotated"); |
| 123 | + annotatedLink.className = ""; |
123 | 124 |
|
124 |
| - mode = "block"; |
125 |
| - } else { |
126 |
| - link.className = "selected"; |
| 125 | + mode = "block"; |
| 126 | + } else { |
| 127 | + link.className = "selected"; |
127 | 128 |
|
128 |
| - let annotatedLink = document.getElementById("all"); |
129 |
| - annotatedLink.className = ""; |
| 129 | + let annotatedLink = document.getElementById("all"); |
| 130 | + annotatedLink.className = ""; |
130 | 131 |
|
131 |
| - mode = "none"; |
| 132 | + mode = "none"; |
| 133 | + } |
| 134 | + let canvases = document.getElementsByClassName("canvas"); |
| 135 | + Array.prototype.forEach.call(canvases, function (canvas) { |
| 136 | + canvas.style.display = mode; |
| 137 | + }) |
132 | 138 | }
|
133 |
| - let canvases = document.getElementsByClassName("canvas"); |
134 |
| - Array.prototype.forEach.call(canvases, function (canvas) { |
135 |
| - canvas.style.display = mode; |
136 |
| - }) |
137 |
| - } |
138 |
| - |
139 |
| - </script> |
140 |
| - <ui:include src="WEB-INF/templates/dialogues/importAnnotations.xhtml"/> |
141 |
| - <ui:include src="WEB-INF/templates/dialogues/confirm.xhtml"/> |
| 139 | + |
| 140 | + </script> |
| 141 | + <ui:include src="WEB-INF/templates/dialogues/importAnnotations.xhtml"/> |
| 142 | + <ui:include src="WEB-INF/templates/dialogues/confirm.xhtml"/> |
| 143 | + </c:if> |
| 144 | + <c:if test="#{manifest == null}"> |
| 145 | + <p>It looks like there was a problem finding your manifest. Please add it again in the <a class="back_header" href="collections.xhtml?collection=#{param['collection']}">Collections screen.</a></p> |
| 146 | + </c:if> |
142 | 147 | </ui:define>
|
143 | 148 | </ui:composition>
|
144 | 149 | </html>
|
|
0 commit comments