Skip to content

Commit

Permalink
Merge pull request #932 from gannetson/project-links
Browse files Browse the repository at this point in the history
Fix links on project detail
  • Loading branch information
gannetson committed Nov 27, 2013
2 parents 9a92fdc + 15786f2 commit 525b080
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 17 deletions.
33 changes: 26 additions & 7 deletions apps/projects/static/js/bluebottle/projects/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,37 @@ App.Organization = DS.Model.extend({
website: DS.attr('string', {defaultValue: ""}),
facebook: DS.attr('string', {defaultValue: ""}),
twitter: DS.attr('string', {defaultValue: ""}),
skype: DS.attr('string', {defaultValue: ""}),


websiteUrl: function(){
var website = this.get('website');
if (website) {
if (website.substr(0, 4) != 'http') {
return 'http://' + website;
}
return website;
}
return "";
}.property('website'),
facebookUrl: function(){
return this.get('facebook');
var facebook = this.get('facebook');
if (facebook) {
if (facebook.substr(0, 4) != 'http') {
return 'http://' + facebook;
}
return facebook;
}
return "";
}.property('facebook'),
twitterUrl: function(){
return this.get('twitter');
var twitter = this.get('facebook');
if (twitter) {
if (twitter.substr(0, 4) != 'http') {
return 'http://' + twitter;
}
return twitter;
}
return "";
}.property('twitter'),
skypeUrl: function(){
return 'callto:' + this.get('skype');
}.property('skype'),

// Legal
legalStatus: DS.attr('string', {defaultValue: ""})
Expand Down
11 changes: 2 additions & 9 deletions apps/projects/templates/projects.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -436,12 +436,11 @@
<h2>{% trans "Organisation" %}</h2>
<h3>{{organization.name}}</h3>
<p>{{organization.description}}</p>



{{#if organization.website}}
<dl>
<dt><span class="flaticon solid link-1"></span> Website</dt>
<dd><a href="{{organization.website}}">{{organization.website}}</a></dd>
<dd><a {{bindAttr href=organization.websiteUrl}}>{{organization.website}}</a></dd>
</dl>
{{/if}}
{{#if organization.twitter}}
Expand All @@ -456,12 +455,6 @@
<dd><a {{bindAttr href=organization.facebookUrl}}>{{organization.facebook}}</a></dd>
</dl>
{{/if}}
{{#if organization.skype}}
<dl>
<dt><span class="flaticon social skype-2"></span> Skype</dt>
<dd><a {{bindAttr href=organization.skypeUrl}}>{{organization.skype}}</a></dd>
</dl>
{{/if}}
</ul>
</article>
{{/if}}
Expand Down
2 changes: 1 addition & 1 deletion static/global/css/screen.css

Large diffs are not rendered by default.

0 comments on commit 525b080

Please sign in to comment.