Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clinicaltrials
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
david Chavalarias
clinicaltrials
Commits
286760f4
Commit
286760f4
authored
Nov 30, 2016
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add conditional subquestion for 'other institution type'
parent
912138af
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
19 deletions
+36
-19
server_comex_registration.py
server_comex_registration.py
+5
-0
comex_reg_form_controllers.js
static/js/comex_reg_form_controllers.js
+11
-10
base_form.html
templates/base_form.html
+20
-9
No files found.
server_comex_registration.py
View file @
286760f4
...
...
@@ -273,6 +273,8 @@ def save_to_db(safe_recs_arr):
def
read_records
(
incoming_data
):
"""
runs sanitization as needed
NB custom made for regcomex/templates/base_form
"""
# init var
...
...
@@ -303,6 +305,9 @@ def read_records(incoming_data):
elif
field
==
'last_modified_date'
:
rdate
=
incoming_data
[
field
]
# special treatment for "other" subquestions
if
clean_records
[
'institution_type'
]
==
'other'
and
'other_institution_type'
in
incoming_data
:
clean_records
[
'institution_type'
]
=
sanitize
(
incoming_data
[
'other_institution_type'
])
return
(
duuid
,
rdate
,
clean_records
)
...
...
static/js/comex_reg_form_controllers.js
View file @
286760f4
...
...
@@ -58,6 +58,7 @@ var captchaCheck = document.getElementById('my-captchaHash')
var
subPage1Style
=
document
.
getElementById
(
'subpage_1'
).
style
var
subPage2Style
=
document
.
getElementById
(
'subpage_2'
).
style
var
teamCityDivStyle
=
document
.
getElementById
(
'team_city_div'
).
style
var
otherInstDivStyle
=
document
.
getElementById
(
'other_institution_div'
).
style
// param for generation & validation
var
realCaptchaLength
=
5
...
...
@@ -612,16 +613,16 @@ var passwords = [pass1, pass2]
// £DEBUG autofill ----------->8------
//
first_name.value = "Jean"
//
last_name.value = "Tartampion"
//
initialsInput.value="JPP"
//
document.getElementById('country').value = "France"
//
email.value= makeRandomString(10)+"@om.fr"
//
pass1.value="123456+789"
//
pass2.value="123456+789"
//
document.getElementById('jobtitle').value = "atitle"
//
document.getElementById('keywords').value = "Blabla"
//
document.getElementById('institution').value = "CNRS"
first_name
.
value
=
"Jean"
last_name
.
value
=
"Tartampion"
initialsInput
.
value
=
"JPP"
document
.
getElementById
(
'country'
).
value
=
"France"
email
.
value
=
makeRandomString
(
10
)
+
"@om.fr"
pass1
.
value
=
"123456+789"
pass2
.
value
=
"123456+789"
document
.
getElementById
(
'jobtitle'
).
value
=
"atitle"
document
.
getElementById
(
'keywords'
).
value
=
"Blabla"
document
.
getElementById
(
'institution'
).
value
=
"CNRS"
// --------------------------->8------
...
...
templates/base_form.html
View file @
286760f4
...
...
@@ -141,7 +141,7 @@
<input
id=
"country"
name=
"country"
maxlength=
"60"
type=
"text"
class=
"form-control autocomp"
placeholder=
"pays"
onblur=
"if(this.value=='France'){teamCityDivStyle.display = 'block'}"
>
onblur=
"if(this.value=='France'){teamCityDivStyle.display = 'block'}
else {teamCityDivStyle.display='none'}
"
>
</div>
<!-- EMAIL & PASSWORD -->
...
...
@@ -220,19 +220,30 @@
<div
class=
"input-group"
>
<label
for=
"institution_type"
class=
"smlabel input-group-addon"
>
* Institution Type
</label>
<select
id=
"institution_type"
name=
"institution_type"
class=
"custom-select form-control"
>
<option
selected
value=
"1"
>
University
</option>
<option
value=
"2"
>
Public sector R
&
D organization
</option>
<option
value=
"2"
>
Other public sector organization
</option>
<option
value=
"3"
>
Private sector organization
</option>
<option
value=
"4"
>
None at the moment
</option>
<option
value=
"5"
>
Other
</option>
<!-- TODO other => show text -->
class=
"custom-select form-control"
onchange=
"if(this.value=='other'){otherInstDivStyle.display = 'block'} else {otherInstDivStyle.display='none'}"
>
<option
selected
value=
"university"
>
University
</option>
<option
value=
"public R&D org"
>
Public sector R
&
D organization
</option>
<option
value=
"public other org"
>
Other public sector organization
</option>
<option
value=
"private org"
>
Private sector organization
</option>
<option
value=
"none"
>
None at the moment
</option>
<option
value=
"other"
onclick=
"otherInstDivStyle.display = 'block'"
>
Other
</option>
</select>
</div>
<!-- Other institution type <=> only if previous choice == 5 -->
<div
class=
"question conditional-q"
id=
"other_institution_div"
>
<div
class=
"input-group"
>
<label
for=
"other_institution_type"
class=
"smlabel input-group-addon"
>
Other type
</label>
<input
id=
"other_institution_type"
name=
"other_institution_type"
maxlength=
"120"
type=
"text"
class=
"form-control"
placeholder=
"Clarify here the type of your parent institution"
>
</div>
</div>
</div>
<div
class=
"question"
>
<div
class=
"input-group"
>
<label
for=
"team_lab"
class=
"smlabel input-group-addon"
>
Lab / Team / Dept
</label>
...
...
Write
Preview
Markdown
is supported
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