Commit 6fc0670f authored by Matija Obreza's avatar Matija Obreza
Browse files

URL Shortener: layout

parent 57a0e4e6
...@@ -676,6 +676,8 @@ twitter.tweet-this=Tweet! ...@@ -676,6 +676,8 @@ twitter.tweet-this=Tweet!
twitter.follow-X=Follow @{0} twitter.follow-X=Follow @{0}
linkedin.share-this=Share on LinkedIn linkedin.share-this=Share on LinkedIn
share.link=Share Link share.link=Share Link
share.link.placeholder=Please wait...
share.link.text=Please use the shortened version of the full URL to this page:
welcome.read-more=Read more about Genesys welcome.read-more=Read more about Genesys
twitter.latest-on-twitter=Latest on Twitter twitter.latest-on-twitter=Latest on Twitter
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<spring:message code="accessions.number" arguments="${pagedData.totalElements}" /> <spring:message code="accessions.number" arguments="${pagedData.totalElements}" />
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12 col-md-6"> <div class="col-md-12 col-lg-6">
<form method="get" action=""> <form method="get" action="">
<input type="hidden" name="filter" value="<c:out value="${jsonFilter}" />" /> <input type="hidden" name="filter" value="<c:out value="${jsonFilter}" />" />
<div class="pagination"> <div class="pagination">
...@@ -28,18 +28,30 @@ ...@@ -28,18 +28,30 @@
</div> </div>
</form> </form>
</div> </div>
<div class="col-sm-12 col-md-6 text-right" style="padding-top: 12px"> <div class="col-md-12 col-lg-6 text-right" style="padding-top: 12px">
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" id="menuShareLink">
<span class="glyphicon glyphicon-share"></span><span><spring:message code="share.link"/></span> <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li class="padding10">
<p><spring:message code="share.link.text" /></p>
<input id="shortLink" type="text" placeholder="<spring:message code="share.link.placeholder" />" value="" />
</li>
</ul>
</div>
<c:if test="${pagedData.totalElements le 200000}"> <c:if test="${pagedData.totalElements le 200000}">
<form style="display: inline-block" method="post" action="<c:url value="/download/explore/dwca" />"> <form style="display: inline-block" method="post" action="<c:url value="/download/explore/dwca" />">
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/> <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<input type="hidden" name="filter" value="<c:out value="${jsonFilter}" />" /> <input type="hidden" name="filter" value="<c:out value="${jsonFilter}" />" />
<button class="btn btn-default" type="submit"><spring:message code="filter.download-dwca" /></button> <button class="btn btn-default" type="submit"><span class="glyphicon glyphicon-download"></span><span><spring:message code="filter.download-dwca" /></span></button>
</form> </form>
<security:authorize access="isAuthenticated()"> <security:authorize access="isAuthenticated()">
<form style="display: inline-block" method="post" action="<c:url value="/download/explore/download/mcpd" />"> <form style="display: inline-block" method="post" action="<c:url value="/download/explore/download/mcpd" />">
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/> <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<input type="hidden" name="filter" value="<c:out value="${jsonFilter}" />" /> <input type="hidden" name="filter" value="<c:out value="${jsonFilter}" />" />
<button class="btn btn-default" type="submit"><spring:message code="filter.download-mcpd" /></button> <button class="btn btn-default" type="submit"><span class="glyphicon glyphicon-download"></span><span><spring:message code="filter.download-mcpd" /></span></button>
</form> </form>
</security:authorize> </security:authorize>
</c:if> </c:if>
...@@ -90,14 +102,6 @@ ...@@ -90,14 +102,6 @@
<span class="${fn:length(currentFilters) gt 0 ? '' : 'hide'}"><spring:message code="filter.filters-applied" /></span> <span class="${fn:length(currentFilters) gt 0 ? '' : 'hide'}"><spring:message code="filter.filters-applied" /></span>
<span class="${fn:length(currentFilters) gt 0 ? 'hide' : ''}"><spring:message code="filter.filters-not-applied" /></span> <span class="${fn:length(currentFilters) gt 0 ? 'hide' : ''}"><spring:message code="filter.filters-not-applied" /></span>
</li> </li>
<li class="active dropdown form-horizontal" style="float: right" id="menuShareLink">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<spring:message code="share.link"/>
</a>
<ul class="dropdown-menu">
<input id="shortLink" type="text" value="">
</ul>
</li>
</ul> </ul>
<%-- Only render currently present filters --%> <%-- Only render currently present filters --%>
...@@ -432,6 +436,7 @@ ...@@ -432,6 +436,7 @@
}); });
$("#menuShareLink").on("click", function () { $("#menuShareLink").on("click", function () {
if ($('#shortLink').val() === '') {
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url: '/explore/shorten-url', url: '/explore/shorten-url',
...@@ -444,6 +449,9 @@ ...@@ -444,6 +449,9 @@
inp.select(); inp.select();
} }
}); });
} else {
console.log('No repeat.');
}
}); });
GenesysFilterUtil.registerAutocomplete("#allfilters",jsonData); GenesysFilterUtil.registerAutocomplete("#allfilters",jsonData);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment