Skip to content
GitLab
Explore
Sign in
Commits on Source (2)
Refactoring of the function 'target_ref_img_url'
· 96fa8b1a
Marco De Donno
authored
Feb 18, 2020
96fa8b1a
Patch the filter of duplicates refs in the search page
· ba7c1634
Marco De Donno
authored
Feb 18, 2020
ba7c1634
Hide whitespace changes
Inline
Side-by-side
views/trainer/templates/trainer/search.html
View file @
ba7c1634
...
...
@@ -236,14 +236,18 @@
checked
.
push
(
tmp
);
}
}
target_ref
=
target_ref
.
filter
(
function
(
val
,
index
,
arr
){
return
!
duplicates
[
index
]
}
);
target_fpc
=
target_fpc
.
filter
(
function
(
val
,
index
,
arr
){
return
!
duplicates
[
index
]
}
);
}
target_ref
=
target_ref
.
filter
(
function
(
val
,
index
,
arr
){
return
!
duplicates
[
index
]
}
);
target_fpc
=
target_fpc
.
filter
(
function
(
val
,
index
,
arr
){
return
!
duplicates
[
index
]
}
);
target_ref_img_url
=
"
{{ url_for( 'image.image_segment_serve', tenprint_id = 'uuid', pc = 'fpc' ) }}
"
;
target_ref_img_url
=
target_ref_img_url
.
replace
(
"
uuid
"
,
target_ref
[
display_ref
]
);
target_ref_img_url
=
target_ref_img_url
.
replace
(
"
fpc
"
,
target_fpc
[
display_ref
]
);
var
get_ref_css_image_link
=
function
()
{
var
target_ref_img_url
=
"
{{ url_for( 'image.image_segment_serve', tenprint_id = 'uuid', pc = 'fpc' ) }}
"
;
target_ref_img_url
=
target_ref_img_url
.
replace
(
"
uuid
"
,
target_ref
[
display_ref
]
);
target_ref_img_url
=
target_ref_img_url
.
replace
(
"
fpc
"
,
target_fpc
[
display_ref
]
);
return
target_ref_img_url
;
}
$
(
"
<div />
"
)
.
attr
(
"
id
"
,
"
mark_details_dialog
"
)
...
...
@@ -260,7 +264,7 @@
.
append
(
$
(
"
<div/>
"
)
.
attr
(
"
id
"
,
"
icnml_mark_detail_right
"
)
.
attr
(
"
style
"
,
"
background-image:url(
"
+
tar
get_ref_
img_url
+
"
)
"
)
.
attr
(
"
style
"
,
"
background-image:url(
"
+
get_ref_
css_image_link
()
+
"
)
"
)
)
.
append
(
$
(
"
<div />
"
)
)
.
append
(
...
...
@@ -277,12 +281,8 @@
display_ref
-=
1
;
display_ref
=
display_ref
%
target_ref
.
length
;
target_ref_img_url
=
"
{{ url_for( 'image.image_segment_serve', tenprint_id = 'uuid', pc = 'fpc' ) }}
"
;
target_ref_img_url
=
target_ref_img_url
.
replace
(
"
uuid
"
,
target_ref
[
display_ref
]
);
target_ref_img_url
=
target_ref_img_url
.
replace
(
"
fpc
"
,
target_fpc
[
display_ref
]
);
$
(
"
#icnml_mark_detail_right
"
)
.
attr
(
"
style
"
,
"
background-image:url(
"
+
tar
get_ref_
img_url
+
"
)
"
)
.
attr
(
"
style
"
,
"
background-image:url(
"
+
get_ref_
css_image_link
()
+
"
)
"
)
}
)
)
.
append
(
$
(
"
<span />
"
).
css
(
"
margin-left
"
,
"
10px
"
).
css
(
"
margin-right
"
,
"
10px
"
).
text
(
"
|
"
)
)
...
...
@@ -296,12 +296,8 @@
display_ref
+=
1
;
display_ref
=
display_ref
%
target_ref
.
length
;
target_ref_img_url
=
"
{{ url_for( 'image.image_segment_serve', tenprint_id = 'uuid', pc = 'fpc' ) }}
"
;
target_ref_img_url
=
target_ref_img_url
.
replace
(
"
uuid
"
,
target_ref
[
display_ref
]
);
target_ref_img_url
=
target_ref_img_url
.
replace
(
"
fpc
"
,
target_fpc
[
display_ref
]
);
$
(
"
#icnml_mark_detail_right
"
)
.
attr
(
"
style
"
,
"
background-image:url(
"
+
tar
get_ref_
img_url
+
"
)
"
)
.
attr
(
"
style
"
,
"
background-image:url(
"
+
get_ref_
css_image_link
()
+
"
)
"
)
}
)
)
)
...
...