Skip to content

Commit

Permalink
much more
Browse files Browse the repository at this point in the history
  • Loading branch information
kristianmandrup committed Jun 25, 2012
1 parent bdf2d20 commit 06845a8
Show file tree
Hide file tree
Showing 150 changed files with 1,994 additions and 9,984 deletions.
5 changes: 4 additions & 1 deletion www/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Ext.application({
name: "FriendlyRent",

requires: [
'Ext.MessageBox', 'FriendlyRent.view.Navigation'
'FriendlyRent.view.Navigation'
],

// models: ["Note"],
Expand Down Expand Up @@ -42,6 +42,9 @@ Ext.application({
console.log('mainLaunch');
// if (!device || !this.launched) { return; }

I18n.defaultLocale = "da";
I18n.locale = "da";

console.log('Launched!');

// Destroy the #appLoadingIndicator element
Expand Down
3 changes: 3 additions & 0 deletions www/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
# Make sure our assets reload on every request.
set :static_cache_control, [:public, :max_age => 0]

# set :bind, 'localhost'
set :port, 4567

# Pick which set of files get served depending
# on our environment
case ENV["RACK_ENV"] || "development"
Expand Down
11 changes: 6 additions & 5 deletions www/app/model/Account.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ Ext.define('FriendlyRent.model.Account', {
extend: 'Ext.data.Model',

config: {
identifier: 'account',

idProperty: 'id',
fields: [
{name: 'id', type: 'int'},
{name: 'dateCreated', type: 'date', dateFormat: 'c' },
{name: 'favorites', type: 'favorites'},
{name: 'mail_system', type: 'mail_system'}
{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' }
Expand Down
9 changes: 5 additions & 4 deletions www/app/model/ContactInfo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Ext.define('FriendlyRent.model.ContactInfo', {
Ext.define('model.ContactInfo', {
extend: 'Ext.data.Model',

config: {
Expand All @@ -8,9 +8,10 @@ Ext.define('FriendlyRent.model.ContactInfo', {
fields: [
{name: 'id', type: 'int'},
{name: 'dateCreated', type: 'date', dateFormat: 'c' },
{name: 'contact_hours', type: 'auto'},
{name: 'phone', type: 'auto'},
{name: 'alt_phone', type: 'auto'}

{name: 'contact_hours', type: 'string'},
{name: 'phone', type: 'string'},
{name: 'alt_phone', type: 'string'}
],
validations: [
{ type: 'presence', field: 'id' },
Expand Down
12 changes: 6 additions & 6 deletions www/app/model/Mail.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
Ext.define('FriendlyRent.model.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: 'auto'},
{name: 'body', type: 'auto'},
{name: 'type', type: 'auto'}, // # payment, services, contacts, legal

{name: 'sender', type: 'account'},
{name: 'receivers', type: 'array'}
{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' },
Expand Down
9 changes: 6 additions & 3 deletions www/app/model/Photo.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
Ext.define('FriendlyRent.model.Photo', {
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: 'auto'},
{name: 'description', type: 'auto'}

{name: 'name', type: 'string'},
{name: 'description', type: 'string'},
// base 64 encoded image
{name: 'image', type: 'string'}
],
validations: [
{ type: 'presence', field: 'id' },
Expand Down
2 changes: 1 addition & 1 deletion www/app/model/Property.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Ext.define('FriendlyRent.model.Property', {
Ext.define('model.Property', {
extend: 'Ext.data.Model',

config: {
Expand Down
22 changes: 22 additions & 0 deletions www/app/model/Settings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Ext.define('model.Settings', {
extend: 'Ext.data.Model',

config: {
idProperty: 'id',
fields: [
{name: 'id', type: 'int'},
{name: 'dateCreated', type: 'date', dateFormat: 'c' },

{name: 'languageCode', type: 'string'},
{name: 'currencyCodeISO', type: 'string'},
],
hasOne: [
{name: 'account', model: 'FriendlyRent.model.settings.Account'}
],
validations: [
{ type: 'presence', field: 'id' },
{ type: 'presence', field: 'dateCreated' },
{ type: 'presence', field: 'subject', message: 'Please enter a subject for this mail' }
]
},
});
12 changes: 8 additions & 4 deletions www/app/model/User.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Ext.define('FriendlyRent.model.User', {
Ext.define('model.User', {
extend: 'Ext.data.Model',

config: {
Expand All @@ -11,11 +11,15 @@ Ext.define('FriendlyRent.model.User', {
{name: 'email', type: 'email'},
{name: 'password', type: 'auto'},

{name: 'landlord_account', type: 'landlord_account'},
{name: 'tenant_account', type: 'tenant_account'}

// {name: 'address', type: 'address'},
],
hasOne: [
{name: 'landlord_account', model: 'account.Landlord'}
]
,
{name: 'tenant_account', type: 'account.Tenant'}


validations: [
{ type: 'presence', field: 'id' },
{ type: 'presence', field: 'dateCreated' }
Expand Down
5 changes: 2 additions & 3 deletions www/app/model/account/Landlord.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
Ext.define('FriendlyRent.model.account.Landlord', {
Ext.define('account.Landlord', {
extend: 'Ext.data.Model',

config: {
identifier: 'landlord_account',

idProperty: 'id',
fields: [
{name: 'id', type: 'int'},
{name: 'dateCreated', type: 'date', dateFormat: 'c' },
{name: 'contact_info', type: 'contact_info'}
],
belongsTo: 'User',
validations: [
{ type: 'presence', field: 'id' },
{ type: 'presence', field: 'dateCreated' }
Expand Down
3 changes: 2 additions & 1 deletion www/app/model/account/Tenant.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Ext.define('FriendlyRent.model.account.Tenant', {
Ext.define('account.Tenant', {
extend: 'Ext.data.Model',

config: {
Expand All @@ -10,6 +10,7 @@ Ext.define('FriendlyRent.model.account.Tenant', {
{name: 'dateCreated', type: 'date', dateFormat: 'c' },
{name: 'contact_requests_made', type: 'int'}
],
belongsTo: 'User',
validations: [
{ type: 'presence', field: 'id' },
{ type: 'presence', field: 'dateCreated' }
Expand Down
15 changes: 8 additions & 7 deletions www/app/model/mail/Box.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
Ext.define('FriendlyRent.model.mail.Box', {
Ext.define('mail.Box', {
extend: 'Ext.data.Model',

config: {
identifier: 'mailbox',

idProperty: 'id',
fields: [
{name: 'id', type: 'int'}

{name: 'messages', type: 'array'},
{name: 'bookmarks', type: 'array'}
{name: 'id', type: 'int'}
],
hasMany: [
{name: 'messages', model: 'Mail'},
{name: 'bookmarks', model: 'Mail'}
]

belongsTo: 'mail.System',
validations: [
{ type: 'presence', field: 'id' }
]
Expand Down
22 changes: 11 additions & 11 deletions www/app/model/mail/System.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
Ext.define('FriendlyRent.model.mail.System', {
Ext.define('mail.System', {
extend: 'Ext.data.Model',

config: {
identifier: 'mail_system',

idProperty: 'id',
fields: [
{name: 'id', type: 'int'},
{name: 'dateCreated', type: 'date', dateFormat: 'c' }

{name: 'inbox', type: 'mail_box'},
{name: 'sentbox', type: 'mail_box'},
{name: 'trashbox', type: 'mail_box'}

{name: 'replied', type: 'array'},
{name: 'received_reply', type: 'array'}

],
hasOne: [
{name: 'inbox', model: 'mail.Box'},
{name: 'sentbox', model: 'mail.Box'},
{name: 'trashbox', model: 'mail.box'}
],
hasMany: [
{name: 'replied', model: 'Mail'},
{name: 'received_reply', model: 'Mail'}
],

validations: [
{ type: 'presence', field: 'id' },
{ type: 'presence', field: 'dateCreated' }
Expand Down
4 changes: 1 addition & 3 deletions www/app/model/payment/CreditCard.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
Ext.define('FriendlyRent.model.payment.CreditCard', {
Ext.define('payment.CreditCard', {
extend: 'Ext.data.Model',

config: {
identifier: 'credit_card',

idProperty: 'id',
fields: [
{name: 'id', type: 'int'},
Expand Down
4 changes: 1 addition & 3 deletions www/app/model/photo/Gallery.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
Ext.define('FriendlyRent.model.photo.Gallery', {
Ext.define('photo.Gallery', {
extend: 'Ext.data.Model',

config: {
identifier: 'photo_gallery',

idProperty: 'id',
fields: [
{name: 'id', type: 'int'},
Expand Down
4 changes: 1 addition & 3 deletions www/app/model/property/Details.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
Ext.define('FriendlyRent.model.property.Details', {
Ext.define('property.Details', {
extend: 'Ext.data.Model',

config: {
identifier: 'property_details',

idProperty: 'id',
fields: [
{name: 'id', type: 'int'},
Expand Down
5 changes: 2 additions & 3 deletions www/app/model/property/Location.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
Ext.define('FriendlyRent.model.property.Location', {
Ext.define('property.Location', {
extend: 'Ext.data.Model',

config: {
identifier: 'location',

idProperty: 'id',
fields: [
{name: 'id', type: 'int'},
Expand All @@ -14,6 +12,7 @@ Ext.define('FriendlyRent.model.property.Location', {
validations: [
{ type: 'presence', field: 'id' },
{ type: 'presence', field: 'dateCreated' },

{ type: 'presence', field: 'lat' },
{ type: 'presence', field: 'long' }
]
Expand Down
10 changes: 4 additions & 6 deletions www/app/model/property/RentalPeriod.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
Ext.define('FriendlyRent.model.property.RentalPeriod', {
Ext.define('property.RentalPeriod', {
extend: 'Ext.data.Model',

config: {
identifier: 'rental_period',

idProperty: 'id',
fields: [
{name: 'id', type: 'int'},
{name: 'dateCreated', type: 'date', dateFormat: 'c' },

{name: 'rental_costs', type: 'rental_costs'}


{name: 'duration', type: 'int'}, // seconds
{name: 'start_date', type: 'date', dateFormat: 'c' },
{name: 'end_date' type: 'date', dateFormat: 'c' },
{name: 'asap', type: 'bool'},

{name: 'publish_at', type: 'date', dateFormat: 'c' }
],
hasOne: {name: 'rental_costs', model: 'property.rental_period.costs'}

validations: [
{ type: 'presence', field: 'id' },
{ type: 'presence', field: 'dateCreated' },
Expand Down
Loading

0 comments on commit 06845a8

Please sign in to comment.