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
| class Profile < ActiveRecord::Base | |
| has_many :profiles_users, :class_name => "ProfilesUsers" | |
| has_many :users, :through => :profiles_users | |
| has_many :admins, | |
| :through => :profiles_users, | |
| :source => :user, | |
| :conditions => ["profiles_users.role = ?", "admin"] | |
| has_many :editors, | |
| :through => :profiles_users, | |
| :source => :user, |
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
| /* | |
| Password text fields | |
| */ | |
| NB.PasswordField = SC.TextField.extend({ | |
| template: SC.Handlebars.compile('<input type="password">') | |
| }); | |
| /* | |
| Text fields with variable type |
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
| NB.PasswordField = SC.TextField.extend({ | |
| template: SC.Handlebars.compile('<input type="password">') | |
| }); | |
| NB.TextField = SC.TextField.extend({ | |
| type: 'text', | |
| template: SC.Handlebars.compile('<input {{bindAttr type="type"}}>') | |
| }); | |
| NB.SelectField = SC.TemplateCollectionView.extend({ |
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
| itemView: SC.TemplateView.extend({ | |
| templateName: 'navigation', | |
| submenu: SC.TemplateCollectionView.extend({ | |
| contentBinding: '.parentView.content.menuItems', | |
| itemView: SC.TemplateView.extend({ | |
| hash: '#!/', | |
| buttonPressed: function() { |
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
| // the view: | |
| NB.NavigationMenuView = SC.TemplateCollectionView.extend({ | |
| layerId: 'navigation', | |
| classNames: ['navigation', 'modules-list'], | |
| contentBinding: 'NB.modulesController.content', | |
| itemView: SC.TemplateView.extend({ | |
| templateName: 'navigation', |
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
| NB.NavigationMenuView = SC.TemplateCollectionView.extend({ | |
| layerId: 'navigation', | |
| classNames: ['navigation', 'modules-list'], | |
| contentBinding: 'NB.modulesController.content', | |
| itemView: SC.TemplateView.extend({ | |
| templateName: 'navigation', | |
| submenu: SC.TemplateCollectionView.extend({ | |
| classNames: ['test'], |
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
| Selectfield.mainPage = SC.Page.design({ | |
| mainPane: SC.MainPane.design({ | |
| childViews: 'wrapper'.w(), | |
| wrapper: SC.View.design({ | |
| childViews: 'content'.w(), | |
| content: SC.PanelPane.design({ | |
| layout: { width: 360, height: 160, centerX: 0, centerY: 0 }, |
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
| rememberMeField: SC.View.design({ | |
| layout: { left: 17, right: 14, top: 76, height: 24 }, | |
| childViews: 'label sfield'.w(), | |
| label: SC.LabelView.design({ | |
| layout: { left: 0, width: 107, height: 18, centerY: 0 }, | |
| value: '_RememberMe'.loc(), | |
| textAlign: SC.ALIGN_RIGHT | |
| }), | |