Commit eb9f81cb authored by Romain Loth's avatar Romain Loth

tying loose ends for hashtags

parent 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
...@@ -340,7 +340,7 @@ def get_full_scholar(uid): ...@@ -340,7 +340,7 @@ def get_full_scholar(uid):
# Exemple data in urow_dict # 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', # 'country': 'France', 'doors_uid': '5e3adbc1-bcfb-42da-a2c4-4af006fe2b91',
# 'email': 'jfk@usa.com', 'first_name': 'John', 'gender': 'M', # 'email': 'jfk@usa.com', 'first_name': 'John', 'gender': 'M',
# 'home_url': 'http://localhost/regcomex/', 'hon_title': 'Student', # 'home_url': 'http://localhost/regcomex/', 'hon_title': 'Student',
......
...@@ -113,7 +113,7 @@ SOURCE_FIELDS = [ ...@@ -113,7 +113,7 @@ SOURCE_FIELDS = [
("keywords", True ), ("keywords", True ),
# => for *keywords* table (after split str) # => for *keywords* table (after split str)
("community_hashtags", True ) ("hashtags", True )
# => for *hashtags* table (after split str) # => for *hashtags* table (after split str)
] ]
...@@ -340,6 +340,7 @@ def profile(): ...@@ -340,6 +340,7 @@ def profile():
mlog("DEBUG", "PROFILE: current_user details: \n - %s" % ( mlog("DEBUG", "PROFILE: current_user details: \n - %s" % (
'\n - '.join([current_user.info['email'], '\n - '.join([current_user.info['email'],
current_user.info['initials'], current_user.info['initials'],
current_user.info['doors_uid'],
str(current_user.info['keywords']), str(current_user.info['keywords']),
current_user.info['country']] current_user.info['country']]
) )
...@@ -481,12 +482,11 @@ def save_form(request_form, request_files, update_flag=False): ...@@ -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 # D) read/fill each keyword and save the (uid <=> kwid) pairings
# read/fill each hashtag and save the (uid <=> htid) pairings # read/fill each hashtag and save the (uid <=> htid) pairings
for intables in [['keywords', 'keywords', 'sch_kw'], for intable in ['keywords', 'hashtags']:
['community_hashtags', 'hashtags', 'sch_ht']]: tok_field = intable
tok_field = intables[0]
if tok_field in clean_records: if tok_field in clean_records:
tok_table = intables[1] tok_table = tok_field
map_table = intables[2] map_table = "sch_" + ('kw' if intable == 'keywords' else 'ht')
tokids = get_or_create_tokitems(clean_records[tok_field], reg_db, tok_table) tokids = get_or_create_tokitems(clean_records[tok_field], reg_db, tok_table)
...@@ -540,9 +540,9 @@ def read_record(incoming_data): ...@@ -540,9 +540,9 @@ def read_record(incoming_data):
clean_records['org_type'] = clean_records['other_org_type'] clean_records['org_type'] = clean_records['other_org_type']
# splits for kw_array and ht_array # 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: 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 = [] temp_array = []
for tok in clean_records[tok_field].split(','): for tok in clean_records[tok_field].split(','):
tok = sanitize(tok) tok = sanitize(tok)
......
...@@ -27,6 +27,9 @@ function selectSavedMenus(uinfo) { ...@@ -27,6 +27,9 @@ function selectSavedMenus(uinfo) {
if (myOption) { if (myOption) {
selectElt.selectedIndex = myOption.index selectElt.selectedIndex = myOption.index
} }
else {
console.warn(`selectSavedMenus: couldn't find option: ${chosenV} for element: ${colName}`)
}
} }
else { else {
console.warn("selectSavedMenus: couldn't find element: "+colName) console.warn("selectSavedMenus: couldn't find element: "+colName)
......
...@@ -35,7 +35,7 @@ cmxClt.uform.multiTextinput('keywords') ...@@ -35,7 +35,7 @@ cmxClt.uform.multiTextinput('keywords')
var shortRegVersion = true var shortRegVersion = true
var ignoredFields = [] var ignoredFields = []
if (shortRegVersion) { 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 // done when anything in the form changes
......
...@@ -50,7 +50,7 @@ var cmxClt = (function() { ...@@ -50,7 +50,7 @@ var cmxClt = (function() {
["initials", true, "pref", "t", null], ["initials", true, "pref", "t", null],
["position", true, "plsfill", "t", "map_infos"], ["position", true, "plsfill", "t", "map_infos"],
["interests_text", false, "pref", "t", "other_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"], ["gender", false, "plsfill", "m", "other_infos"],
["job_looking_date", false, "pref" , "d", "map_infos"], ["job_looking_date", false, "pref" , "d", "map_infos"],
["home_url", false, "plsfill", "t", "other_infos"], ["home_url", false, "plsfill", "t", "other_infos"],
......
...@@ -597,7 +597,7 @@ ...@@ -597,7 +597,7 @@
// --------- // ---------
// a copy of the user info in json // 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> </script>
<!-- our js --> <!-- our js -->
......
...@@ -59,7 +59,8 @@ ...@@ -59,7 +59,8 @@
<h3 class="formcatfirst"> Carte de visite </h3> <h3 class="formcatfirst"> Carte de visite </h3>
<div id="information-example" class="our-vcard"> <div id="information-example" class="our-vcard">
<ul> <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> <li>
<b>{{ current_user.info.hon_title }} <b>{{ current_user.info.hon_title }}
{{ current_user.info.first_name }} {{ current_user.info.first_name }}
...@@ -317,28 +318,22 @@ ...@@ -317,28 +318,22 @@
<div class="question"> <div class="question">
<div class="input-group"> <div class="input-group">
<label for="community_hashtags" class="smlabel input-group-addon">Interest groups</label> <label for="hashtags" class="smlabel input-group-addon">Interest groups</label>
<input id="community_hashtags" name="community_hashtags" maxlength="350" <input id="hashtags" name="hashtags" maxlength="350"
type="text" class="form-control" placeholder="eg #dataviz or #networks" type="text" class="form-control" placeholder="eg #dataviz, #networks"
value="{{ current_user.info.community_hashtags }}"> value="{{ current_user.info.hashtags }}">
</div> </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>
</div> <!-- /panel-body -->
</div> <!-- /panel-body -->
<div class="panel-footer ccsection-footer">&nbsp;</div> <div class="panel-footer ccsection-footer">&nbsp;</div>
</div> </div>
<!-- Affiliation --> <!-- Affiliation -->
<div class="panel ccsection-wrap"> <div class="panel ccsection-wrap">
<a class="ccsection-toggle" <a class="ccsection-toggle"
...@@ -527,9 +522,14 @@ ...@@ -527,9 +522,14 @@
<input id="last_modified_date" name="last_modified_date" type="text" hidden> <input id="last_modified_date" name="last_modified_date" type="text" hidden>
</input> </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 --> <!-- hidden input for doors user id -->
<input id="doors_uid" name="doors_uid" type="text" hidden <input id="doors_uid" name="doors_uid" type="text" hidden
value="{{ current_user.uid | safe }}"> value="{{ current_user.info.doors_uid | safe }}">
</input> </input>
......
...@@ -321,12 +321,11 @@ ...@@ -321,12 +321,11 @@
<div class="question"> <div class="question">
<div class="input-group"> <div class="input-group">
<label for="community_hashtags" class="smlabel input-group-addon">Interest groups</label> <label for="hashtags" class="smlabel input-group-addon">Interest groups</label>
<input id="community_hashtags" name="community_hashtags" maxlength="350" <input id="hashtags" name="hashtags" maxlength="350"
type="text" class="form-control" placeholder="eg #dataviz or #networks" type="text" class="form-control" placeholder="eg #dataviz, #networks">
placeholder="community_hashtags">
</div> </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>
......
...@@ -319,12 +319,11 @@ ...@@ -319,12 +319,11 @@
<div class="question"> <div class="question">
<div class="input-group"> <div class="input-group">
<label for="community_hashtags" class="smlabel input-group-addon">Interest groups</label> <label for="hashtags" class="smlabel input-group-addon">Interest groups</label>
<input id="community_hashtags" name="community_hashtags" maxlength="350" <input id="hashtags" name="hashtags" maxlength="350"
type="text" class="form-control" placeholder="eg #dataviz or #networks" type="text" class="form-control" placeholder="eg #dataviz, #networks">
placeholder="community_hashtags">
</div> </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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment