index.jsp 12.5 KB
Newer Older
Matija Obreza's avatar
Matija Obreza committed
1 2
<!DOCTYPE html>

3
<%@ include file="/WEB-INF/jsp/init.jsp" %>
Matija Obreza's avatar
Matija Obreza committed
4 5 6 7 8

<html>
<head>
<title><spring:message code="selection.page.title" /></title>
</head>
9
<body class="selected-list">
Matija Obreza's avatar
Matija Obreza committed
10
	<cms:informative-h1 title="selection.page.title" fancy="true" info="selection.page.intro" />
Matija Obreza's avatar
Matija Obreza committed
11

12 13 14
	<gui:alert type="warning" display="${resultFromSave ne null}">
		<spring:message code="${resultFromSave}" />
	</gui:alert>
15

16 17 18 19 20 21 22 23 24 25 26
	<c:if test="${pagedData == null}">
	    <gui:alert type="info">
	        <spring:message code="selection.empty-list-warning"/>
	    </gui:alert>
	    
	    <security:authorize access="isAuthenticated()">
	    	<c:if test="${fn:length(userAccessionLists) gt 0}">
			<div class="">
				<spring:message code="userlist.list-my-lists" /> 
		        <ul class="funny-list" role="" id="user-accession-lists">
		            <c:forEach items="${userAccessionLists}" var="userList">
Matija Obreza's avatar
Matija Obreza committed
27
		                <li><a href="/sel/load?list=${userList.uuid}"><c:out value="${userList.title}" /></a>
28 29 30 31 32 33 34 35
		                <div class="pull-right"><c:out value="${userList.description}" /></div>
		                </li>
		            </c:forEach>
		        </ul>
			</div>
			</c:if>
		</security:authorize>
	</c:if>
Alexander Basov's avatar
Alexander Basov committed
36 37 38

<c:if test="${pagedData != null}">

39 40 41 42 43 44 45 46 47 48 49 50
 		<div class="row main-col-header clearfix">
			<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 nav-header clearfix">
				<%--<div class="results"><spring:message code="accessions.number" arguments="${pagedData.totalElements}" /></div>--%>
					<div class="pull-right list-view-controls">
						<form method="post" action="<c:url value="/sel/dwca" />">
							<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
							<button class="btn btn-default" type="submit"><span class="glyphicon glyphicon-save"></span><span><spring:message code="filter.download-dwca" /></span></button>
						</form>
						<form method="post" action="<c:url value="/sel/download/mcpd" />">
							<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
							<button class="btn btn-default" type="submit"><span class="glyphicon glyphicon-save"></span><span><spring:message code="filter.download-mcpd" /></span></button>
						</form>
51
					</div>
52 53 54 55 56 57 58 59 60
					<%--<div class="col-sm-12 col-md-6">
						<div class="pagination">
							<spring:message code="paged.pageOfPages" arguments="${pagedData.number+1},${pagedData.totalPages}" />
							<a href="<spring:url value=""><spring:param name="page" value="${pagedData.number eq 0 ? 1 : pagedData.number}" /><spring:param name="filter" value="${jsonFilter}" /></spring:url>"><spring:message code="pagination.previous-page" /></a>
							<a href="<spring:url value=""><spring:param name="page" value="${pagedData.number+2}" /><spring:param name="filter" value="${jsonFilter}" /></spring:url>"><spring:message code="pagination.next-page" /></a>
						</div>
					</div>--%>
					<!--Pagination-->
					<filters:pagination pagedData="${pagedData}" jsonFilter="${jsonFilter}"/>
Matija Obreza's avatar
Matija Obreza committed
61 62
			</div>
		</div>
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
		<div class="row accessions-table-wrapper">
			<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<table class="accessions">
					<thead>
						<tr>
							<td class="idx-col"><p></p></td>
							<td><p></p></td>
							<td><p><spring:message code="accession.accessionName" /></p></td>
							<td><p><spring:message code="accession.taxonomy" /></p></td>
							<td class="notimportant"><p><spring:message code="accession.origin" /></p></td>
							<td class="notimportant"><p><spring:message code="accession.holdingInstitute" /></p></td>
							<%-- <td class="notimportant"><spring:message code="accession.holdingCountry" /></td> --%>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${pagedData.content}" var="accession" varStatus="status">
							<tr id="a${accession.id}" class="acn targeted ${accession.historic ? 'historic-record' : ''} ${status.count % 2 == 0 ? 'even' : 'odd'}">
								<td class="idx-col"><p><c:out value="${status.count + pagedData.size * pagedData.number}" /></p></td>
								<td class="sel ${selection.containsId(accession.id) ? 'picked' : ''}" x-aid="${accession.id}"></td>
