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):
# 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',
......
......@@ -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)
......
......@@ -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)
......
......@@ -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
......
......@@ -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"],
......
......@@ -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 -->
......
......@@ -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 class="panel-footer ccsection-footer">&nbsp;</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>
......
......@@ -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>
......
......@@ -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>
......
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