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
13ff9bdd
Commit
13ff9bdd
authored
Jan 13, 2017
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make field pointer able to open containing panel (TODO transform cC.COLS in a dict to optimize)
parent
94d7b3ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
87 additions
and
38 deletions
+87
-38
comex_user_shared.js
static/js/comex_user_shared.js
+68
-25
profile.html
templates/profile.html
+19
-13
No files found.
static/js/comex_user_shared.js
View file @
13ff9bdd
...
...
@@ -33,33 +33,33 @@ var cmxClt = (function() {
cC
.
strokeDeepGrey
=
"3px 3px 4px #333,-3px 3px 4px #333,-3px -3px 4px #333,3px -3px 4px #333"
// the target columns in DB: tuple (name, mandatory
Bool, group, type
)
cC
.
COLS
=
[
[
"doors_uid"
,
true
,
"auto"
,
"t"
],
[
"last_modified_date"
,
true
,
"auto"
,
"d"
],
[
"email"
,
true
,
"plsfill"
,
"t"
],
[
"country"
,
true
,
"plsfill"
,
"t"
],
[
"first_name"
,
true
,
"plsfill"
,
"t"
],
[
"middle_name"
,
false
,
"pref"
,
"t"
],
[
"last_name"
,
true
,
"plsfill"
,
"t"
],
[
"initials"
,
true
,
"plsfill"
,
"t"
],
[
"position"
,
true
,
"plsfill"
,
"t"
],
[
"hon_title"
,
false
,
"plsfill"
,
"t"
],
[
"interests_text"
,
false
,
"plsfill"
,
"t"
],
[
"community_hashtags"
,
false
,
"plsfill"
,
"at"
],
[
"gender"
,
false
,
"plsfill"
,
"m"
],
[
"job_looking_date"
,
false
,
"pref"
,
"d"
],
[
"home_url"
,
false
,
"plsfill"
,
"t"
],
[
"pic_url"
,
false
,
"pref"
,
"t"
],
[
"pic_file"
,
false
,
"pref"
,
"f"
],
// the target columns in DB: tuple (name, mandatory
, group, type, section
)
cC
.
COLS
=
[
[
"doors_uid"
,
true
,
"auto"
,
"t"
,
null
],
[
"last_modified_date"
,
true
,
"auto"
,
"d"
,
null
],
[
"email"
,
true
,
"plsfill"
,
"t"
,
"basic_infos"
],
[
"country"
,
true
,
"plsfill"
,
"t"
,
"basic_infos"
],
[
"first_name"
,
true
,
"plsfill"
,
"t"
,
"basic_infos"
],
[
"middle_name"
,
false
,
"pref"
,
"t"
,
"basic_infos"
],
[
"last_name"
,
true
,
"plsfill"
,
"t"
,
"basic_infos"
],
[
"initials"
,
true
,
"plsfill"
,
"t"
,
null
],
[
"position"
,
true
,
"plsfill"
,
"t"
,
"map_infos"
],
[
"hon_title"
,
false
,
"plsfill"
,
"t"
,
"basic_infos"
],
[
"interests_text"
,
false
,
"plsfill"
,
"t"
,
"other_infos"
],
[
"community_hashtags"
,
false
,
"plsfill"
,
"at"
,
"map_infos"
],
[
"gender"
,
false
,
"plsfill"
,
"m"
,
"other_infos"
],
[
"job_looking_date"
,
false
,
"pref"
,
"d"
,
"map_infos"
],
[
"home_url"
,
false
,
"plsfill"
,
"t"
,
"other_infos"
],
[
"pic_url"
,
false
,
"pref"
,
"t"
,
"other_infos"
],
[
"pic_file"
,
false
,
"pref"
,
"f"
,
"other_infos"
],
// ==> *scholars* table
[
"keywords"
,
true
,
"plsfill"
,
"at"
],
[
"keywords"
,
true
,
"plsfill"
,
"at"
,
"map_infos"
],
// ==> *keywords* table
[
"org"
,
true
,
"plsfill"
,
"t"
],
[
"org_type"
,
true
,
"plsfill"
,
"m"
],
[
"team_lab"
,
false
,
"pref"
,
"t"
],
[
"org_city"
,
false
,
"pref"
,
"t"
]]
[
"org"
,
true
,
"plsfill"
,
"t"
,
"org_infos"
],
[
"org_type"
,
true
,
"plsfill"
,
"m"
,
"org_infos"
],
[
"team_lab"
,
false
,
"pref"
,
"t"
,
"map_infos"
],
[
"org_city"
,
false
,
"pref"
,
"t"
,
"org_infos"
]]
// ==> *affiliations* table
// group "auto" === filled by controllers
...
...
@@ -90,8 +90,13 @@ var cmxClt = (function() {
var
fname
=
cplArray
[
i
][
0
]
var
flabel
=
cplArray
[
i
][
1
]
// to open any collapsible containing the label and input
var
openFun
=
'return cC.uform.openPanelForField(
\'
'
+
fname
+
'
\'
)'
console
.
log
(
"openFun"
,
openFun
)
// link works if anchorLabels was run
resultHtml
+=
'<li class="minilabel"><a href="#'
+
fname
+
'_lbl'
+
'">'
+
flabel
+
'</a></li>'
resultHtml
+=
'<li class="minilabel"><a
onclick="'
+
openFun
+
'"
href="#'
+
fname
+
'_lbl'
+
'">'
+
flabel
+
'</a></li>'
}
resultHtml
+=
'</ul>'
return
resultHtml
...
...
@@ -109,12 +114,19 @@ var cmxClt = (function() {
// insert after
// cf. stackoverflow.com/questions/4793604
function
insertAfter
(
referenceNode
,
newNode
)
{
cC
.
insertAfter
=
function
(
referenceNode
,
newNode
)
{
referenceNode
.
parentNode
.
insertBefore
(
newNode
,
referenceNode
.
nextSibling
)
}
// find ancestor
// cf. stackoverflow.com/questions/22119673
cC
.
findAncestor
=
function
(
elt
,
cls
)
{
while
((
elt
=
elt
.
parentElement
)
&&
!
elt
.
classList
.
contains
(
cls
));
return
elt
}
// ============================================
// cmxClt.uform: common vars to all user forms
// ============================================
...
...
@@ -133,6 +145,7 @@ var cmxClt = (function() {
cC
.
uform
.
stampTime
cC
.
uform
.
anchorLabels
cC
.
uform
.
multiTextinput
cC
.
uform
.
openPanelForField
// dates up to 2049/12/31
cC
.
uform
.
validDate
=
new
RegExp
(
/^20
[
0-4
][
0-9
]\/(?:
0
?[
1-9
]
|1
[
0-2
])\/(?:
0
?[
1-9
]
|
[
1-2
][
0-9
]
|3
[
0-1
])
$/
)
...
...
@@ -180,6 +193,36 @@ var cmxClt = (function() {
}
// openPanelForField
cC
.
uform
.
openPanelForField
=
function
(
fName
)
{
console
.
log
(
'fName'
,
fName
)
var
labelElt
=
document
.
getElementById
(
fName
+
'_lbl'
)
var
ourPanel
=
cC
.
findAncestor
(
labelElt
,
"panel-collapse"
)
console
.
log
(
'ourPanel.classList.contains("in")'
,
ourPanel
.
classList
.
contains
(
'in'
))
// if panel is not open
if
(
!
ourPanel
.
classList
.
contains
(
'in'
))
{
// POSS use cols with key/value structure to use cols[fName] instead of looking for i
var
theCol
=
-
1
for
(
var
i
in
cC
.
COLS
)
{
if
(
fName
==
cC
.
COLS
[
i
][
0
])
{
theCol
=
i
break
}
}
var
ccSection
=
cC
.
COLS
[
i
][
4
]
console
.
log
(
'ccSection'
,
ccSection
)
if
(
ccSection
)
{
// click the corresponding toggler
document
.
getElementById
(
'ccsection_toggle_'
+
ccSection
).
click
()
}
}
}
// initialize
// -----------
cC
.
uform
.
initialize
=
function
(
aFormId
,
aValidationFun
)
{
...
...
templates/profile.html
View file @
13ff9bdd
...
...
@@ -39,7 +39,8 @@
data-parent=
"#profile_box"
data-toggle=
"collapse"
href=
"#overview"
aria-controls=
"overview"
>
aria-controls=
"overview"
id=
"ccsection_toggle_overview"
>
<div
class=
"panel-heading ccsection-heading"
role=
"tab"
>
<h2
class=
"ccsection"
>
...
...
@@ -51,8 +52,8 @@
</a>
<div
id=
"overview"
class=
"panel-body panel-collapse collapse
out
"
role=
"tabpanel"
aria-expanded=
"
fals
e"
>
class=
"panel-body panel-collapse collapse
in
"
role=
"tabpanel"
aria-expanded=
"
tru
e"
>
<!-- CARTE DE VISITE -->
<h3
class=
"formcatfirst"
>
Carte de visite
</h3>
...
...
@@ -94,7 +95,7 @@
value=
"{{ current_user.info.email }}"
>
</div>
</div>
<div
class=
"panel-footer ccsection-footer"
>
&
nbsp
</div>
<div
class=
"panel-footer ccsection-footer"
>
 
;
</div>
</div>
...
...
@@ -119,7 +120,8 @@
data-parent=
"#profile_uform"
data-toggle=
"collapse"
href=
"#basic_infos_usection"
aria-controls=
"basic_infos_usection"
>
aria-controls=
"basic_infos_usection"
id=
"ccsection_toggle_basic_infos"
>
<div
class=
"panel-heading ccsection-heading"
role=
"tab"
>
<h2
class=
"ccsection"
...
...
@@ -204,7 +206,7 @@
</div>
<!-- /panel-body -->
<div
class=
"panel-footer ccsection-footer"
>
&
nbsp
</div>
<div
class=
"panel-footer ccsection-footer"
>
 
;
</div>
</div>
...
...
@@ -222,7 +224,8 @@
data-parent=
"#profile_uform"
data-toggle=
"collapse"
href=
"#map_infos_usection"
aria-controls=
"map_infos_usection"
>
aria-controls=
"map_infos_usection"
id=
"ccsection_toggle_map_infos"
>
<div
class=
"panel-heading ccsection-heading"
role=
"tab"
>
<h2
class=
"ccsection"
...
...
@@ -320,7 +323,7 @@
</div>
<!-- /panel-body -->
<div
class=
"panel-footer ccsection-footer"
>
&
nbsp
</div>
<div
class=
"panel-footer ccsection-footer"
>
 
;
</div>
</div>
...
...
@@ -338,7 +341,8 @@
data-parent=
"#profile_uform"
data-toggle=
"collapse"
href=
"#org_infos_usection"
aria-controls=
"org_infos_usection"
>
aria-controls=
"org_infos_usection"
id=
"ccsection_toggle_org_infos"
>
<div
class=
"panel-heading ccsection-heading"
role=
"tab"
>
<h2
class=
"ccsection"
...
...
@@ -372,7 +376,8 @@
<select
id=
"org_type"
name=
"org_type"
class=
"custom-select form-control"
onchange=
"if(this.value=='other'){otherInstDivStyle.display = 'block'} else {otherInstDivStyle.display='none'}"
>
<option
selected
value=
"university"
>
University
</option>
<option
selected
disabled
value=
""
>
Please select
</option>
<option
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>
...
...
@@ -395,7 +400,7 @@
</div>
<!-- /panel-body -->
<div
class=
"panel-footer ccsection-footer"
>
&
nbsp
</div>
<div
class=
"panel-footer ccsection-footer"
>
 
;
</div>
</div>
...
...
@@ -409,7 +414,8 @@
data-parent=
"#profile_uform"
data-toggle=
"collapse"
href=
"#other_infos_usection"
aria-controls=
"other_infos_usection"
>
aria-controls=
"other_infos_usection"
id=
"ccsection_toggle_other_infos"
>
<div
class=
"panel-heading ccsection-heading"
role=
"tab"
>
<h2
class=
"ccsection"
...
...
@@ -508,7 +514,7 @@
</div>
</div>
<!-- /panel-body -->
<div
class=
"panel-footer ccsection-footer"
>
&
nbsp
</div>
<div
class=
"panel-footer ccsection-footer"
>
 
;
</div>
</div>
...
...
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