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
eb9f81cb
Commit
eb9f81cb
authored
Jan 23, 2017
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tying loose ends for hashtags
parent
755ba90a
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
37 additions
and
54 deletions
+37
-54
cols.tsv
doc/cols.tsv
+0
-18
db.py
services/db.py
+1
-1
main.py
services/main.py
+8
-8
comex_page_profile_controllers.js
static/js/comex_page_profile_controllers.js
+3
-0
comex_page_reg_controllers.js
static/js/comex_page_reg_controllers.js
+1
-1
comex_user_shared.js
static/js/comex_user_shared.js
+1
-1
alt_index.html
templates/alt_index.html
+1
-1
profile.html
templates/profile.html
+14
-14
registration_full_form.html
templates/registration_full_form.html
+4
-5
registration_short_form.html
templates/registration_short_form.html
+4
-5
No files found.
doc/cols.tsv
deleted
100644 → 0
View file @
755ba90a
doors_uid char(36) not null unique,
last_modified_date char(10) not null,
email varchar(255) not null unique primary key,
initials varchar(7) not null,
country varchar(60) not null,
first_name varchar(30) not null,
middle_name varchar(30),
last_name varchar(50) not null,
jobtitle varchar(30) not null,
keywords varchar(350) not null,
institution varchar(120) not null,
institution_type varchar(50) not null,
team_lab varchar(50),
institution_city varchar(50),
interests_text varchar(1200),
community_hashtags varchar(350),
gender char(1),
pic_file blob
services/db.py
View file @
eb9f81cb
...
...
@@ -340,7 +340,7 @@ def get_full_scholar(uid):
# Exemple data in urow_dict
# --------------------------
# {'affid': 1, 'affiliation_id': 1, '
community_hashtags': '#something
',
# {'affid': 1, 'affiliation_id': 1, '
hashtags': '#something, #another
',
# 'country': 'France', 'doors_uid': '5e3adbc1-bcfb-42da-a2c4-4af006fe2b91',
# 'email': 'jfk@usa.com', 'first_name': 'John', 'gender': 'M',
# 'home_url': 'http://localhost/regcomex/', 'hon_title': 'Student',
...
...
services/main.py
View file @
eb9f81cb
...
...
@@ -113,7 +113,7 @@ SOURCE_FIELDS = [
(
"keywords"
,
True
),
# => for *keywords* table (after split str)
(
"
community_hashtags"
,
True
)
(
"
hashtags"
,
True
)
# => for *hashtags* table (after split str)
]
...
...
@@ -340,6 +340,7 @@ def profile():
mlog
(
"DEBUG"
,
"PROFILE: current_user details:
\n
-
%
s"
%
(
'
\n
- '
.
join
([
current_user
.
info
[
'email'
],
current_user
.
info
[
'initials'
],
current_user
.
info
[
'doors_uid'
],
str
(
current_user
.
info
[
'keywords'
]),
current_user
.
info
[
'country'
]]
)
...
...
@@ -481,12 +482,11 @@ def save_form(request_form, request_files, update_flag=False):
# D) read/fill each keyword and save the (uid <=> kwid) pairings
# read/fill each hashtag and save the (uid <=> htid) pairings
for
intables
in
[[
'keywords'
,
'keywords'
,
'sch_kw'
],
[
'community_hashtags'
,
'hashtags'
,
'sch_ht'
]]:
tok_field
=
intables
[
0
]
for
intable
in
[
'keywords'
,
'hashtags'
]:
tok_field
=
intable
if
tok_field
in
clean_records
:
tok_table
=
intables
[
1
]
map_table
=
intables
[
2
]
tok_table
=
tok_field
map_table
=
"sch_"
+
(
'kw'
if
intable
==
'keywords'
else
'ht'
)
tokids
=
get_or_create_tokitems
(
clean_records
[
tok_field
],
reg_db
,
tok_table
)
...
...
@@ -540,9 +540,9 @@ def read_record(incoming_data):
clean_records
[
'org_type'
]
=
clean_records
[
'other_org_type'
]
# splits for kw_array and ht_array
for
tok_field
in
[
'keywords'
,
'
community_
hashtags'
]:
for
tok_field
in
[
'keywords'
,
'hashtags'
]:
if
tok_field
in
clean_records
:
print
(
tok_field
,
"in clean_records"
)
mlog
(
"DEBUG"
,
"in clean_records, found a field to tokenize:
%
s"
%
tok_field
)
temp_array
=
[]
for
tok
in
clean_records
[
tok_field
]
.
split
(
','
):
tok
=
sanitize
(
tok
)
...
...
static/js/comex_page_profile_controllers.js
View file @
eb9f81cb
...
...
@@ -27,6 +27,9 @@ function selectSavedMenus(uinfo) {
if
(
myOption
)
{
selectElt
.
selectedIndex
=
myOption
.
index
}
else
{
console
.
warn
(
`selectSavedMenus: couldn't find option:
${
chosenV
}
for element:
${
colName
}
`
)
}
}
else
{
console
.
warn
(
"selectSavedMenus: couldn't find element: "
+
colName
)
...
...
static/js/comex_page_reg_controllers.js
View file @
eb9f81cb
...
...
@@ -35,7 +35,7 @@ cmxClt.uform.multiTextinput('keywords')
var
shortRegVersion
=
true
var
ignoredFields
=
[]
if
(
shortRegVersion
)
{
ignoredFields
=
[
'
community_hashtags'
,
'
gender'
,
'home_url'
,
'org'
,
'org_type'
]
ignoredFields
=
[
'gender'
,
'home_url'
,
'org'
,
'org_type'
]
}
// done when anything in the form changes
...
...
static/js/comex_user_shared.js
View file @
eb9f81cb
...
...
@@ -50,7 +50,7 @@ var cmxClt = (function() {
[
"initials"
,
true
,
"pref"
,
"t"
,
null
],
[
"position"
,
true
,
"plsfill"
,
"t"
,
"map_infos"
],
[
"interests_text"
,
false
,
"pref"
,
"t"
,
"other_infos"
],
[
"
community_hashtags"
,
false
,
"plsfill"
,
"at"
,
"map_infos"
],
[
"
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"
],
...
...
templates/alt_index.html
View file @
eb9f81cb
...
...
@@ -597,7 +597,7 @@
// ---------
// a copy of the user info in json
// ---------
var
uinfo
=
{{
current_user
.
json_info
if
current_user
.
info
else
"null"
|
safe
}};
var
uinfo
=
{{
(
current_user
.
json_info
|
safe
)
if
current_user
.
info
else
(
"null"
|
safe
)
}};
</script>
<!-- our js -->
...
...
templates/profile.html
View file @
eb9f81cb
...
...
@@ -59,7 +59,8 @@
<h3
class=
"formcatfirst"
>
Carte de visite
</h3>
<div
id=
"information-example"
class=
"our-vcard"
>
<ul>
<img
src=
"{{ current_user.info.pic_url }}"
width=
"80px"
style=
"float:left;margin:5px"
>
<!-- TODO if empty then click on image starts showPicImg -->
<img
src=
"{{ (current_user.pic_url | safe) if current_user.info else '' }}"
width=
"80px"
style=
"float:left;margin:5px"
>
<li>
<b>
{{ current_user.info.hon_title }}
{{ current_user.info.first_name }}
...
...
@@ -317,28 +318,22 @@
<div
class=
"question"
>
<div
class=
"input-group"
>
<label
for=
"
community_
hashtags"
class=
"smlabel input-group-addon"
>
Interest groups
</label>
<input
id=
"
community_hashtags"
name=
"community_
hashtags"
maxlength=
"350"
type=
"text"
class=
"form-control"
placeholder=
"eg #dataviz
or
#networks"
value=
"{{ current_user.info.
community_
hashtags }}"
>
<label
for=
"hashtags"
class=
"smlabel input-group-addon"
>
Interest groups
</label>
<input
id=
"
hashtags"
name=
"
hashtags"
maxlength=
"350"
type=
"text"
class=
"form-control"
placeholder=
"eg #dataviz
,
#networks"
value=
"{{ current_user.info.hashtags }}"
>
</div>
<p
class=
"legend"
>
Interest groups
aka "seminar hashtags" (full suggestion list available shortly)
</p>
<p
class=
"legend"
>
Interest groups
(for seminars, mailing lists, events) aka "community hashtags"
</p>
</div>
</div>
<!-- /panel-body -->
</div>
<!-- /panel-body -->
<div
class=
"panel-footer ccsection-footer"
>
</div>
</div>
<!-- Affiliation -->
<div
class=
"panel ccsection-wrap"
>
<a
class=
"ccsection-toggle"
...
...
@@ -527,9 +522,14 @@
<input
id=
"last_modified_date"
name=
"last_modified_date"
type=
"text"
hidden
>
</input>
<!-- hidden input for main user id -->
<input
id=
"luid"
name=
"luid"
type=
"text"
hidden
value=
"{{ current_user.uid | safe }}"
>
</input>
<!-- hidden input for doors user id -->
<input
id=
"doors_uid"
name=
"doors_uid"
type=
"text"
hidden
value=
"{{ current_user.uid | safe }}"
>
value=
"{{ current_user.
info.doors_
uid | safe }}"
>
</input>
...
...
templates/registration_full_form.html
View file @
eb9f81cb
...
...
@@ -321,12 +321,11 @@
<div
class=
"question"
>
<div
class=
"input-group"
>
<label
for=
"community_hashtags"
class=
"smlabel input-group-addon"
>
Interest groups
</label>
<input
id=
"community_hashtags"
name=
"community_hashtags"
maxlength=
"350"
type=
"text"
class=
"form-control"
placeholder=
"eg #dataviz or #networks"
placeholder=
"community_hashtags"
>
<label
for=
"hashtags"
class=
"smlabel input-group-addon"
>
Interest groups
</label>
<input
id=
"hashtags"
name=
"hashtags"
maxlength=
"350"
type=
"text"
class=
"form-control"
placeholder=
"eg #dataviz, #networks"
>
</div>
<p
class=
"legend"
>
Interest groups
aka "seminar hashtags" (full suggestion list available shortly)
</p>
<p
class=
"legend"
>
Interest groups
(for seminars, mailing lists, events) aka "community hashtags"
</p>
</div>
...
...
templates/registration_short_form.html
View file @
eb9f81cb
...
...
@@ -319,12 +319,11 @@
<div
class=
"question"
>
<div
class=
"input-group"
>
<label
for=
"community_hashtags"
class=
"smlabel input-group-addon"
>
Interest groups
</label>
<input
id=
"community_hashtags"
name=
"community_hashtags"
maxlength=
"350"
type=
"text"
class=
"form-control"
placeholder=
"eg #dataviz or #networks"
placeholder=
"community_hashtags"
>
<label
for=
"hashtags"
class=
"smlabel input-group-addon"
>
Interest groups
</label>
<input
id=
"hashtags"
name=
"hashtags"
maxlength=
"350"
type=
"text"
class=
"form-control"
placeholder=
"eg #dataviz, #networks"
>
</div>
<p
class=
"legend"
>
Interest groups
aka "seminar hashtags" (full suggestion list available shortly)
</p>
<p
class=
"legend"
>
Interest groups
(for seminars, mailing lists, events) aka "community hashtags"
</p>
</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