82
								<td><p><local:accession-details-link accession="${accession}" /></p></td>
83 84 85 86 87 88 89 90
								<td><p><c:out value="${accession.taxonomy.taxonName}" /></p></td>
								<td class="notimportant"><p><c:out value="${accession.countryOfOrigin.getName(pageContext.response.locale)}" /></p></td>
								<td class="notimportant"><p><a href="<c:url value="/wiews/${accession.institute.code}" />"><c:out value="${accession.institute.code}" /></a></p></td>
								<%--<td class="notimportant"><a href="<c:url value="/geo/${accession.institute.country.code3}" />"><c:out value="${accession.institute.country.getName(pageContext.response.locale)}" /></a></td>--%>
							</tr>
						</c:forEach>
					</tbody>
				</table>
91 92 93 94 95 96 97 98
				<c:forEach items="${pagedData.content}" var="accession" varStatus="status">
				<table class="accessions mobile-accessions">
					<thead>
						<td class="idx-col"><p><c:out value="${status.count + pagedData.size * pagedData.number}" /></p></td>
					</thead>
					<tbody>
						<tr>
							<td><p><spring:message code="accession.accessionName" /></p></td>
99
							<td><p><local:accession-details-link accession="${accession}" /></p></td>
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
						</tr>
					<tr>
						<td><p><spring:message code="accession.taxonomy" /></p></td>
						<td><p><c:out value="${accession.taxonomy.taxonName}" /></p></td>
					</tr>
					<tr>
						<td class="notimportant"><p><spring:message code="accession.origin" /></p></td>
						<td class="notimportant"><p><c:out value="${accession.countryOfOrigin.getName(pageContext.response.locale)}" /></p></td>
					</tr>
					<tr>
						<td class="notimportant"><p><spring:message code="accession.holdingInstitute" /></p></td>
						<td class="notimportant"><p><a href="<c:url value="/wiews/${accession.institute.code}" />"><c:out value="${accession.institute.code}" /></a></p></td>
					</tr>
					<%--<tr>
						<td class="notimportant"><spring:message code="accession.holdingCountry" /></td>
						<td class="notimportant"><a href="<c:url value="/geo/${accession.institute.country.code3}" />"><c:out value="${accession.institute.country.getName(pageContext.response.locale)}" /></a></td>
					</tr>--%>
					</tbody>
				</table>
				</c:forEach>
120 121 122 123 124 125 126 127 128 129 130 131 132 133
			</div>
			</div>
			<div class="row main-col-header form-actions-wrapper">
				<form method="post" action="<c:url value="/sel/order" />" class="form-vertical col-lg-12 col-md-12 col-sm-12 col-xs-12">
					<div class="form-actions">
						<a href="<c:url value="/sel/" />"><button class="btn btn-default" type="button"><span class="glyphicon glyphicon-refresh"></span><span><spring:message code="selection.reload-list" /></span></button></a>
						<button class="btn btn-primary" type="submit"><span class="glyphicon glyphicon-send"></span><span><spring:message code="selection.send-request" /></span></button>
						<a href="<c:url value="/sel/clear" />"><button class="btn btn-default" type="button"><span class="glyphicon glyphicon-erase"></span><span><spring:message code="selection.clear" /></span></button></a>
						<a href="<c:url value="/sel/map" />"><button class="btn btn-default" type="button"><span class="glyphicon glyphicon-globe"></span><span><spring:message code="selection.map" /></span></button></a>
					</div>
				  <!-- CSRF protection -->
				  <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
				</form>
			</div>
Matija Obreza's avatar
Matija Obreza committed
134

135
		</c:if>
Matija Obreza's avatar
Matija Obreza committed
136

137 138 139 140 141 142 143 144
		<div class="tabs-wrapper">
		  <!-- Nav tabs -->
		  <ul class="nav nav-tabs" role="tablist">
			<li role="presentation" class="active"><a href="#tab-add-many" aria-controls="tab-add-many" role="tab" data-toggle="tab"><spring:message code="selection.add-many" /></a></li>
			<security:authorize access="isAuthenticated()">
			<li role="presentation"><a href="#tab-manage-list" aria-controls="tab-manage-list" role="tab" data-toggle="tab"><spring:message code="user.accession.list.title" /></a></li>
			</security:authorize>
		  </ul>
145

