Closed
Bug 1000923
Opened 10 years ago
Closed 10 years ago
Link External Accounts which are urls
Categories
(Participation Infrastructure :: Phonebook, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: giorgos, Assigned: verbole)
Details
(Whiteboard: [kb=1355875] )
Attachments
(1 file)
33.39 KB,
image/png
|
Details |
External accounts which are urls, like LinkedIn or SuMo should be displayed as links on user profile.
Reporter | ||
Updated•10 years ago
|
Flags: needinfo?(giorgos)
OS: Linux → All
Hardware: x86_64 → All
Reporter | ||
Comment 2•10 years ago
|
||
Sure! We want to link external accounts which are website urls (starting with http) but not emails or anything other that can be linked. What is your plan?
Assignee: nobody → verbole
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•10 years ago
|
||
Thanks for assigning this bug to me. I have an idea that if account type like LinkedIn has an url to a website than in its 'url' field we put only {identifier} so for LinkedIn it would be: 'url': '{identifier}' We will also have a list e.g. account_types_url_is_identifier = [k for (k,v) in ACCOUNT_TYPES.iteritems() if v['url'] == {identifier}] And than in method get_identifier_url we ask is self.type in account_types_url_is_identifier and if it is than we just return iri_to_uri(self.identifier) I try and it worked. Maybe any better idea?
Assignee | ||
Comment 4•10 years ago
|
||
And of course validator should be validate_website.
Reporter | ||
Comment 5•10 years ago
|
||
While this is valid idea, we used to have this until we faced problems when cleaning the input https://github.com/mozilla/mozillians/blob/master/mozillians/phonebook/forms.py#L38 If you like to try this, by all means. Instead I'd go ahead and create a template filter, much like urlize but without urlizing emails. This would also simplify the template code. http://jinja.pocoo.org/docs/templates/#urlize What do you think?
Reporter | ||
Comment 6•10 years ago
|
||
Btw I like the validator idea.
Assignee | ||
Comment 7•10 years ago
|
||
Thanks for great advice. I try with urlize. Do you have any idea why it doesn't work with https urls? If I try https://www.google.com it urlizes to https//www.google.com (without colon)? With only http it works great. Why we don't urlize email also. It gives link to send a email: mailto:email@email.com But for now I test if identifier contains 'http' and only than urlize.
Reporter | ||
Comment 8•10 years ago
|
||
Hehe I think you just found a jinja2 bug :) We don't want to urlize emails because not everything that looks like an email, is an email. Like the XMPP account type you hacked the other day. It makes no sense to link this as email. Because of that you can't use jinja's urlize anyway, so you can go ahead can code your own helper which works for https urls too.
Assignee | ||
Comment 9•10 years ago
|
||
I made some investigation and saw that in jinja2 2.7 it should work for https also. We use version 2.5.5 Yes, i get it up now, why not urlize emails, because some of them actually don't even exists. :) I can write helper but I don't know which file would be most suited to write helper in?
Reporter | ||
Comment 10•10 years ago
|
||
Here it should be fine https://github.com/mozilla/mozillians/blob/master/mozillians/phonebook/helpers.py
Reporter | ||
Updated•10 years ago
|
Whiteboard: [kb=1355875]
Comment 11•10 years ago
|
||
Commit pushed to master at https://github.com/mozilla/mozillians https://github.com/mozilla/mozillians/commit/03fb1b5c1a6a13cd961d1cbb74b79c4afcd3ab39 [fix bug 1000923] Link External Accounts which are urls.
Updated•10 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Updated•10 years ago
|
Version: other → next
Reporter | ||
Updated•10 years ago
|
Version: next → 2014-05.2
Reporter | ||
Comment 12•10 years ago
|
||
QA steps to verify: * Populate your profile with some accounts that expect full URLs. ATM this is only LinkedIn * Your profile page should list LinkedIn, display the full URL and link to that URL * Other accounts which are not links, should not be linked: * E.g. "Jabber" accounts should not be linked
You need to log in
before you can comment on or make changes to this bug.
Description
•