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
1b04d79f
Commit
1b04d79f
authored
Feb 21, 2017
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tidy up and add loose branches
parent
b8ff0a08
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
59 additions
and
1713 deletions
+59
-1713
main.py
services/main.py
+35
-27
Dockerfile
setup/dockers/comex2_mysql_server/Dockerfile
+7
-1
comex.css
static/css/comex.css
+1
-1
comex_index.css
static/css/comex_index.css
+4
-0
comex_user.css
static/css/comex_user.css
+6
-34
comex_page_rootindex.js
static/js/comex_page_rootindex.js
+5
-1
alt_index.html
templates/alt_index.html
+0
-647
registration_full_form.html
templates/registration_full_form.html
+0
-597
registration_short_form.html
templates/registration_short_form.html
+0
-404
rootindex.html
templates/rootindex.html
+1
-1
No files found.
services/main.py
View file @
1b04d79f
...
...
@@ -82,36 +82,36 @@ login_manager.init_app(app)
# all inputs as they are declared in form, as a couple
SOURCE_FIELDS
=
[
# NAME, SANITIZE?
(
"luid"
,
False
),
(
"doors_uid"
,
False
),
(
"last_modified_date"
,
False
),
# ex 2016-11-16T17:47:07.308Z
(
"email"
,
True
),
(
"country"
,
True
),
(
"first_name"
,
True
),
(
"middle_name"
,
True
),
(
"last_name"
,
True
),
(
"initials"
,
True
),
# NAME, SANITIZE?
Specificity
(
"luid"
,
False
,
None
),
(
"doors_uid"
,
False
,
None
),
(
"last_modified_date"
,
False
,
None
),
# TODO use stamp
(
"email"
,
True
,
None
),
(
"country"
,
True
,
None
),
(
"first_name"
,
True
,
None
),
(
"middle_name"
,
True
,
None
),
(
"last_name"
,
True
,
None
),
(
"initials"
,
True
,
None
),
# => for *scholars* table
(
"position"
,
True
),
(
"hon_title"
,
True
),
(
"interests_text"
,
True
),
(
"gender"
,
False
),
# M|F
(
"job_looking_date"
,
True
),
# def null: not looking for a job
(
"home_url"
,
True
),
# scholar's homepage
(
"pic_url"
,
True
),
(
"pic_file"
,
False
),
# will be
saved separately
(
"position"
,
True
,
None
),
(
"hon_title"
,
True
,
None
),
(
"interests_text"
,
True
,
None
),
(
"gender"
,
False
,
None
),
# M|F
(
"job_looking_date"
,
True
,
None
),
# def null: not looking for a job
(
"home_url"
,
True
,
"url"
),
# scholar's homepage
(
"pic_url"
,
True
,
"url"
),
(
"pic_file"
,
False
,
None
),
#
saved separately
# => for *scholars* table (optional)
(
"org"
,
True
),
(
"org_type"
,
False
),
# values are predefined for thi
s
(
"other_org_type"
,
True
),
# +=> org_type in read_record()
(
"team_lab"
,
True
),
(
"org_city"
,
True
),
(
"org"
,
True
,
None
),
(
"org_type"
,
False
,
None
),
# predefined value
s
(
"other_org_type"
,
True
,
None
),
# +=> org_type
(
"team_lab"
,
True
,
None
),
(
"org_city"
,
True
,
None
),
# => for *affiliations* table
(
"keywords"
,
True
),
(
"keywords"
,
True
,
None
),
# => for *keywords* table (after split str)
(
"hashtags"
,
True
)
...
...
@@ -730,9 +730,13 @@ def read_record_from_request(request):
for
field_info
in
SOURCE_FIELDS
:
field
=
field_info
[
0
]
do_sanitize
=
field_info
[
1
]
spec_type
=
field_info
[
2
]
if
field
in
request
.
form
:
if
do_sanitize
:
val
=
sanitize
(
request
.
form
[
field
])
val
=
sanitize
(
request
.
form
[
field
],
is_url
=
(
spec_type
==
"url"
)
)
if
val
!=
''
:
clean_records
[
field
]
=
val
else
:
...
...
@@ -773,7 +777,7 @@ def read_record_from_request(request):
# TODO move to text submodules
def
sanitize
(
value
):
def
sanitize
(
value
,
is_url
=
False
):
"""
simple and radical: leaves only alphanum and '@' '.' '-' ':' ',' '(', ')', '#', ' '
...
...
@@ -784,7 +788,11 @@ def sanitize(value):
str_val
=
str
(
value
)
clean_val
=
sub
(
r'^\s+'
,
''
,
str_val
)
clean_val
=
sub
(
r'\s+$'
,
''
,
clean_val
)
san_val
=
sub
(
r'[^\w@\.:,()# -]'
,
'_'
,
clean_val
)
if
is_url
:
san_val
=
sub
(
r'[^\w@\.: -/]'
,
'_'
,
clean_val
)
else
:
san_val
=
sub
(
r'[^\w@\.:,()# -]'
,
'_'
,
clean_val
)
if
vtype
not
in
[
int
,
str
]:
raise
ValueError
(
"Value has an incorrect type
%
s"
%
str
(
vtype
))
...
...
setup/dockers/comex2_mysql_server/Dockerfile
View file @
1b04d79f
...
...
@@ -12,4 +12,10 @@ ADD init_comex_shared.sql /docker-entrypoint-initdb.d/
# if Adding data
# 1) a pre-existing database can be added via the volume in /data/shared_mysql_data
# 2) any pre-existing table-formed data can be imported if added inside into /var/lib/mysql-files
# 2) any pre-existing well-formed data can be imported if added inside into /var/lib/mysql-files
# exemple:
# ADD new_scholars_htids_mapping.tsv /var/lib/mysql-files/
# then in SQL something like:
# LOAD DATA INFILE '/var/lib/mysql-files/new_scholars_htids_mapping.tsv'
# INTO TABLE sch_ht IGNORE 1 LINES (uid,htid)
static/css/comex.css
View file @
1b04d79f
...
...
@@ -13,7 +13,7 @@
body
{
margin
:
0
;
font-family
:
"Droid Sans"
,
Calibri
,
"Helvetica Neue"
,
Helvetica
,
sans-serif
;
letter-spacing
:
-0.04em
;
/*letter-spacing: -0.04em;*/
color
:
#333
;
background-color
:
#fff
;
line-height
:
.9em
;
...
...
static/css/comex_
alt
.css
→
static/css/comex_
index
.css
View file @
1b04d79f
...
...
@@ -61,3 +61,7 @@ iframe.wwwthumbsmall {
border-radius
:
1em
;
padding
:
.8em
;
}
#news-container
{
min-height
:
50px
!important
;
}
static/css/comex_user.css
View file @
1b04d79f
...
...
@@ -335,44 +335,16 @@ input.is-realperson {
}
/* Autocomplete items */
.ui-menu-item
{
color
:
#337AB7
!important
;
font-family
:
"Droid Sans"
,
Calibri
,
"Helvetica Neue"
,
Helvetica
,
sans-serif
;
letter-spacing
:
normal
;
font-weight
:
bold
;
}
.ui-
menu-item
:hover
{
color
:
#fff
!important
;
.ui-
state-focus
,
.ui-state-hover
,
.ui-state-active
{
text-shadow
:
none
!important
;
/* <=== !!! */
font-weight
:
bold
!important
;
background-color
:
#5278B3
!important
;
border
:
.5px
solid
#6BB0E3
!important
;
}
/*.ui-autocomplete {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
float: left;
display: none;
min-width: 160px;
_width: 160px;
padding: 4px 0;
margin: 2px 0 0 0;
list-style: none;
background-color: #ffffff;
border-color: #ccc;
border-color: rgba(0, 0, 0, 0.2);
border-style: solid;
border-width: 1px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
*border-right-width: 2px;
*border-bottom-width: 2px;
}*/
static/js/comex_page_rootindex.js
View file @
1b04d79f
...
...
@@ -19,6 +19,10 @@
// so we put an absolute path and change the domain name at rendering.
var
relsrc
=
document
.
getElementById
(
'inlink'
).
src
document
.
getElementById
(
'inlink'
).
src
=
'https://'
+
location
.
host
+
'/'
+
relsrc
if
(
!
/^https/
.
test
(
relsrc
))
{
relsrc
=
'https://'
+
location
.
host
+
'/'
+
relsrc
}
document
.
getElementById
(
'inlink'
).
src
=
relsrc
console
.
log
(
"rootindex controllers load OK"
)
templates/alt_index.html
deleted
100644 → 0
View file @
b8ff0a08
This diff is collapsed.
Click to expand it.
templates/registration_full_form.html
deleted
100644 → 0
View file @
b8ff0a08
This diff is collapsed.
Click to expand it.
templates/registration_short_form.html
deleted
100644 → 0
View file @
b8ff0a08
This diff is collapsed.
Click to expand it.
templates/rootindex.html
View file @
1b04d79f
...
...
@@ -5,7 +5,7 @@
<meta
name=
"description"
content=
"Community Explorer Wall"
>
<meta
name=
"keywords"
content=
"community, user profiles, data exploration"
>
<link
type=
text/css
rel=
stylesheet
href=
"{{ url_for('static', filename='css/comex_
alt
.css') }}"
>
<link
type=
text/css
rel=
stylesheet
href=
"{{ url_for('static', filename='css/comex_
index
.css') }}"
>
<!-- for news vertical marquee -->
<script
type=
"text/javascript"
src=
"{{ url_for('static', filename='js/jquery.vticker-min.js') }}"
></script>
...
...
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