index.jsp 9.79 KB
Newer Older
Matija Obreza's avatar
Matija Obreza committed
1 2 3 4 5 6 7 8 9
<!DOCTYPE html>

<%@include file="/WEB-INF/jsp/init.jsp"%>

<html>
<head>
<title><spring:message code="selection.page.title" /></title>
</head>
<body>
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 27 28 29 30 31 32 33 34 35
	<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">
		                <li><a href="/sel/load?list=${userList.uuid}">${userList.title}</a>
		                <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 39

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

 		<div class="main-col-header clearfix">
40
		<div class="nav-header">
41 42 43 44 45 46 47 48
			<div class="results"><spring:message code="accessions.number" arguments="${pagedData.totalElements}" /></div>

			<div class="row">
				<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>
49 50
					</div>
				</div>
51 52 53 54 55 56 57 58 59 60
				<div class="col-sm-12 col-md-6" style="text-align: right; padding-top: 12px">
					<form style="display: inline-block" method="post" action="<c:url value="/sel/dwca" />">
						<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
						<button class="btn btn-default" type="submit"><spring:message code="filter.download-dwca" /></button>
					</form>
					<form style="display: inline-block" 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"><spring:message code="filter.download-mcpd" /></button>
					</form>
				</div>
Matija Obreza's avatar
Matija Obreza committed
61 62
			</div>
		</div>
Matija Obreza's avatar
Matija Obreza committed
63 64
		</div>

Matija Obreza's avatar
Matija Obreza committed
65
		<table class="accessions">
Matija Obreza's avatar
Matija Obreza committed
66 67 68
			<thead>
				<tr>
					<td class="idx-col"></td>
Matija Obreza's avatar
Matija Obreza committed
69
					<td />
Matija Obreza's avatar
Matija Obreza committed
70 71
					<td><spring:message code="accession.accessionName" /></td>
					<td><spring:message code="accession.taxonomy" /></td>
72
					<td class="notimportant"><spring:message code="accession.origin" /></td>
73
					<td class="notimportant"><spring:message code="accession.holdingInstitute" /></td>
74
					<%-- <td class="notimportant"><spring:message code="accession.holdingCountry" /></td> --%>
Matija Obreza's avatar
Matija Obreza committed
75 76 77
				</tr>
			</thead>
			<tbody>
Matija Obreza's avatar
Matija Obreza committed
78
				<c:forEach items="${pagedData.content}" var="accession" varStatus="status">
Matija Obreza's avatar
Matija Obreza committed
79
					<tr id="a${accession.id}" class="acn targeted ${accession.historic ? 'historic-record' : ''} ${status.count % 2 == 0 ? 'even' : 'odd'}">
Matija Obreza's avatar
Matija Obreza committed
80
						<td class="idx-col">${status.count + pagedData.size * pagedData.number}</td>
Matija Obreza's avatar
Matija Obreza committed
81
						<td class="sel ${selection.containsId(accession.id) ? 'picked' : ''}" x-aid="${accession.id}"></td>
Matija Obreza's avatar
Matija Obreza committed
82 83
						<td><a href="<c:url value="/acn/id/${accession.id}" />"><b><c:out value="${accession.accessionName}" /></b></a></td>
						<td><c:out value="${accession.taxonomy.taxonName}" /></td>
Matija Obreza's avatar
Matija Obreza committed
84
						<td class="notimportant"><c:out value="${accession.countryOfOrigin.getName(pageContext.response.locale)}" /></td>
85 86
						<td class="notimportant"><a href="<c:url value="/wiews/${accession.institute.code}" />"><c:out value="${accession.institute.code}" /></a></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> --%>
Matija Obreza's avatar
Matija Obreza committed
87 88 89 90
					</tr>
				</c:forEach>
			</tbody>
		</table>
