Created
August 19, 2008 19:54
-
-
Save ma11hew28/6231 to your computer and use it in GitHub Desktop.
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
// ========================================================================== | |
// Admin.AppController | |
// ========================================================================== | |
require('core'); | |
/** @class | |
(Document Your View Here) | |
@extends SC.Object | |
@author AuthorName | |
@version 0.1 | |
@static | |
*/ | |
Admin.appController = SC.Object.create( | |
/** @scope Admin.appController */ { | |
isAboutVisible: false, | |
areFeatureTopicsVisible: true, | |
areFeatureGroupsVisible: true, | |
areFeatureNetworksVisible: true, | |
showAbout: function() { | |
SC.page.get('about').set('isVisible', YES); | |
}, | |
hideAbout: function() { | |
SC.page.get('about').set('isVisible', NO); | |
}, | |
showFeatureTopics: function() { | |
this.set('areFeatureTopicsVisible', YES); | |
this.hideFeatureGroups(); | |
this.hideFeatureNetworks(); | |
}, | |
hideFeatureTopics: function() { | |
this.set('areFeatureTopicsVisible', NO); | |
}, | |
showFeatureGroups: function() { | |
this.set('areFeatureGroupsVisible', YES); | |
this.hideFeatureTopics(); | |
this.hideFeatureNetworks(); | |
}, | |
hideFeatureGroups: function() { | |
this.set('areFeatureGroupsVisible', NO); | |
}, | |
showFeatureNetworks: function() { | |
this.set('areFeatureNetworksVisible', YES); | |
this.hideFeatureTopics(); | |
this.hideFeatureGroups(); | |
}, | |
hideFeatureNetworks: function() { | |
this.set('areFeatureNetworksVisible', NO); | |
}, | |
}) ; |
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
<% content_for('body') do %> | |
<% view :header, :class => 'sc-header sc-square-theme' do %> | |
<div onClick = 'Admin.appController.showAbout();'> | |
<img src="<%= static_url('images/admin-logo.png') %>" /><h1>Administration</h1> | |
</div> | |
<%= label_view :tag => :span, | |
:bind => {:value => 'Admin.accountController.username'} %> | |
<% end %> <!-- header --> | |
<% split_view :workspace, :direction => :horizontal do %> | |
<% view :nav do %> | |
<% scroll_view :nav_list, :outlet => true do %> | |
<h2>Features</h2> | |
<ul> | |
<li onClick = 'Admin.appController.showFeatureTopics();'>Topics</li> | |
<li onClick = 'Admin.appController.showFeatureGroups();'>Groups</li> | |
<li onClick = 'Admin.appController.showFeatureNetworks();'>Networks</li> | |
</ul> | |
<% end %> | |
<% end %> <!-- nav --> | |
<%= split_divider_view :width => 5 %> | |
<% view :main do %> | |
<%= view :FeatureTopics, :view => 'Admin.TableView', | |
:tag => :table, | |
:attributes => { :summary => 'All Featured Topics.' }, | |
:bind => { | |
:visible => 'Admin.app.areFeatureTopicsVisible', | |
:title => 'Admin.featureTopicsController.title', | |
:content => 'Admin.featureTopicsController.arrangedObjects' | |
} %> | |
<%= view :FeatureGroups, :view => 'Admin.TableView', | |
:tag => :table, | |
:attributes => { :summary => 'All Featured Groups.' }, | |
:bind => { | |
:visible => 'Admin.app.areFeatureGroupsVisible', | |
:title => 'Admin.featureGroupsController.title', | |
:content => 'Admin.featureGroupsController.arrangedObjects' | |
} %> | |
<%= view :FeatureNetworks, :view => 'Admin.TableView', | |
:tag => :table, | |
:attributes => { :summary => 'All Featured Networks.' }, | |
:bind => { | |
:visible => 'Admin.app.areFeatureNetworksVisible', | |
:title => 'Admin.featureNetworksController.title', | |
:content => 'Admin.featureNetworksController.arrangedObjects' | |
} %> | |
<% end %> <!-- main --> | |
<% end %> <!-- split_view --> | |
<% view :footer, :class => 'sc-footer sc-square-theme' do %> | |
<div class="right"> | |
<%= button_view :account_button, :title => "Account", | |
:enabled => true, | |
:action => 'Admin.accountController.showAccountDialog' | |
%> | |
<%= button_view :logout_button, :title => "Logout", | |
:action => 'Admin.accountController.logout' | |
%> | |
</div> | |
<% end %> <!-- footer --> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment