-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7742e71
commit 6337327
Showing
15 changed files
with
344 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
PhotosCollection = Backbone.Collection.extend({ | ||
model: Photo | ||
}); |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
Phone = Backbone.Model.extend({ | ||
urlRoot: '/api/phones' | ||
urlRoot: '/api/phones', | ||
|
||
parse: function (res) { | ||
if (res.images) { | ||
this.photosCollection = new PhotosCollection(_.map(res.images, function (image_path) { return { path: image_path }; })); | ||
this.set('mainImage', this.photosCollection.models[0]); | ||
} | ||
return res; | ||
} | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Photo = Backbone.Model; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
TBD: detail view for [[= get('id') ]] | ||
<div class='phone-images'></div> | ||
<h1>[[= get('name') ]]</h1> | ||
<p>[[= get('description') ]]</p> | ||
<ul class='phone-thumbs'></ul> | ||
<ul class='specs'></ul> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<img src="[[= '/' + get('path') ]]" class='phone'> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<img src="[[= '/' + get('path') ]]"> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
<li> | ||
<span>Availability and Networks</span> | ||
<dl> | ||
<dt>Availability</dt> | ||
<dd>[[= get('availability') ]]</dd> | ||
</dl> | ||
</li> | ||
|
||
<li> | ||
<span>Battery</span> | ||
<dl> | ||
<dt>Type</dt> | ||
<dd>[[= get('battery').type ]]</dd> | ||
<dt>Talk Time</dt> | ||
<dd>[[= get('battery').talkTime ]]</dd> | ||
<dt>Standby time (max)</dt> | ||
<dd>[[= get('battery').standbyTime ]]</dd> | ||
</dl> | ||
</li> | ||
|
||
<li> | ||
<span>Storage and Memory</span> | ||
<dl> | ||
<dt>RAM</dt> | ||
<dd>[[= get('storage').ram ]]</dd> | ||
<dt>Internal Storage</dt> | ||
<dd>[[= get('storage').flash ]]</dd> | ||
</dl> | ||
</li> | ||
|
||
<li> | ||
<span>Connectivity</span> | ||
<dl> | ||
<dt>Network Support</dt> | ||
<dd>[[= get('connectivity').cell ]]</dd> | ||
<dt>WiFi</dt> | ||
<dd>[[= get('connectivity').wifi ]]</dd> | ||
<dt>Bluetooth</dt> | ||
<dd>[[= get('connectivity').bluetooth ]]</dd> | ||
<dt>Infrared</dt> | ||
<dd>[[= get('connectivity').infrared ]]</dd> | ||
<dt>GPS</dt> | ||
<dd>[[= get('connectivity').gps ]]</dd> | ||
</dl> | ||
</li> | ||
|
||
<li> | ||
<span>Android</span> | ||
<dl> | ||
<dt>OS Version</dt> | ||
<dd>[[= get('android').os ]]</dd> | ||
<dt>UI</dt> | ||
<dd>[[= get('android').ui ]]</dd> | ||
</dl> | ||
</li> | ||
|
||
<li> | ||
<span>Size and Weight</span> | ||
<dl> | ||
<dt>Dimensions</dt> | ||
[[ _.each(get('sizeAndWeight').dimensions, function(dimension) { ]] | ||
<dd>[[= dimension ]]</dd> | ||
[[ }) ]] | ||
<dt>Weight</dt> | ||
<dd>[[= get('sizeAndWeight').weight ]]</dd> | ||
</dl> | ||
</li> | ||
|
||
<li> | ||
<span>Display</span> | ||
<dl> | ||
<dt>Screen size</dt> | ||
<dd>[[= get('display').screenSize ]]</dd> | ||
<dt>Screen resolution</dt> | ||
<dd>[[= get('display').screenResolution ]]</dd> | ||
<dt>Touch screen</dt> | ||
<dd>[[= get('display').touchScreen ]]</dd> | ||
</dl> | ||
</li> | ||
|
||
<li> | ||
<span>Hardware</span> | ||
<dl> | ||
<dt>CPU</dt> | ||
<dd>[[= get('hardware').cpu ]]</dd> | ||
<dt>USB</dt> | ||
<dd>[[= get('hardware').usb ]]</dd> | ||
<dt>Audio / headphone jack</dt> | ||
<dd>[[= get('hardware').audioJack ]]</dd> | ||
<dt>FM Radio</dt> | ||
<dd>[[= get('hardware').fmRadio ]]</dd> | ||
<dt>Accelerometer</dt> | ||
<dd>[[= get('hardware').accelerometer ]]</dd> | ||
</dl> | ||
</li> | ||
|
||
<li> | ||
<span>Camera</span> | ||
<dl> | ||
<dt>Primary</dt> | ||
<dd>[[= get('camera').primary ]]</dd> | ||
<dt>Features</dt> | ||
<dd>[[= get('camera').features.join(', ') ]]</dd> | ||
</dl> | ||
</li> | ||
|
||
<li> | ||
<span>Additional Features</span> | ||
<dd>[[= get('additionalFeatures') ]]</dd> | ||
</li> | ||
|
||
<li></li> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
PhonesShowImageView = Backbone.View.extend({ | ||
|
||
initialize: function () { | ||
this.render(); | ||
}, | ||
|
||
render: function () { | ||
this.$el.html(JST['phones/show_image'](this.model.get('mainImage'))); | ||
} | ||
}); |
10 changes: 10 additions & 0 deletions
10
public/javascripts/views/phones/show_images_list_image_view.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
PhonesShowImagesListImageView = Backbone.View.extend({ | ||
|
||
initialize: function () { | ||
this.render(); | ||
}, | ||
|
||
render: function () { | ||
this.$el.html(JST['phones/show_images_list_image'](this.model)); | ||
} | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
PhonesShowImagesListView = Backbone.View.extend({ | ||
|
||
initialize: function () { | ||
this.render(); | ||
}, | ||
|
||
render: function () { | ||
this.$el.html(''); | ||
this.model.photosCollection.each(this.renderImage, this); | ||
}, | ||
|
||
renderImage: function (photo) { | ||
this.$el.append(new PhonesShowImagesListImageView({ | ||
tagName: 'li', | ||
model: photo | ||
}).el); | ||
} | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
PhonesShowSpecsView = Backbone.View.extend({ | ||
|
||
initialize: function () { | ||
this.render(); | ||
}, | ||
|
||
render: function () { | ||
this.$el.html(JST['phones/show_specs'](this.model)); | ||
} | ||
}); |
This file contains 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
This file contains 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
This file contains 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