basket.jsp 4.46 KB
Newer Older
Ubbo Veentjer's avatar
Ubbo Veentjer committed
1
2
3
4
5
6
7
8
9
<%@ page contentType="text/html" pageEncoding="UTF-8" %>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://textgrid.info/rep/utils" prefix="utils" %>

<%@ include file="base/head.jsp" %>
<%@ include file="components/js-incl.jsp" %>

Ubbo Veentjer's avatar
Ubbo Veentjer committed
10
11
12
13
14
15
16
<script type="text/javascript">
	document.addEventListener("DOMContentLoaded", function(event) {

		$(document).on('click', '.-remove-from-shelf', function(e) {
			var $this = $(this);

			$.ajax({
Ubbo Veentjer's avatar
Ubbo Veentjer committed
17
					url: "/service/shelf/remove" ,
Ubbo Veentjer's avatar
Ubbo Veentjer committed
18
19
20
21
22
23
24
					type: 'POST',
					dataType:'json',
					data: {
						uri: $this.attr('data-textgrid-targeturi')
					},
					success: function(data) {
						$this.closest('li.tgrep.result').remove();
Ubbo Veentjer's avatar
Ubbo Veentjer committed
25
26
27
						$this.closest('li.tgrep.gallery-item').remove();
						$('.tgrep.header_count').html(data);
						setBasketCount(data);
Ubbo Veentjer's avatar
Ubbo Veentjer committed
28
29
30
31
32
33
34
35
					}
			});
		});

		$(document).on('click', '.tgrep.header_button.-clear', function(e) {
			var $this = $(this);

			$.ajax({
Ubbo Veentjer's avatar
Ubbo Veentjer committed
36
					url: "/service/shelf/clear" ,
Ubbo Veentjer's avatar
Ubbo Veentjer committed
37
38
39
40
41
42
43
					type: 'POST',
					dataType:'json',
					data: {
						empty: "empty"
					},
					success: function(data) {
						$('.tgrep.results_list').empty();
Ubbo Veentjer's avatar
Ubbo Veentjer committed
44
						$('.tgrep.results_gallery').empty();
Ubbo Veentjer's avatar
Ubbo Veentjer committed
45
						$('.tgrep.header_count').html(0);
Ubbo Veentjer's avatar
Ubbo Veentjer committed
46
						setBasketCount(data);
Ubbo Veentjer's avatar
Ubbo Veentjer committed
47
48
49
					}
			});
		});
Ubbo Veentjer's avatar
Ubbo Veentjer committed
50
	});
Ubbo Veentjer's avatar
Ubbo Veentjer committed
51

Ubbo Veentjer's avatar
Ubbo Veentjer committed
52
53
</script>

Ubbo Veentjer's avatar
Ubbo Veentjer committed
54
<div class="tgrep wrap">
Ubbo Veentjer's avatar
Ubbo Veentjer committed
55
56
57
58
59
60
	<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>

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

Ubbo Veentjer's avatar
Ubbo Veentjer committed
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
		<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">
							<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
77

Ubbo Veentjer's avatar
Ubbo Veentjer committed
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
		<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>
						</li>
					</c:forEach>
				</ul>
				<c:if test="${tools.size() > 6}">
					<button class="tgrep sidebar_expand">${i18n['expand']}</button>
				</c:if>
			</section>
		</c:if>
	</aside>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
94

Ubbo Veentjer's avatar
Ubbo Veentjer committed
95
96
	<main class="tgrep main">
		<h1 class="tgrep main_heading">${i18n['shelf']}</h1>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
97

Ubbo Veentjer's avatar
Ubbo Veentjer committed
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
		<header class="tgrep header">
			<h2 class="tgrep header_heading">${i18n['manage-the-shelf']}</h2>
			<div class="tgrep header_info">
				${i18n['there-are-currently']} <span class="tgrep header_count">${results.size()}</span> ${i18n['objects-on-your-shelf']}
			</div>
			<div class="tgrep header_actions">
				<button class="tgrep header_button -expand-all">${i18n['expand-all']}</button>
				<button class="tgrep header_button -collapse-all">${i18n['collapse-all']}</button>
				<button class="tgrep header_button -clear">${i18n['clear']}</button>
				<div class="tg dropdown" role="group">
					<a class="tg dropdown_toggle">${i18n['download-all']}</a>
					<ul class="tg dropdown_menu">
						<li class="tg dropdown_item"><a class="tg dropdown_link" href="${aggregatorUrl}/epub/${basketItemString}" data-type="ebook">E-Book</a></li>
						<li class="tg dropdown_item"><a class="tg dropdown_link" href="${aggregatorUrl}/zip/${basketItemString}" data-type="zip">ZIP</a></li>
						<li class="tg dropdown_item"><a class="tg dropdown_link" href="${aggregatorUrl}/teicorpus/${basketItemString}" data-type="teicorpus">TEI-Corpus</a></li>
					</ul>
				</div>
			</div>
		</header>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
117

Ubbo Veentjer's avatar
Ubbo Veentjer committed
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
		<c:choose>
			<c:when test="${mode eq 'gallery'}">
				<ul class="tgrep results_gallery">
					<c:forEach items="${results}" var="result">
						<%@ include file="components/singleGalleryResult.jsp" %>
					</c:forEach>
				</ul>
			</c:when>
			<c:otherwise>
				<ul class="tgrep results_list">
					<c:forEach items="${results}" var="result">
						<%@ include file="components/singleListResult.jsp" %>
					</c:forEach>
				</ul>
			</c:otherwise>
		</c:choose>
	</main>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
135
136
137
138
</div>


<%@ include file="base/foot.jsp" %>
Ubbo Veentjer's avatar
Ubbo Veentjer committed
139