Permalink
Browse files

converted proj to coffee

  • Loading branch information...
1 parent bf81fb3 commit a8b20fce4740b191fc53ec11b669f1d860a0ec51 @kristianmandrup committed Jul 2, 2012
Showing with 1,506 additions and 608 deletions.
  1. +35 −18 www/app/model/Account.js
  2. +39 −22 www/app/model/Address.js
  3. +34 −20 www/app/model/ContactInfo.js
  4. +45 −23 www/app/model/Mail.js
  5. +33 −18 www/app/model/Photo.js
  6. +40 −23 www/app/model/Property.js
  7. +38 −20 www/app/model/Settings.js
  8. +46 −27 www/app/model/User.js
  9. +28 −16 www/app/model/account/Landlord.js
  10. +33 −18 www/app/model/account/Tenant.js
  11. +23 −0 www/app/model/mail/Account.js
  12. +51 −0 www/app/model/mail/Message.js
  13. +42 −17 www/app/model/payment/CreditCard.js
  14. +28 −15 www/app/model/photo/Gallery.js
  15. +80 −0 www/app/model/property/Costs.js
  16. +53 −25 www/app/model/property/Details.js
  17. +33 −19 www/app/model/property/Location.js
  18. +49 −23 www/app/model/property/RentalPeriod.js
  19. +58 −34 www/app/model/search/Criteria.js
  20. +31 −17 www/app/model/search/Favorite.js
  21. +35 −21 www/app/model/settings/Account.js
  22. +17 −24 www/app/store/Landlords.js
  23. +27 −23 www/app/store/Mails.js
  24. +27 −23 www/app/store/Photos.js
  25. +27 −23 www/app/store/Properties.js
  26. +27 −23 www/app/store/Tenants.js
  27. +27 −23 www/app/store/Users.js
  28. +0 −18 www/lib/app/view/Home.js
  29. +1 −4 www/src/app/controller/Language.coffee
  30. +17 −0 www/src/app/model/Account.coffee
  31. +19 −0 www/src/app/model/Address.coffee
  32. +16 −0 www/src/app/model/ContactInfo.coffee
  33. +20 −0 www/src/app/model/Mail.coffee
  34. +16 −0 www/src/app/model/Photo.coffee
  35. +18 −0 www/src/app/model/Property.coffee
  36. +20 −0 www/src/app/model/Settings.coffee
  37. +20 −0 www/src/app/model/User.coffee
  38. +13 −0 www/src/app/model/account/Landlord.coffee
  39. +15 −0 www/src/app/model/account/Tenant.coffee
  40. +11 −0 www/src/app/model/mail/Account.coffee
  41. +21 −0 www/src/app/model/mail/Message.coffee
  42. +19 −0 www/src/app/model/payment/CreditCard.coffee
  43. +13 −0 www/src/app/model/photo/Gallery.coffee
  44. +47 −0 www/src/app/model/property/Costs.coffee
  45. +23 −0 www/src/app/model/property/Details.coffee
  46. +17 −0 www/src/app/model/property/Location.coffee
  47. +20 −0 www/src/app/model/property/RentalPeriod.coffee
  48. +30 −0 www/src/app/model/search/Criteria.coffee
  49. +15 −0 www/src/app/model/search/Favorite.coffee
  50. +16 −0 www/src/app/model/settings/Account.coffee
  51. +1 −1 www/src/app/store/{Landlords.js → Landlords.coffee}
  52. +18 −0 www/src/app/store/Mails.coffee
  53. +0 −18 www/src/app/store/Mails.js
  54. +18 −0 www/src/app/store/Photos.coffee
  55. +0 −13 www/src/app/store/Photos.js
  56. +18 −0 www/src/app/store/Properties.coffee
  57. +0 −13 www/src/app/store/Properties.js
  58. +18 −0 www/src/app/store/Tenants.coffee
  59. +0 −13 www/src/app/store/Tenants.js
  60. +18 −0 www/src/app/store/Users.coffee
  61. +0 −13 www/src/app/store/Users.js
  62. +2 −0 www/src/app/view/languages/ComboBox.coffee
