Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hub
ViralHostRangeDB
Commits
612f2eba
Commit
612f2eba
authored
Oct 07, 2019
by
Bryan BRANCOTTE
Browse files
Link to edit response from virus/host detailed view
parent
8eee3e3e
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/viralhostrange/viralhostrangedb/static/css/browse.css
View file @
612f2eba
...
...
@@ -106,7 +106,7 @@ th.hover {
left
:
0
;
top
:
auto
;
}
.popover
a
[
href
]
{
.popover
a
[
href
]
:not
(
.allow-deco
)
{
color
:
inherit
;
}
.out-of-scope
{
...
...
src/viralhostrange/viralhostrangedb/static/js/virus_or_host_detail.js
View file @
612f2eba
...
...
@@ -157,13 +157,16 @@ function hover_behavior(selector){
popover
.
find
(
"
a.close_cmd
"
).
on
(
'
click
'
,
function
(
e
){
elt
.
popover
(
'
hide
'
).
popover
(
'
dispose
'
).
attr
(
"
aria-describedby
"
,
null
);
});
var
url
=
update_response
.
replace
(
"
000000
"
,
$
(
elt
).
attr
(
"
data-col
"
)).
replace
(
"
111111
"
,
$
(
elt
).
attr
(
"
data-row
"
));
content
=
$
(
'
<dl class="mb-0">
'
+
'
<dt>
'
+
gettext
(
'
Data source name
'
)
+
'
</dt>
'
+
'
<dd data-data-source=
'
+
$
(
elt
).
attr
(
"
data-col
"
)
+
'
></dd>
'
+
'
<dt>
'
+
in_row_kind
+
'
</dt>
'
+
'
<dd data-row=
'
+
$
(
elt
).
attr
(
"
data-row
"
)
+
'
></dd>
'
+
'
<dt>
'
+
detailed_kind
+
'
</dt>
'
+
'
<dd>
'
+
$
(
"
#detailed_name
"
).
html
()
+
'
</dd>
'
'
<dd>
'
+
$
(
"
#detailed_name
"
).
html
()
+
'
</dd>
'
+
'
</dl>
'
+
'
<a class="allow-deco pull-right mb-2" href="
'
+
url
+
'
">
'
+
gettext
(
'
Edit response
'
)
+
'
<i class="fa fa-pencil"></i></a>
'
).
appendTo
(
$
(
popover
).
find
(
"
.popover-body
"
).
empty
());
$
(
$
(
'
#grid_host thead>tr>th[data-col=
'
+
$
(
elt
).
attr
(
"
data-col
"
)
+
'
]
'
).
html
()).
appendTo
(
content
.
find
(
'
[data-data-source=
'
+
$
(
elt
).
attr
(
"
data-col
"
)
+
'
]
'
)
...
...
src/viralhostrange/viralhostrangedb/templates/viralhostrangedb/vh_detail.html
View file @
612f2eba
...
...
@@ -66,7 +66,13 @@ var get_responses = "{% url 'viralhostrangedb-api:responses' %}?{{object|class_v
var
get_infection_ratios
=
"
{% url 'viralhostrangedb-api:infection-ratio-detail' slug=object|class_verbose_name|lower slug_pk=object.id %}
"
;
var
row_pks
=
[{
%
for
d
in
data_sources
%
}{
%
if
not
forloop
.
first
%
},{
%
endif
%
}{{
d
.
pk
}}{
%
endfor
%
}];
var
get_virus_url
=
"
{% url 'viralhostrangedb:virus-detail' pk='000000' %}
"
;
var
focus_is_on_first_level_of_data
=
{{
focus_is_on_first_level_of_data
|
yesno
:
"
true,false
"
}};
{
%
if
focus_is_on_first_level_of_data
%
}
var
update_response
=
"
{% url 'viralhostrangedb:response-update' ds_pk='000000' virus_pk=object.id host_pk='111111' %}
"
;
var
focus_is_on_first_level_of_data
=
true
;
{
%
else
%
}
var
update_response
=
"
{% url 'viralhostrangedb:response-update' ds_pk='000000' virus_pk='111111' host_pk=object.id %}
"
;
var
focus_is_on_first_level_of_data
=
false
;
{
%
endif
%
}
var
in_row_kind
=
"
{{in_row_kind}}
"
;
var
detailed_kind
=
"
{{detailed_kind}}
"
;
</script>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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