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
06d331d0
Commit
06d331d0
authored
5 years ago
by
Carlos Vega
Browse files
Options
Downloads
Patches
Plain Diff
changed study view and template to allow changes on the red cap columns
parent
950cc7a0
No related branches found
No related tags found
1 merge request
!224
Feature/selectable redcap fields
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
smash/web/templates/study/edit.html
+25
-0
25 additions, 0 deletions
smash/web/templates/study/edit.html
smash/web/views/study.py
+9
-2
9 additions, 2 deletions
smash/web/views/study.py
with
34 additions
and
2 deletions
smash/web/templates/study/edit.html
+
25
−
0
View file @
06d331d0
...
...
@@ -118,6 +118,31 @@
</div>
</div>
<!-- /.box-body -->
<div
class=
"box-header with-border"
>
<h3>
RedCap fields to check for inconsistencies
</h3>
</div>
<div
class=
"box-body"
>
<div
class=
"col-md-12"
>
{% for field in redcap_columns_form %}
<div
class=
"col-md-6 form-group {% if field.errors %}has-error{% endif %}"
>
<label
for=
"{{ field.id_for_label }}"
class=
"col-sm-4 control-label"
>
{{ field.label }}
</label>
<div
class=
"col-sm-8"
>
{{ field|add_class:'form-control' }}
</div>
{% if field.errors %}
<span
class=
"help-block"
>
{{ field.errors }}
</span>
{% endif %}
</div>
{% endfor %}
</div>
</div>
<!-- /.box-body -->
<div
class=
"box-footer"
>
<div
class=
"col-sm-4"
>
<button
type=
"submit"
class=
"btn btn-block btn-success"
>
Save
</button>
...
...
This diff is collapsed.
Click to expand it.
smash/web/views/study.py
+
9
−
2
View file @
06d331d0
...
...
@@ -4,7 +4,7 @@ import logging
from
django.contrib
import
messages
from
django.shortcuts
import
redirect
,
get_object_or_404
from
web.forms
import
StudyColumnsEditForm
,
StudyEditForm
,
StudyNotificationParametersEditForm
from
web.forms
import
StudyColumnsEditForm
,
StudyEditForm
,
StudyNotificationParametersEditForm
,
StudyRedCapColumnsEditForm
from
web.models
import
Study
from
web.views
import
wrap_response
from
web.decorators
import
PermissionDecorator
...
...
@@ -21,10 +21,13 @@ def study_edit(request, study_id):
prefix
=
"
notifications
"
)
study_columns_form
=
StudyColumnsEditForm
(
request
.
POST
,
request
.
FILES
,
instance
=
study
.
columns
,
prefix
=
"
columns
"
)
if
study_form
.
is_valid
()
and
notifications_form
.
is_valid
()
and
study_columns_form
.
is_valid
():
redcap_columns_form
=
StudyRedCapColumnsEditForm
(
request
.
POST
,
request
.
FILES
,
instance
=
study
.
redcap_columns
,
prefix
=
"
redcap
"
)
if
study_form
.
is_valid
()
and
notifications_form
.
is_valid
()
and
study_columns_form
.
is_valid
()
and
redcap_columns_form
.
is_valid
():
study_form
.
save
()
notifications_form
.
save
()
study_columns_form
.
save
()
redcap_columns_form
.
save
()
messages
.
success
(
request
,
"
Modifications saved
"
)
if
'
_continue
'
in
request
.
POST
:
return
redirect
(
'
web.views.edit_study
'
,
study_id
=
study
.
id
)
...
...
@@ -38,8 +41,12 @@ def study_edit(request, study_id):
study_columns_form
=
StudyColumnsEditForm
(
instance
=
study
.
columns
,
prefix
=
"
columns
"
)
redcap_columns_form
=
StudyRedCapColumnsEditForm
(
instance
=
study
.
redcap_columns
,
prefix
=
"
redcap
"
)
return
wrap_response
(
request
,
'
study/edit.html
'
,
{
'
study_form
'
:
study_form
,
'
notifications_form
'
:
notifications_form
,
'
study_columns_form
'
:
study_columns_form
,
'
redcap_columns_form
'
:
redcap_columns_form
})
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