Permalink
Browse files

rating plugin works

  • Loading branch information...
1 parent 845e696 commit 82fe022c6d2713337bb14a4e8fd3345a40271a30 @kristianmandrup committed Jul 9, 2012
Showing with 915 additions and 164 deletions.
  1. +2 −1 .gitignore
  2. +7 −0 www/Gemfile
  3. +11 −0 www/Gemfile.lock
  4. +2 −2 www/app.js
  5. +12 −18 www/app.json
  6. +4 −0 www/app.rb
  7. +0 −24 www/app/app/view/Home.js
  8. +6 −0 www/app/controller/Home.js
  9. +41 −14 www/app/store/Favorites.js
  10. +2 −1 www/app/view/home/Page.js
  11. +11 −11 www/app/view/properties/list/Content.js
  12. +11 −15 www/app/view/search/favorites/Content.js
  13. +42 −0 www/lib/Mixin.js
  14. +90 −0 www/lib/jquery/rateit/_rateit.css
  15. BIN www/lib/jquery/rateit/delete.gif
  16. +252 −0 www/lib/jquery/rateit/jquery.rateit.js
  17. +9 −0 www/lib/jquery/rateit/jquery.rateit.min.js
  18. +90 −0 www/lib/jquery/rateit/rateit.css
  19. BIN www/lib/jquery/rateit/star.gif
  20. +1 −0 www/lib/plugins/NavBar.js
  21. +1 −0 www/lib/plugins/TopBar.js
  22. +90 −0 www/lib/templates/Helpers.js
  23. +34 −0 www/pipeline.rb
  24. BIN www/resources/.sass-cache/2f86792dce7d2835f047eb3809642bb97536b0e6/app.scssc
  25. +1 −1 www/resources/css/app.css
  26. BIN www/resources/images/icons/rating/delete.gif
  27. BIN www/resources/images/icons/rating/star.gif
  28. +36 −8 www/resources/sass/app.scss
  29. +3 −8 www/src/app.coffee
  30. +7 −0 www/src/app/controller/Home.coffee
  31. +44 −29 www/src/app/store/Favorites.coffee
  32. +2 −1 www/src/app/view/home/Page.coffee
  33. +18 −14 www/src/app/view/properties/list/Content.coffee
  34. +8 −6 www/src/app/view/search/favorites/Content.coffee
  35. +14 −0 www/src/lib/Mixin.coffee
  36. +1 −0 www/src/lib/plugins/NavBar.coffee
  37. +1 −0 www/src/lib/plugins/TopBar.coffee
  38. +32 −0 www/src/lib/templates/Helpers.coffee
  39. +7 −5 www/templates/property.html
  40. +1 −1 www/views/index.erb
  41. 0 www/{ → views}/run_tests.html
  42. +22 −5 www/{ → views}/siesta.html
