This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
section[role="first"] { width: 300px; } | |
section[role="first"] .trip-info { text-align: left; } | |
section[role="first"] .trip-info .book-trip { | |
float: right; | |
margin: 0 0 0 10px; | |
} | |
section[role="first"] .trip-info .book-trip .book-btn { | |
display: block; | |
border-bottom: 3px solid #ba5d24; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
section[role="first"] { | |
width: 300px; | |
.trip-info { | |
text-align: left; | |
.book-trip { | |
float: right; | |
margin: 0 0 0 10px; | |
.book-btn { | |
display: block; | |
border-bottom: 3px solid #ba5d24; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
section[role="first"] | |
width: 300px | |
.trip-info | |
text-align: left | |
.book-trip | |
float: right | |
margin: 0 0 0 10px | |
.book-btn | |
display: block | |
border-bottom: 3px solid #ba5d24 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetchTrustCloudInfo: function() { | |
var self = this; | |
$.ajax({ | |
method: 'get', | |
url: 'https://api.trustcloud.com/profile/getProfile?userid=email-' + this.model.get('email'), | |
dataType: 'json', | |
success: function(data) { | |
self.renderTrustCloudInfo(data); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var User = Backbone.Model.extend({ | |
defaults: { | |
email: '[email protected]', | |
} | |
}); | |
var UserShow = Backbone.View.extend({ | |
initialize: function() { | |
_.bindAll(this, 'render'); | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
renderTrustCloudNetworks: function(user) { | |
_.each(user.networks, function(item) { | |
var iconHtml = '<li><a target="_new" href="'+item.url+'"><img src="'+item.icon+'" /></a></li>'; | |
$('.badges').append(iconHtml); | |
}); | |
}, | |
renderTrustCardAbsent: function() { | |
$('.badges').append('<li>No TrustCard Found!</li>'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
renderTrustCloudInfo: function(data) { | |
if(data.code === 200) { | |
this.renderTrustScore(data.user) | |
this.renderTrustCloudNetworks(data.user); | |
} else { | |
this.renderTrustCardAbsent(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
renderTrustScore: function(user) { | |
$('#trustscore').html(user.trustscore); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var User = Backbone.Model.extend({ | |
defaults: { | |
email: '[email protected]', | |
fullName: 'Robert Pearce' | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var UserShow = Backbone.View.extend({ | |
initialize: function() { | |
_.bindAll(this, 'render'); | |
}, | |
render: function() { | |
$('#name').html(this.model.get('fullName')) | |
this.fetchTrustCloudInfo(); | |
}, |