146 147 148 149 150 151 152 153
		  <!-- Tab panes -->
		  <div class="tab-content">
			<div role="tabpanel" class="tab-pane active" id="tab-add-many">
				<form method="post" action="<c:url value="/sel/add-many" />" class="form-horizontal">
					<div class="form-group">
						<label for="accessionIds" class="control-label"><spring:message code="selection.add-many.accessionIds" /></label>
						<div class="controls">
							<textarea class="form-control" placeholder="IG 523121, TMB-1" name="accessionIds"></textarea>
154
						</div>
155 156 157 158 159
					</div>
					<div class="form-group">
						<label for="accessionIds" class="control-label"><spring:message code="selection.add-many.instCode" /></label>
						<div class="controls">
							<input class="form-control" placeholder="XXX000" name="instCode" />
160
						</div>
161 162 163 164 165 166 167 168
					</div>
					<div class="form-group transparent">
						<input type="submit" class="btn btn-primary" value="<spring:message code="selection.add-many.button" />" />
					</div>
					<!-- CSRF protection -->
					<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
				</form>
			</div>
169

170 171 172 173 174
			<security:authorize access="isAuthenticated()">
			<div role="tabpanel" class="tab-pane" id="tab-manage-list">
				<form method="post" action="<c:url value="/sel/userList"/>" role="form" class="form-horizontal">
					<div class="form-group transparent">
						<div class="dropdown">
175 176 177 178 179
							<a href="#" class="dropdown-toggle" data-toggle="dropdown" id="user-acc-lists">
								<spring:message code="userlist.list-my-lists" />
								<b class="caret"></b>
							</a>
							<ul class="dropdown-menu" role="menu" id="get-user-acc-lists">
180
								<c:forEach items="${userAccessionLists}" var="userList">
181 182 183
									<li>
										<a href="/sel/load?list=${userList.uuid}"><c:out value="${userList.title}" /></a>
									</li>
184 185 186 187
								</c:forEach>
							</ul>
						</div>
					</div>
188
				<div class="form-group">
189 190 191 192 193 194 195
					<label for="accessionListTitle" class="control-label"><spring:message code="userlist.title" /></label>
					<input id="accessionListTitle" type="text" name="title" class="form-control" value="${selection.userAccessionList.title}"/>
				</div>
				<div class="form-group">
					<label for="accessionListShared" class="control-label">
						<input type="checkbox" id="accessionListShared" name="shared" value="true" ${selection.userAccessionList.shared ? "checked" : ""}/>
					<spring:message code="userlist.shared" /></label>
196 197
				</div>
				<div class="form-group">
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222
					<label for="accessionListDescr" class="control-label"><spring:message code="userlist.description" /></label>
					<textarea name="description" rows="3" id="accessionListDescr" class="form-control"><c:out value="${selection.userAccessionList.description}"/></textarea>
				</div>
				<div class="form-group transparent">
					<c:if test="${selection.userAccessionList.uuid ne null}">
						<input type="hidden" name="uuid" value="${selection.userAccessionList.uuid}"/>
						<input type="submit" class="btn btn-primary" value="<spring:message code="userlist.update-list"/>" name="update" />
						<input type="submit" class="btn btn-default" value="<spring:message code="userlist.disconnect"/>" name="disconnect" />
						<input type="submit" class="btn btn-default" value="<spring:message code="delete"/>" name="delete" />

					  <security:authorize access="hasRole('ADMINISTRATOR') or hasPermission(#selection.userAccessionList, 'ADMINISTRATION')">
						  <a class="btn btn-default" href="<c:url value="/acl/org.genesys2.server.model.impl.AccessionList/${selection.userAccessionList.id}/permissions"><c:param name="back"><c:url value="/sel" /></c:param></c:url>">
							  <spring:message code="edit-acl"/>
						  </a>
					  </security:authorize>
					</c:if>
					<input type="submit" class="btn btn-primary" value="<spring:message code="userlist.make-new-list"/>" name="save"/>
				</div>
				<!-- CSRF protection -->
				<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
				  </form>
			</div>
			</security:authorize>
		  </div>
		</div>
223 224 225 226

	<content tag="javascript">
		<script type="text/javascript">
            $(document).ready(function () {
227 228
                $('#list-id').find("a").addClass('active active-group');
                $('#list-id').addClass('active');
229 230 231 232 233 234 235 236 237 238 239 240 241
                $("#user-acc-lists").on("click", function () {
                    if ($("#get-user-acc-lists").is(":visible")) {
                        $('#get-user-acc-lists').hide();
                    } else {
                        $('#get-user-acc-lists').hide();
                        $('#get-user-acc-lists li').each(function () {
                            $('#get-user-acc-lists').show();
                        });
                    }
                })
            });
		</script>
	</content>
Matija Obreza's avatar
Matija Obreza committed
242 243
</body>
</html>