View
@@ -1 +1,2 @@
-www/resources/sass/.sass-cache
+www/resources/sass/.sass-cache
+www/resources/.sass-cache
View
@@ -3,6 +3,13 @@ source :rubygems
gem "sinatra"
gem "sinatra-reloader"
+gem 'sprockets' #, :git => 'git://github.com/sstephenson/sprockets.git'
+gem 'coffee-script'
+gem 'sass'
+gem 'haml'
+gem 'rack-test'
+gem 'sinatra'
+
group :development do
gem "compass"
gem "guard"
View
@@ -26,6 +26,8 @@ GEM
guard-compass (0.0.6)
compass (>= 0.10.5)
guard (>= 0.2.1)
+ haml (3.1.4)
+ hike (1.2.1)
listen (0.4.5)
rb-fchange (~> 0.0.5)
rb-fsevent (~> 0.9.1)
@@ -55,17 +57,26 @@ GEM
tilt (~> 1.3)
sinatra-reloader (1.0)
sinatra-contrib
+ sprockets (2.1.3)
+ hike (~> 1.2)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
thor (0.15.2)
tilt (1.3.3)
PLATFORMS
ruby
DEPENDENCIES
+ coffee-script
compass
growl
guard
guard-coffeescript
guard-compass
+ haml
+ rack-test
+ sass
sinatra
sinatra-reloader
+ sprockets
View
@@ -12,7 +12,7 @@ Ext.application({
models: [],
stores: ["Favorites", "Agents"],
controllers: ["FriendlyRent.controller.Home", "FriendlyRent.controller.Search"],
- views: ["FriendlyRent.view.home.Page", "FriendlyRent.view.search.Page"],
+ views: ["FriendlyRent.view.home.Page", "FriendlyRent.view.search.Page", "FriendlyRent.view.search.favorites.Page"],
icon: {
'57': 'resources/icons/Icon.png',
'72': 'resources/icons/Icon~ipad.png',
@@ -40,7 +40,7 @@ Ext.application({
launch: function() {
var home_page;
console.log('launch');
- home_page = Ext.create('FriendlyRent.view.home.Page');
+ home_page = Ext.create('FriendlyRent.view.search.favorites.Page');
return Ext.Viewport.add(home_page);
},
onUpdated: function() {
View
@@ -44,6 +44,15 @@
{
"path": "lib/jquery/jquery.rest.js"
},
+ {
+ "path": "lib/jquery/rateit/jquery.rateit.min.js"
+ },
+ {
+ "path": "lib/Mixin.js"
+ },
+ {
+ "path": "lib/templates/Helpers.js"
+ },
{
"path": "lib/i18n/i18n.js"
},
@@ -60,21 +69,6 @@
{
"path": "lib/plugins/SliderFieldText.js"
},
- {
- "path": "test/siesta_harness.js"
- },
- // {
- // "path": "lib/deftjs/deft.js" // or deft-debug.js
- // },
- // {
- // "path": "lib/jasmine/jasmine.js"
- // },
- // {
- // "path": "lib/jasmine/jasmine-html.js"
- // },
- // {
- // "path": "lib/jasmine/jasmine.console_reporter.js"
- // },
{
"path": "app.js",
"bundle": true, /* Indicates that all class dependencies are concatenated into this file when build */
@@ -96,9 +90,9 @@
* }
*/
"css": [
- // {
- // "path": "lib/jasmine/jasmine.css"
- // },
+ {
+ "path": "lib/jquery/rateit/rateit.css"
+ },
{
"path": "resources/css/app.css",
"update": "delta"
View
@@ -35,4 +35,8 @@ def templates
get "/" do
erb :index
+end
+
+get "/siesta" do
+ erb :siesta
end
View
@@ -1,24 +0,0 @@
-(function() {
-
- Ext.define('App.view.HelloWorld', {
- extend: 'Ext.Container',
- config: {
- fullscreen: true,
- html: 'Hello Worlda! #7'
- }
- });
-
- Ext.define('App.controller.HelloWorld', {
- extend: 'Ext.app.Controller',
- views: ['HelloWorld'],
- init: function() {
- return this.getView('HelloWorld').create();
- }
- });
-
- Ext.application({
- name: 'App',
- controllers: ['HelloWorld']
- });
-
-}).call(this);
@@ -24,6 +24,12 @@ Ext.define('FriendlyRent.controller.Home', {
}
}
},
+ loadStores: function() {
+ return console.log('load stores');
+ },
+ launch: function() {
+ return this.callParent(arguments);
+ },
onTapSearch: function() {
var favorites_page;
console.log('Go to Favorites');
View
@@ -7,30 +7,57 @@ Ext.define('FriendlyRent.store.Favorites', {
{
dateCreated: '5/7/2012',
title: 'Nice place',
- location: 'Copenhagen',
- type: 'apartment',
- furnished: 'fully',
- cost: '2500',
+ city: 'Frederiksberg',
+ region: 'Copenhagen',
+ countryCode: 'DK',
+ type: 'villa',
+ furnished: true,
+ cost: '12500',
image: 'prop1.jpg',
- rooms: 2
+ size: 120,
+ floor: 0,
+ rooms: 4,
+ bedrooms: 3,
+ period: {
+ start_date: '1/8/2012',
+ end_date: '1/9/2012'
+ }
}, {
dateCreated: '12/6/2012',
title: 'Cool house',
- location: 'Nørrebro',
- type: 'house',
- furnished: 'not',
- cost: '3200',
+ city: 'Nørrebro',
+ region: 'Copenhagen',
+ countryCode: 'DK',
+ type: 'apartment',
+ furnished: false,
+ cost: '7600',
image: 'prop2.jpg',
- rooms: 3
+ size: 84,
+ floor: 1,
+ rooms: 3,
+ bedrooms: 2,
+ period: {
+ start_date: '1/8/2012',
+ end_date: '1/10/2012'
+ }
}, {
dateCreated: '3/6/2012',
title: 'Nice crib',
- location: 'Vesterbro',
+ city: 'Vesterbro',
+ region: 'Copenhagen',
+ countryCode: 'DK',
type: 'house',
- furnished: 'fully',
- cost: '4000',
+ furnished: '1/2',
+ cost: '10200',
image: 'prop3.jpg',
- rooms: 4
+ size: 100,
+ floor: 2,
+ rooms: 4,
+ bedrooms: 2,
+ period: {
+ start_date: '1/8/2012',
+ end_date: '1/10/2012'
+ }
}
],
proxy: {
@@ -5,7 +5,8 @@ Ext.define('FriendlyRent.view.home.Page', {
requires: ['FriendlyRent.view.home.Logo', 'FriendlyRent.view.home.Navigation', 'FriendlyRent.view.home.Flags'],
config: {
layout: 'vbox',
- style: 'background-color: #c8a0f0',
+ itemId: 'home',
+ id: 'home_page',
items: [
{
html: '<img src="resources/images/login.png"/>',
@@ -1,16 +1,16 @@
Ext.define('FriendlyRent.view.properties.list.Content', {
- extend: 'Ext.Panel',
- alias: 'widget.properties.list.content',
+ extend: 'Ext.List',
+ alias: 'widget.properties_list_content',
+ requires: ['FriendlyRent.store.Properties'],
config: {
- items: [
- {
- xtype: 'properties_list_item'
- }, {
- xtype: 'properties_list_item'
- }, {
- xtype: 'properties_list_item'
- }
- ]
+ store: 'Properties',
+ itemId: 'properties_list',
+ loadingText: 'Loading properties...',
+ emptyText: '<div class="favorites-list empty-text">No properties found.</div>',
+ itemTpl: Ext.XTemplate.from("property", new PropertyHelper),
+ onItemDisclosure: function(record, btn, index) {
+ return console.log('Disclose Property', record, index);
+ }
}
});
@@ -8,23 +8,19 @@ Ext.define('FriendlyRent.view.search.favorites.Content', {
itemId: 'favorites_list',
loadingText: 'Loading favorites...',
emptyText: '<div class="favorites-list empty-text">No favorites found.</div>',
- itemTpl: Ext.XTemplate.from("property", {
- typeDesc: function(item) {
- return "" + item.rooms + " room " + item.type + ", " + item.furnished + " furnished";
- },
- costDesc: function(cost) {
- return "" + cost + " DKK";
- },
- periodDesc: function(period) {
- if (period) {
- return "" + period.start_date + " to " + period.end_date;
- } else {
- return "";
- }
- }
- }),
+ itemTpl: Ext.XTemplate.from("property", new PropertyHelper),
onItemDisclosure: function(record, btn, index) {
return console.log('Disclose Favorite', record, index);
}
+ },
+ initialize: function() {
+ console.log('initialize');
+ this.callParent();
+ return Ext.Function.defer(this.setFavorites, 200);
+ },
+ setFavorites: function() {
+ return $('.favorite-stars').rateit({
+ max: 3
+ });
}
});
View
@@ -0,0 +1,42 @@
+var Mixin,
+ __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+Mixin = (function() {
+
+ function Mixin() {}
+
+ Mixin.prototype.augment = function(t) {
+ var m, n;
+ for (n in this) {
+ m = this[n];
+ if (!(n === 'augment' || !(this[n].prototype != null))) {
+ t[n] = m;
+ }
+ }
+ return t.setup();
+ };
+
+ Mixin.prototype.eject = function(mixin) {
+ var m, n, o, p, _results;
+ _results = [];
+ for (n in this) {
+ m = this[n];
+ _results.push(__indexOf.call((function() {
+ var _ref, _results1;
+ _ref = mixin.prototype;
+ _results1 = [];
+ for (o in _ref) {
+ p = _ref[o];
+ _results1.push(p);
+ }
+ return _results1;
+ })(), m) >= 0 ? delete this[n] : void 0);
+ }
+ return _results;
+ };
+
+ Mixin.prototype.setup = function() {};
+
+ return Mixin;
+
+})();
Oops, something went wrong.

0 comments on commit 82fe022

Please sign in to comment.