Matija Obreza's avatar
Matija Obreza 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 115 116 117 118 119 120 121 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 149 150 151 152 153 154 155 156
		<form method="post" action="<c:url value="/sel/order" />" class="form-vertical">
			<div class="form-actions">
				<a href="<c:url value="/sel/" />"><button class="btn btn-default" type="button"><spring:message code="selection.reload-list" /></button></a>
				<button class="btn btn-primary" type="submit"><spring:message code="selection.send-request" /></button>
				<a href="<c:url value="/sel/clear" />" class="btn btn-default"><spring:message code="selection.clear" /></a>
				<a href="<c:url value="/sel/map" />" class="btn btn-default"><spring:message code="selection.map" /></a>
			</div>
      <!-- CSRF protection -->
      <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
		</form>
		
	</c:if>

	<div style="margin-top: 60px">
	  <!-- 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>
	
	  <!-- 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="">
						<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>
							</div>
						</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" />
							</div>
						</div>
						<div class="form-group">
							<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>


	    <security:authorize access="isAuthenticated()">
	    <div role="tabpanel" class="tab-pane" id="tab-manage-list">

				<div class="form-group">
				    <div class="dropdown">
				        <a href="#" class="dropdown-toggle" data-toggle="dropdown"><spring:message code="userlist.list-my-lists" /> <b
				                class="caret"></b></a>
				        <ul class="dropdown-menu" role="menu" id="user-accession-lists">
				            <c:forEach items="${userAccessionLists}" var="userList">
			                <li><a href="/sel/load?list=${userList.uuid}">${userList.title}</a></li>
				            </c:forEach>
				        </ul>
				    </div>
				</div>
	    
				<div class="form-group">
Alexander Basov's avatar
Alexander Basov committed
157 158
        <form method="post" action="<c:url value="/sel/userList"/>" role="form">
            <div class="form-group">
Matija Obreza's avatar
Matija Obreza committed
159
                <label for="accessionListTitle"><spring:message code="userlist.title" /></label>
Alexander Basov's avatar
Alexander Basov committed
160
                <input id="accessionListTitle" type="text" name="title" class="form-control"
Matija Obreza's avatar
Matija Obreza committed
161
                       value="${selection.userAccessionList.title}"/>
Alexander Basov's avatar
Alexander Basov committed
162
            </div>
163 164 165 166 167
            <div class="form-group">
                <input type="checkbox" id="accessionListShared" name="shared" value="true" 
                       ${selection.userAccessionList.shared ? "checked" : ""}/>
                <label for="accessionListShared"><spring:message code="userlist.shared" /></label>
            </div>
Alexander Basov's avatar
Alexander Basov committed
168
            <div class="form-group">
Matija Obreza's avatar
Matija Obreza committed
169
                <label for="accessionListDescr"><spring:message code="userlist.description" /></label>
Alexander Basov's avatar
Alexander Basov committed
170
                <textarea name="description" rows="3" id="accessionListDescr"
Matija Obreza's avatar
Matija Obreza committed
171
                          class="form-control"><c:out value="${selection.userAccessionList.description}"/></textarea>
Alexander Basov's avatar
Alexander Basov committed
172 173
            </div>
            <div class="form-group">
174 175
                <c:if test="${selection.userAccessionList.uuid ne null}">
                    <input type="hidden" name="uuid" value="${selection.userAccessionList.uuid}"/>
Matija Obreza's avatar
Matija Obreza committed
176
                    <input type="submit" class="btn btn-primary" value="<spring:message code="userlist.update-list"/>" name="update" />
177 178 179
                    <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" />
                    
180
                  <security:authorize access="hasRole('ADMINISTRATOR') or hasPermission(#selection.userAccessionList, 'ADMINISTRATION')">
181 182 183 184
										<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>
Alexander Basov's avatar
Alexander Basov committed
185
                </c:if>
186
                <input type="submit" class="btn btn-default" value="<spring:message code="userlist.make-new-list"/>" name="save"/>
Alexander Basov's avatar
Alexander Basov committed
187 188 189
            </div>
            <!-- CSRF protection -->
            <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
190 191 192 193 194 195 196
		      </form>
		    </div>
	    </div>
	    </security:authorize>
	  </div>
	</div>
	
Matija Obreza's avatar
Matija Obreza committed
197 198
</body>
</html>