Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Backend
Commits
697f1232
Commit
697f1232
authored
Jun 19, 2014
by
igoshin
Committed by
Matija Obreza
Jul 03, 2014
Browse files
#12579
parent
14d25162
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/servlet/controller/ExplorerController.java
View file @
697f1232
...
...
@@ -278,7 +278,7 @@ public class ExplorerController extends BaseController {
@RequestParam
(
value
=
"pick"
,
required
=
false
)
String
jsonPick
)
{
String
[]
selectedFilters
=
new
String
[
0
];
jsonFilter
=
jsonFilter
.
replaceAll
(
"_"
,
":"
);
Crop
crop
=
null
;
if
(
StringUtils
.
isNotBlank
(
jsonPick
))
{
// Cleanup JSON pick
...
...
src/main/resources/content/language.properties
View file @
697f1232
...
...
@@ -335,7 +335,7 @@ filter.inSvalbard=Safety duplicated in Svalbard
filter.mlsStat
=
MLS status of the accession
filter.available
=
Available for distribution
filter.download-dwca
=
Download DwCA
filter.add
=
Add
filter
filter.add
=
View & modify
filter
s
filter.additional
=
Additional filters
filter.apply
=
Apply
filter.close
=
Close
...
...
src/main/webapp/WEB-INF/jsp/accession/explore_new.jsp
View file @
697f1232
...
...
@@ -71,7 +71,7 @@
<c:forEach
items=
"
${
allFilters
}
"
var=
"filter"
>
<c:set
var=
"normalizedKey"
value=
"
${
f
ilter
.
key
.
replace
(
':'
,
'_'
)
}
"
/>
<c:set
var=
"normalizedKey"
value=
"
${
f
n:
replace
(
filter
.
key
,
':'
,
'_'
)
}
"
/>
<c:set
var=
"filterKey"
value=
"
${
filter
.
key
}
"
/>
<div
class=
"clearfix filter-block"
style=
"display:${pick[filterKey] eq filterKey ? '' : 'none'}"
...
...
@@ -167,6 +167,9 @@
</select>
</span>
</div>
<div
style=
"margin-top: 3px"
>
<button
class=
"btn btn-primary apply"
><spring:message
code=
"filter.apply"
/></button>
</div>
</c:when>
<c:otherwise>
<div
class=
"form-group input-group"
>
...
...
@@ -186,8 +189,7 @@
<a
href=
"#"
style=
"float: right"
class=
"edit-fil glyphicon glyphicon-pencil"
></a>
</div>
<div
class=
"col-lg-4 filter-values"
id=
"${normalizedKey}_value"
>
<%--<a href="#" style="float: right" class="close-fil glyphicon glyphicon-remove"></a>--%>
<%--<a href="#" style="float: right" class="edit-fil glyphicon glyphicon-pencil"></a>--%>
<c:forEach
items=
"
${
filters
[
filter
.
key
]
}
"
var=
"value"
>
<c:set
var=
"string"
value=
"
${
value
}
"
/>
...
...
@@ -285,10 +287,17 @@
<content
tag=
"javascript"
>
<script
type=
"text/javascript"
>
var
jsonData
=
$
{
jsonFilter
};
var
jsonData
=
$
{
fn
:
replace
(
jsonFilter
,
'
_
'
,
'
:
'
)
};
var
filterPick
=
[];
var
page
=
$
{
pagedData
.
number
};
if
(
page
==
0
){
$
(
"
.dropdown-toggle
"
).
hide
();
$
(
"
.filter-block
"
).
show
();
}
function
setCharAt
(
str
,
index
,
chr
)
{
if
(
index
>
str
.
length
-
1
)
return
str
;
return
str
.
substr
(
0
,
index
)
+
chr
+
str
.
substr
(
index
+
1
);
...
...
@@ -308,6 +317,7 @@
}
function
existInJson
(
input
,
key
)
{
key
=
key
.
replace
(
"
_
"
,
"
:
"
);
var
exist
=
input
!=
''
;
var
array
=
jsonData
[
key
];
...
...
@@ -351,6 +361,7 @@
}
function
collectData
(
key
,
value
)
{
key
=
key
.
replace
(
"
_
"
,
"
:
"
);
var
jsonValue
=
[];
var
exist
=
jsonData
[
key
]
!=
null
;
...
...
@@ -363,7 +374,7 @@
}
function
removeValue
(
value
,
key
)
{
key
=
key
.
replace
(
"
_
"
,
"
:
"
)
var
array
=
jsonData
[
key
];
for
(
var
val
in
array
)
{
...
...
@@ -392,7 +403,7 @@
if
(
existInJson
(
value
,
key
))
{
appendHtml
(
key
,
value
);
jsonData
[
key
]
=
collectData
(
key
,
value
);
jsonData
[
key
.
replace
(
"
_
"
,
"
:
"
)
]
=
collectData
(
key
,
value
);
$
(
inputId
).
val
(
''
);
}
}
...
...
@@ -412,9 +423,9 @@
var
jsonValue
=
[];
var
exist
=
jsonData
[
key
]
!=
null
;
var
exist
=
jsonData
[
key
.
replace
(
"
_
"
,
"
:
"
)
]
!=
null
;
if
(
exist
)
{
jsonValue
=
jsonData
[
key
];
jsonValue
=
jsonData
[
key
.
replace
(
"
_
"
,
"
:
"
)
];
}
var
notNull
=
inputValue1
!=
''
&&
inputValue2
!=
''
;
...
...
@@ -445,7 +456,8 @@
}
appendHtml
(
key
,
value
);
jsonData
[
key
]
=
jsonValue
;
jsonData
[
key
.
replace
(
"
_
"
,
"
:
"
)]
=
jsonValue
;
$
(
inputId1
).
val
(
''
);
$
(
inputId2
).
val
(
''
);
}
...
...
@@ -459,8 +471,8 @@
var
checked
=
$
(
inputId
).
is
(
"
:checked
"
);
if
(
checked
&&
existInJson
(
value
,
key
))
{
jsonData
[
key
.
replace
(
"
_
"
,
"
:
"
)]
=
collectData
(
key
,
value
);
appendHtml
(
key
,
value
);
jsonData
[
key
]
=
collectData
(
key
,
value
);
}
else
{
var
xkey
=
key
+
value
;
...
...
@@ -479,7 +491,6 @@
if
(
value
!=
''
){
appendHtml
(
key
,
value
);
jsonData
[
key
]
=
collectData
(
key
,
value
);
submitJson
();
}
}
...
...
@@ -491,7 +502,7 @@
if
(
checked
&&
existInJson
(
value
,
key
))
{
appendHtml
(
key
,
value
);
jsonData
[
key
]
=
collectData
(
key
,
value
);
jsonData
[
key
.
replace
(
"
_
"
,
"
:
"
)
]
=
collectData
(
key
,
value
);
}
else
{
var
xkey
=
key
+
value
;
...
...
@@ -501,14 +512,15 @@
});
$
(
"
.apply
"
).
click
(
function
()
{
submitJson
()
submitJson
()
;
});
$
(
"
.close-fil
"
).
on
(
"
click
"
,
function
()
{
var
parent
=
$
(
this
).
parent
().
parent
();
var
key
=
parent
.
attr
(
"
key
"
);
console
.
log
(
key
);
delete
jsonData
[
key
];
delete
jsonData
[
key
.
replace
(
"
_
"
,
"
:
"
)];
submitJson
();
parent
.
hide
();
});
...
...
@@ -534,6 +546,11 @@
}
removeValue
(
value
,
key
);
if
(
$
(
this
).
parent
().
parent
().
find
(
"
.filter-new
"
).
is
(
"
:hidden
"
)){
submitJson
();
}
$
(
this
).
remove
();
$
(
'
input[i-key=
'
+
key
+
value
+
'
]
'
).
prop
(
'
checked
'
,
false
);
});
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment