Commit dd7af809 authored by Maxim's avatar Maxim Committed by Matija Obreza

filtering and extra columns

parent 41c3eb13
......@@ -1648,13 +1648,13 @@ $light-font-family: 'Roboto-Light';
}
#panelFilters > .panel-heading {
padding: 0px 15px 0 15px;
height: 64px;
height: 66px;
}
#panelFilters > .panel-heading > h4.panel-title {
text-transform: uppercase;
border-bottom: 1px solid black;
padding: 0px 5px 0px 5px;
line-height: 62px;
line-height: 65px;
}
#panelFilters > .panel-heading.no-border > h4.panel-title {
border-bottom: 1px solid white;
......@@ -1867,6 +1867,38 @@ $light-font-family: 'Roboto-Light';
padding: 10px;
}
}
#displayColumns {
.view-columns {
padding: 10px;
li {
color: #000000;
position: relative;
display: block;
margin-top: 10px;
margin-bottom: 10px;
label {
font-size: 14px;
font-family: "Roboto-Regular";
min-height: 22px;
padding-left: 20px;
margin-bottom: 0;
font-weight: normal;
cursor: pointer;
display: inline-block;
}
}
#columnsApply {
background-color: #87bc38;
padding: 5px 40px;
font-size: 14px;
border: none;
display: block;
color: white;
text-transform: none;
border-radius: 4px;
}
}
}
}
.pagination {
margin: 10px 0;
......@@ -2781,7 +2813,7 @@ h1.green-bg {
}
}
@media (max-width: 1450px) {
@media (max-width: 1456px) {
.explore-page .nav-header nav:not(.pull-right) .pagination {
margin: 10px 0;
margin: 0;
......@@ -2898,6 +2930,51 @@ h1.green-bg {
}
}
}
@media (max-width: 1199px) {
//explore-page
.explore-page {
.filters #panelFilters > .panel-heading {
height: 122px;
padding: 0 15px 0 15px;
}
.filters #panelFilters > .panel-heading > h4.panel-title {
padding: 0;
line-height: 120px;
}
.filters #collapseFilters > .panel-body {
padding: 0px 15px 15px 15px;
}
.filters .panel-heading .panel-title {
padding: 36.5px 0;
#collapseFilters .panel-title {
padding: 0;
}
}
.main-col-header {
padding: 10px 20px;
}
.nav-header {
.list-view-controls {
margin: 0 0 10px 0;
font-size: 0;
float: none !important;
text-align: center;
a {
width: auto;
margin-right: 0;
}
}
nav.pull-left {
width: 100%;
text-align: center;
}
.pagination li:first-child {
margin-left: 16%;
}
}
}
}
@media (max-width: 1198px) {
//accession-page
.accession-page {
......@@ -3011,15 +3088,6 @@ h1.green-bg {
}
//explore-page
.explore-page {
.main-col-header {
padding: 5px 20px;
}
.nav-header .list-view-controls {
margin: 25px 0 6px 0;
}
.filters #panelFilters > .panel-heading > h4.panel-title {
padding: 13px 0 20px 0;
}
.filters #collapseFilters > .panel-body {
padding: 7px 20px 15px 20px;
}
......@@ -3114,14 +3182,6 @@ h1.green-bg {
}
}
}
.filters #panelFilters > .panel-heading {
padding: 0px 20px 0 20px;
height: 72px;
}
.filters #panelFilters > .panel-heading > h4.panel-title {
padding: 0;
line-height: 71px;
}
}
}
......@@ -3671,43 +3731,6 @@ h1.green-bg {
}
//explore page
.explore-page {
.filters #panelFilters > .panel-heading {
height: 122px;
padding: 0 15px 0 15px;
}
.filters #panelFilters > .panel-heading > h4.panel-title {
padding: 0;
line-height: 120px;
}
.filters #collapseFilters > .panel-body {
padding: 0px 15px 15px 15px;
}
.filters .panel-heading .panel-title {
padding: 36.5px 0;
#collapseFilters .panel-title {
padding: 0;
}
}
.main-col-header {
padding: 10px 20px;
}
.nav-header {
.list-view-controls {
margin: 0 0 10px 0;
font-size: 0;
a {
width: auto;
margin-right: 0;
}
}
nav.pull-left {
width: 100%;
text-align: center;
}
.pagination li:first-child {
margin-left: 16%;
}
}
.bottom-pagination-wrapper {
padding: 15px;
}
......@@ -3959,7 +3982,7 @@ h1.green-bg {
//explore-page
.explore-page {
.main-col-header {
padding: 12px 0;
padding: 10px;
}
.nav-header .list-view-controls a {
padding: 6px 7px 4px;
......
......@@ -131,10 +131,49 @@
<div class="nav-header clearfix">
<!-- Links -->
<div class="pull-right list-view-controls">
<div class="btn-group" id="displayColumns">
<ul class="nav nav-pills">
<li class="dropdown form-horizontal" id="selectColumns">
<a class="dropdown-toggle btn btn-default" href="#">
<b class="glyphicon glyphicon-th-list"></b>
<spring:message code="columns.add"/>
</a>
<ul class="dropdown-menu view-columns">
<li>
<a id="columnsApply" style="margin-bottom: 10px" type="submit"
+ class="btn btn-default"><spring:message code="columns.apply"/>
</a>
</li>
<li class="dropdown-header">
<spring:message code="columns.availableColumns"/>
</li>
<c:forEach items="${availableColumns}" var="columnName">
<li>
<label class="column-enable" for="cb-${columnName}">
<c:choose>
<c:when test="${selectedColumns.contains(columnName)}">
<input id="cb-${columnName}" type="checkbox"
+ checked="checked" name="${columnName}"/>
</c:when>
<c:otherwise>
<input id="cb-${columnName}" type="checkbox"
+ name="${columnName}"/>
</c:otherwise>
</c:choose>
<spring:message code="accession.${columnName}"/>
</label>
</li>
</c:forEach>
</ul>
</li>
</ul>
</div>
<div class="btn-group" id="shareLink">
<a 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>
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>
</a>
<ul class="dropdown-menu">
......@@ -183,7 +222,9 @@
code="data-overview.short"/></span></a>
<a class="btn btn-default" id="mapLink"
href="<c:url value="/explore/map"><c:param name="filter">${jsonFilter}</c:param></c:url>"><span
class="glyphicon glyphicon-globe"></span><span><spring:message code="maps.view-map"/></span></a>
class="glyphicon glyphicon-globe"></span>
<span><spring:message code="maps.view-map"/></span>
</a>
</div>
<!--Pagination-->
<filters:pagination pagedData="${pagedData}" jsonFilter="${jsonFilter}"/>
......@@ -912,6 +953,40 @@
}
cropNamesTd.appendTo(row);
</c:when>
<c:when test="${col eq 'geo.latitudeAndLongitude'}">
var geoLatitude = "";
var geoLongitude = "";
if (pagedData.content[i].geo != null) {
geoLatitude = pagedData.content[i].geo.latitude;
geoLongitude = pagedData.content[i].geo.longitude;
}
var geoText = "";
if (geoLatitude.toString() != "") {
geoText = geoLatitude + ", " + geoLongitude
}
$("<span/>", {
dir: "ltr",
'class': "sci-name",
text: geoText
}).appendTo($("<p></p>").appendTo($("<td/>", {
'class': "notimportant <c:if test='${i.count ge 2}'>hidden-xs</c:if> <c:if test='${i.count gt 2}'>hidden-sm</c:if>"
}).appendTo(row)));
</c:when>
<c:when test="${col eq 'coll.collMissId'}">
var collMissIdText = "";
if (pagedData.content[i].coll != null) {
if (pagedData.content[i].coll.collMissId != null) {
collMissIdText = pagedData.content[i].coll.collMissId;
}
}
$("<span/>", {
dir: "ltr",
'class': "sci-name",
text: collMissIdText
}).appendTo($("<p></p>").appendTo($("<td/>", {
'class': "notimportant <c:if test='${i.count ge 2}'>hidden-xs</c:if> <c:if test='${i.count gt 2}'>hidden-sm</c:if>"
}).appendTo(row)));
</c:when>
</c:choose>
</c:forEach>
......@@ -942,6 +1017,22 @@
$('#collapseFilters').on('show.bs.collapse', function () {
$('#collapseFilters').prev('.panel-heading').removeClass('no-border');
})
$('li#selectColumns a').on('click', function (event) {
event.preventDefault();
$(this).parent().toggleClass('open');
});
$('#columnsApply').on('click', function () {
var columns = [];
[].forEach.call($('.view-columns li'), function (el) {
if ($(el).find('input:checkbox').is(':checked')) {
columns.push($(el).find('input:checkbox').prop('name'));
}
});
var filter = JSON.stringify(jsonData);
var url = '<c:url value="/explore" />' + '?filter=' + filter + "&columns=" + columns.toString();
window.location.href = encodeURI(url);
});
});
</script>
<script type="text/javascript" src="<c:url value="/explore/i18n.js"/>"></script>
......
Markdown is supported
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