View
@@ -1,20 +1,37 @@
-Ext.define('FriendlyRent.model.Account', {
- extend: 'Ext.data.Model',
-
- config: {
- idProperty: 'id',
- fields: [
- {name: 'id', type: 'int'},
- {name: 'dateCreated', type: 'date', dateFormat: 'c' }
- ],
- hasMany: [
- {name: 'favorites', model: 'search.Favorite'}
- ],
- hasOne: {name: 'mailSystem', model: 'mail.System'},
- validations: [
- { type: 'presence', field: 'id' },
- { type: 'presence', field: 'dateCreated' }
- ]
+Ext.define('FriendlyRent.model.Account', {
+ extend: 'Ext.data.Model',
+ config: {
+ idProperty: 'id',
+ fields: [
+ {
+ name: 'id',
+ type: 'int'
+ }, {
+ name: 'dateCreated',
+ type: 'date',
+ dateFormat: 'c'
+ }
+ ],
+ belongsTo: 'User',
+ hasOne: {
+ name: 'mail_account',
+ model: 'mail.Account'
},
-});
+ hasMany: [
+ {
+ name: 'favorites',
+ model: 'search.Favorite'
+ }
+ ],
+ validations: [
+ {
+ type: 'presence',
+ field: 'id'
+ }, {
+ type: 'presence',
+ field: 'dateCreated'
+ }
+ ]
+ }
+});
View
@@ -1,24 +1,41 @@
-Ext.define('FriendlyRent.model.Address', {
- extend: 'Ext.data.Model',
-
- config: {
- identifier: 'account',
-
- idProperty: 'id',
- fields: [
- {name: 'id', type: 'int'},
- {name: 'floor_adr', type: 'auto'},
- {name: 'number', type: 'auto'},
- {name: 'street', type: 'auto'},
- {name: 'city', type: 'auto'},
- {name: 'regiop', type: 'auto'},
- {name: 'zip', type: 'auto'},
- {name: 'country', type: 'auto'}
-
- ],
- validations: [
- { type: 'presence', field: 'id' }
- ]
- },
+Ext.define('FriendlyRent.model.Address', {
+ extend: 'Ext.data.Model',
+ config: {
+ identifier: 'account',
+ idProperty: 'id',
+ fields: [
+ {
+ name: 'id',
+ type: 'int'
+ }, {
+ name: 'floor_adr',
+ type: 'string'
+ }, {
+ name: 'number',
+ type: 'string'
+ }, {
+ name: 'street',
+ type: 'string'
+ }, {
+ name: 'city',
+ type: 'string'
+ }, {
+ name: 'region',
+ type: 'string'
+ }, {
+ name: 'zip',
+ type: 'int'
+ }, {
+ name: 'country',
+ type: 'string'
+ }
+ ],
+ validations: [
+ {
+ type: 'presence',
+ field: 'id'
+ }
+ ]
+ }
});
@@ -1,21 +1,35 @@
-Ext.define('model.ContactInfo', {
- extend: 'Ext.data.Model',
-
- config: {
- identifier: 'contact_info',
-
- idProperty: 'id',
- fields: [
- {name: 'id', type: 'int'},
- {name: 'dateCreated', type: 'date', dateFormat: 'c' },
- {name: 'contact_hours', type: 'string'},
- {name: 'phone', type: 'string'},
- {name: 'alt_phone', type: 'string'}
- ],
- validations: [
- { type: 'presence', field: 'id' },
- { type: 'presence', field: 'dateCreated' }
- ]
- },
-});
+Ext.define('model.ContactInfo', {
+ extend: 'Ext.data.Model',
+ config: {
+ idProperty: 'id',
+ fields: [
+ {
+ name: 'id',
+ type: 'int'
+ }, {
+ name: 'dateCreated',
+ type: 'date',
+ dateFormat: 'c'
+ }, {
+ name: 'contact_hours',
+ type: 'string'
+ }, {
+ name: 'phone',
+ type: 'string'
+ }, {
+ name: 'alt_phone',
+ type: 'string'
+ }
+ ],
+ validations: [
+ {
+ type: 'presence',
+ field: 'id'
+ }, {
+ type: 'presence',
+ field: 'dateCreated'
+ }
+ ]
+ }
+});
View
@@ -1,25 +1,47 @@
-Ext.define('model.Mail', {
- extend: 'Ext.data.Model',
-
- config: {
- idProperty: 'id',
- fields: [
- {name: 'id', type: 'int'},
- {name: 'dateCreated', type: 'date', dateFormat: 'c' },
-
- {name: 'subject', type: 'string'},
- {name: 'body', type: 'string'},
- {name: 'type', type: 'string'}, // # payment, services, contacts, legal
- // IMPORTANT: can't have a status like bookmarked or replied, as a message
- // will appear in multiple accounts and for each account have a uniques status
- ],
- hasOne: {name: 'sender', type: 'account'},
- hasMany: {name: 'receivers', type: 'array'},
- validations: [
- { type: 'presence', field: 'id' },
- { type: 'presence', field: 'dateCreated' },
- { type: 'presence', field: 'subject', message: 'Please enter a subject for this mail' }
- ]
+Ext.define('model.Mail', {
+ extend: 'Ext.data.Model',
+ config: {
+ idProperty: 'id',
+ fields: [
+ {
+ name: 'id',
+ type: 'int'
+ }, {
+ name: 'dateCreated',
+ type: 'date',
+ dateFormat: 'c'
+ }, {
+ name: 'subject',
+ type: 'string'
+ }, {
+ name: 'body',
+ type: 'string'
+ }, {
+ name: 'type',
+ type: 'string'
+ }
+ ],
+ hasOne: {
+ name: 'sender',
+ type: 'account'
+ },
+ hasMany: {
+ name: 'receivers',
+ model: 'User'
},
-});
+ validations: [
+ {
+ type: 'presence',
+ field: 'id'
+ }, {
+ type: 'presence',
+ field: 'dateCreated'
+ }, {
+ type: 'presence',
+ field: 'subject',
+ message: 'Please enter a subject for this mail'
+ }
+ ]
+ }
+});
View
@@ -1,20 +1,35 @@
-Ext.define('model.Photo', {
- extend: 'Ext.data.Model',
-
- config: {
- idProperty: 'id',
- fields: [
- {name: 'id', type: 'int'},
- {name: 'dateCreated', type: 'date', dateFormat: 'c' },
- {name: 'name', type: 'string'},
- {name: 'description', type: 'string'},
- // base 64 encoded image
- {name: 'image', type: 'string'}
- ],
- validations: [
- { type: 'presence', field: 'id' },
- { type: 'presence', field: 'dateCreated' }
- ]
- }
+Ext.define('model.Photo', {
+ extend: 'Ext.data.Model',
+ config: {
+ idProperty: 'id',
+ fields: [
+ {
+ name: 'id',
+ type: 'int'
+ }, {
+ name: 'dateCreated',
+ type: 'date',
+ dateFormat: 'c'
+ }, {
+ name: 'name',
+ type: 'string'
+ }, {
+ name: 'description',
+ type: 'string'
+ }, {
+ name: 'image',
+ type: 'string'
+ }
+ ],
+ validations: [
+ {
+ type: 'presence',
+ field: 'id'
+ }, {
+ type: 'presence',
+ field: 'dateCreated'
+ }
+ ]
+ }
});
View
@@ -1,24 +1,41 @@
-Ext.define('model.Property', {
- extend: 'Ext.data.Model',
-
- config: {
- identifier: 'property',
-
- idProperty: 'id',
- fields: [
- {name: 'id', type: 'int'},
- {name: 'dateCreated', type: 'date', dateFormat: 'c' },
- {name: 'rental_period', type: 'rental_period'},
- {name: 'photo_gallery', type: 'photo_gallery'},
- {name: 'location', type: 'location'},
-
- {name: 'publish_on', type: 'date'},
- {name: 'published_on', type: 'date'}
- ],
- validations: [
- { type: 'presence', field: 'id' },
- { type: 'presence', field: 'dateCreated' }
- ]
- }
-});
+Ext.define('model.Property', {
+ extend: 'Ext.data.Model',
+ config: {
+ idProperty: 'id',
+ fields: [
+ {
+ name: 'id',
+ type: 'int'
+ }, {
+ name: 'dateCreated',
+ type: 'date',
+ dateFormat: 'c'
+ }, {
+ name: 'rental_period',
+ type: 'rental_period'
+ }, {
+ name: 'photo_gallery',
+ type: 'photo_gallery'
+ }, {
+ name: 'location',
+ type: 'location'
+ }, {
+ name: 'publish_on',
+ type: 'date'
+ }, {
+ name: 'published_on',
+ type: 'date'
+ }
+ ],
+ validations: [
+ {
+ type: 'presence',
+ field: 'id'
+ }, {
+ type: 'presence',
+ field: 'dateCreated'
+ }
+ ]
+ }
+});
Oops, something went wrong.

0 comments on commit a8b20fc

Please sign in to comment.