Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scheduling-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SMASCH
scheduling-system
Commits
68580029
There was a problem fetching the pipeline metadata.
Commit
68580029
authored
7 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
JS checks in edit subject page fixed
parent
4b3d6f37
No related branches found
No related tags found
1 merge request
!99
separate patient data from study data
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
smash/web/templates/subjects/edit.html
+33
-17
33 additions, 17 deletions
smash/web/templates/subjects/edit.html
with
33 additions
and
17 deletions
smash/web/templates/subjects/edit.html
+
33
−
17
View file @
68580029
...
@@ -26,9 +26,7 @@
...
@@ -26,9 +26,7 @@
{% block content %}
{% block content %}
<div
class=
"row"
>
<div
class=
"row"
>
<p
class=
"col-lg-3 pull-left"
>
<p
class=
"col-lg-3 pull-left"
>
<a
href=
"javascript:history.back(1)"
class=
"btn btn-block btn-default"
<a
href=
"javascript:history.back(1)"
class=
"btn btn-block btn-default"
>
Go back (discard changes)
</a>
"
>
Go
back (discard changes)
</a>
</p>
</p>
<p
class=
"col-md-2 pull-right"
>
<p
class=
"col-md-2 pull-right"
>
<a
href=
"{% url 'web.views.subject_visit_details' study_subject.id %}"
type=
"button"
<a
href=
"{% url 'web.views.subject_visit_details' study_subject.id %}"
type=
"button"
...
@@ -44,11 +42,11 @@
...
@@ -44,11 +42,11 @@
</div>
</div>
<form
method=
"post"
action=
""
class=
"form-horizontal"
>
<form
method=
"post"
action=
""
class=
"form-horizontal"
>
{% csrf_token %}
<div
class=
"box-body"
>
<div
class=
"box-body"
>
<div
class=
"col-md-12"
>
<div
class=
"col-md-12"
>
{% csrf_token %}
{% for field in
study_
subject_form %}
{% for field in subject_form %}
<div
class=
"col-md-6 form-group {% if field.errors %}has-error{% endif %}"
>
<div
class=
"col-md-6 form-group {% if field.errors %}has-error{% endif %}"
>
<label
for=
"{# TODO #}"
class=
"col-sm-4 control-label"
>
<label
for=
"{# TODO #}"
class=
"col-sm-4 control-label"
>
{{ field.label }}
{{ field.label }}
...
@@ -64,7 +62,14 @@
...
@@ -64,7 +62,14 @@
</div>
</div>
{% endfor %}
{% endfor %}
{% for field in subject_form %}
</div>
</div>
<!-- /.box-body -->
<div
class=
"box-header with-border"
>
<h3>
Subject's study details
</h3>
</div>
<div
class=
"box-body"
>
<div
class=
"col-md-12"
>
{% for field in study_subject_form %}
<div
class=
"col-md-6 form-group {% if field.errors %}has-error{% endif %}"
>
<div
class=
"col-md-6 form-group {% if field.errors %}has-error{% endif %}"
>
<label
for=
"{# TODO #}"
class=
"col-sm-4 control-label"
>
<label
for=
"{# TODO #}"
class=
"col-sm-4 control-label"
>
{{ field.label }}
{{ field.label }}
...
@@ -168,18 +173,28 @@
...
@@ -168,18 +173,28 @@
"
info
"
:
true
,
"
info
"
:
true
,
"
autoWidth
"
:
false
"
autoWidth
"
:
false
});
});
var
dead_was_checked
=
$
(
"
#id_dead
"
).
is
(
"
:checked
"
);
var
deadCheckbox
=
$
(
"
#id_subject-dead
"
);
var
resigned_was_checked
=
$
(
"
#id_resigned
"
).
is
(
"
:checked
"
);
var
resignedCheckbox
=
$
(
"
#id_study_subject-resigned
"
);
$
(
"
#id_resign_reason
"
).
prop
(
'
disabled
'
,
!
resigned_was_checked
);
var
resignReasonInput
=
$
(
"
#id_study_subject-resign_reason
"
);
$
(
"
#id_resigned
"
).
on
(
"
click
"
,
function
(){
var
screeningNumberInput
=
$
(
"
input[name='screening_number']
"
);
var
checked
=
$
(
"
#id_resigned
"
).
is
(
"
:checked
"
);
$
(
"
#id_resign_reason
"
).
prop
(
'
disabled
'
,
!
checked
);
if
(
deadCheckbox
.
length
===
0
||
resignedCheckbox
.
length
===
0
||
resignReasonInput
.
length
===
0
||
screeningNumberInput
===
null
)
{
alert
(
"
Internal error. Contact administrators
"
);
}
var
dead_was_checked
=
deadCheckbox
.
is
(
"
:checked
"
);
var
resigned_was_checked
=
resignedCheckbox
.
is
(
"
:checked
"
);
resignReasonInput
.
prop
(
'
disabled
'
,
!
resigned_was_checked
);
resignedCheckbox
.
on
(
"
click
"
,
function
()
{
var
checked
=
resignedCheckbox
.
is
(
"
:checked
"
);
resignReasonInput
.
prop
(
'
disabled
'
,
!
checked
);
});
});
$
(
"
form
"
).
submit
(
function
()
{
$
(
"
form
"
).
submit
(
function
()
{
if
(
confirmed
)
{
if
(
confirmed
)
{
return
true
;
return
true
;
}
}
if
((
!
dead_was_checked
&&
$
(
"
#id_dead
"
)
.
is
(
"
:checked
"
))
||
(
!
resigned_was_checked
&&
$
(
"
#id_
resigned
"
)
.
is
(
"
:checked
"
)))
{
if
((
!
dead_was_checked
&&
deadCheckbox
.
is
(
"
:checked
"
))
||
(
!
resigned_was_checked
&&
resigned
Checkbox
.
is
(
"
:checked
"
)))
{
confirmed
=
false
;
confirmed
=
false
;
$
(
"
#confirm-dead-resigned-mark-dialog
"
).
modal
(
"
show
"
);
$
(
"
#confirm-dead-resigned-mark-dialog
"
).
modal
(
"
show
"
);
return
false
;
return
false
;
...
@@ -193,15 +208,16 @@
...
@@ -193,15 +208,16 @@
$
(
"
#confirm-screening-change
"
).
click
(
function
()
{
$
(
"
#confirm-screening-change
"
).
click
(
function
()
{
$
(
'
#enable-screening-number-dialog
'
).
modal
(
'
hide
'
);
$
(
'
#enable-screening-number-dialog
'
).
modal
(
'
hide
'
);
$
(
"
input[name='
screening
_n
umber
']
"
)
.
attr
(
"
readonly
"
,
false
);
screening
N
umber
Input
.
attr
(
"
readonly
"
,
false
);
$
(
"
input[name='
screening
_n
umber
']
"
)
[
0
].
focus
();
screening
N
umber
Input
[
0
].
focus
();
});
});
$
(
"
input[name='
screening
_n
umber
']
"
)
.
attr
(
"
readonly
"
,
true
);
screening
N
umber
Input
.
attr
(
"
readonly
"
,
true
);
$
(
"
input[name='
screening
_n
umber
']
"
)
.
after
(
"
<div><a class='btn btn-block btn-danger' onclick='show_screening_number_enable_dialog()'>modify<a/></div>
"
);
screening
N
umber
Input
.
after
(
"
<div><a class='btn btn-block btn-danger' onclick='show_screening_number_enable_dialog()'>modify<a/></div>
"
);
});
});
function
show_screening_number_enable_dialog
()
{
function
show_screening_number_enable_dialog
()
{
$
(
'
#enable-screening-number-dialog
'
).
modal
(
'
show
'
);
$
(
'
#enable-screening-number-dialog
'
).
modal
(
'
show
'
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment