Created
July 1, 2011 15:40
-
-
Save jfrolich/1058803 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
Soapbox = SC.Application.create(); | |
Soapbox.Page = SC.Object.extend({ | |
title: null, | |
subMenu: false, | |
edit: false | |
}); | |
Soapbox.pagesController = SC.ArrayProxy.create({ | |
content: [], | |
createPage: function(title) { | |
var page = Soapbox.Page.create({ title: title }); | |
this.pushObject(page); | |
} | |
}); | |
Soapbox.createPageView = SC.TextField.extend({ | |
insertNewline: function(){ | |
var value = this.get('value'); | |
if(value) { | |
Soapbox.pagesController.createPage(value); | |
this.set('value', ''); | |
} | |
} | |
}) | |
Soapbox.MenuItemsView = SC.CollectionView.extend({ | |
contentBinding: "Soapbox.pagesController", | |
tagName: "ul", | |
itemViewClass: SC.View.extend({ | |
tagName: "li", | |
templateName: 'say-hello', | |
className: "page menu_item", | |
doubleClick: function(evt) { | |
console.log(this.content); | |
this.content.set("edit", true); | |
} | |
}) | |
}) | |
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
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title> | |
Zenpage | |
</title> | |
<%= stylesheet_link_tag "backend" %> | |
<%= javascript_include_tag "backend" %> | |
<%= javascript_include_tag "http://use.typekit.com/dfr0iew.js" %> | |
<%= stylesheet_link_tag "iconic" %> | |
<link href='/stylesheets/textile-editor.css?1295053649' media='screen' rel='stylesheet' type='text/css' /> | |
<%= javascript_include_tag "textile-editor" %> | |
<%= csrf_meta_tag %> | |
<%= yield(:head) %> | |
<script type="text/x-handlebars" data-template-name="menu-item"> | |
<div class="menu_item_content"> | |
{{content.title}} | |
</div> | |
<div class="buttons"> | |
<a class="edit iconic pencil iconbutton"></a> | |
<a class="delete x-alt iconic iconbutton"></a> | |
</div> | |
</script> | |
</head> | |
<body> | |
<div id='wrapper'> | |
<div id='sidebar'> | |
<h2>Paginas:</h2> | |
<%= render :partial => "admin/menu_items/menu_items", :locals => {:menu_items => @menu} %> | |
<%= render :partial => 'admin/menu_items/new' %> | |
<div style='clear:both; float:left'> | |
<script type="text/html"> | |
{{view Soapbox.createPageView id="page_name" placeholder="Page title"}} | |
</script> | |
<script type="text/html"> | |
{{collection Soapbox.MenuItemsView id="menuItems"}} | |
</script> | |
<br /> | |
<br /> | |
<%= link_to "Exposities", admin_expositions_path, :class => "small_normal_button" %> | |
<br /> | |
<br /> | |
<%= link_to "Site settings", "/admin/site_settings", :class => "small_normal_button" %> | |
<br /> | |
<br /> | |
<br /> | |
<br /> | |
<%= link_to "Log uit", admin_logout_path, :class => "small_red_button" %> | |
<br /> | |
<br /> | |
<br /> | |
zenpage | |
<%= Zenpage::Application.config.app_version %> | |
</div> | |
</div> | |
<div id='content'> | |
<div id='flash-notice'> | |
<div id='notice'> | |
<%= flash[:notice] %> | |
</div> | |
<div id='close-notice'> | |
<a href='#'>x</a> | |
</div> | |
</div> | |
<%= yield %> | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment