Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

added some self-documentation throughout the admin interface

  • Loading branch information...
Josh Adams
Josh Adams committed Oct 26, 2008
1 parent f273b6f commit 44e3b0536432876a7e37006d9cc76ff887a056eb
@@ -1,6 +1,6 @@
module TabsHelper
def create_tab(tab_name, url)
link_to_unless_current(tab_name, url) do
def create_tab(tab_name, url, options={})
link_to_unless_current(tab_name, url, options) do
output = '<span>'
output << tab_name
output << '</span>'
@@ -2,8 +2,8 @@
<% Ansuz::PluginManager::ADMIN_MENU_TOP_LEVEL_ENTRIES.each do |top_level_menu_entry| -%>
<li><span><%= top_level_menu_entry -%></span>
<ul>
<% Ansuz::PluginManagerInstance.admin_menu[top_level_menu_entry].each do |text, url| -%>
<li><%= create_tab text, url -%></li>
<% Ansuz::PluginManagerInstance.admin_menu[top_level_menu_entry].each do |text, url, options| -%>
<li><%= create_tab text, url, options -%></li>
<% end -%>
</ul>
</li>
@@ -1,4 +1,9 @@
<%= title "Choose a Theme" -%>
<% content_for :sidebar do -%>
<div class='note'>
Just click on a theme to set it as the active theme for the site. The currently-selected theme is highlighted. If you want to install more themes, and the ansuz_theme_installer plugin is installed, you should be able to just <a href='/admin/ansuz_theme_installers'>click this link</a>. We need a way for plugins to insert text into other plugins (rather, a standard way). That way I could only add the link if it were installed, or add a link to install it if it weren't.
</div>
<% end -%>
<ul class='grid'>
<% @themes.each do |theme| -%>
<% klass = (theme == @settings.user_theme_name) ? 'active' : 'inactive' -%>
@@ -36,9 +36,6 @@
<%= render :partial => "/admin/tabs" %>
</div>
<div id='content'>
<div id='sidebar'>
<%= yield :sidebar -%>
</div>
<div id="doc2" class="yui-t7">
<div id="bd">
<div class="yui-g">
@@ -53,6 +50,9 @@
[ Currently Editing: <b><%= current_database %></b> ]
</div>
</div>
<div id='sidebar'>
<%= yield :sidebar -%>
</div>
</div>
</body>
</html>
@@ -30,9 +30,9 @@ def register_admin_plugin_nav title, link
register_admin_menu_entry "Add-ons", title, link
end

def register_admin_menu_entry top_level_menu_name, text, link
def register_admin_menu_entry top_level_menu_name, text, link, options={}
raise "There was an attempt to add a link to the admin menu with a non-existent top level menu entry as parent." unless ADMIN_MENU_TOP_LEVEL_ENTRIES.include?(top_level_menu_name)
self.admin_menu[top_level_menu_name] << [text, link]
self.admin_menu[top_level_menu_name] << [text, link, options]
end

private
@@ -35,14 +35,22 @@ body{
}

#sidebar{
float: right;
float: left;
width: 25%;
background-color: #ddd;
text-align: left;
}

#sidebar h2{
background-color: #bbb;
padding: 4px;
margin: 4px 0;
}

#doc2{
width: 100%;
width: 71%;
float: left;
margin-right: 10px;
}

/* Tabs */
@@ -85,7 +93,6 @@ body{
#bd {
background:white;
padding:5px;
width: 71%;
margin-left: 10px;
border-width: 0 2px 2px 0px;
border-style: solid;
@@ -1,6 +1,9 @@
<%= title "Blog Posts" -%>
<% content_for :sidebar do -%>
<%= link_to "New Blog Post", new_admin_blog_post_path -%>
<div class='note'>
The blog plugin is largely unfinished, although it technically kind of sort of works. There's lots of work to be done yet, but it's going to be done I assure you.
</div>
<h2>Tag Cloud</h2>
<%= tag_cloud :url => :admin_tag_path -%>
<% end -%>
@@ -1,2 +1,2 @@
# Include hook code here
Ansuz::PluginManagerInstance.register_admin_plugin_nav('Resource Browser', '/javascripts/fckeditor/editor/filemanager/browser/default/browser.html?Connector=/fckeditor/command')
Ansuz::PluginManagerInstance.register_admin_menu_entry("Add-ons", 'Resource Browser (this will open in a new window)', '/javascripts/fckeditor/editor/filemanager/browser/default/browser.html?Connector=/fckeditor/command', :target => "_blank")
@@ -1,6 +1,9 @@
<%= title "Menu Entries" -%>
<% content_for :sidebar do -%>
<%= link_to "New Menu Entry", new_admin_menu_entry_path -%>
<div class='note'>
OK, so this is odd. Basically, you can add freeform menu entries here. If you want to embed the 'pages' menu, you can give add a menu entry with the name 'pages' and the url 'special.' This is very kludgy and will be changed later.
</div>
<% end -%>
<table class='subdued'>
<thead>
@@ -1,3 +1,3 @@
# Include hook code here
require 'menu_entry'
Ansuz::PluginManagerInstance.register_admin_plugin_nav('Menu', '/admin/menu_entries')
Ansuz::PluginManagerInstance.register_admin_plugin_nav('Menu Editor', '/admin/menu_entries')
@@ -1,4 +1,9 @@
<%= title "Install Themes" -%>
<% content_for :sidebar do -%>
<div class='note'>
At the moment, the only repository available to you is the master theme repository at www.ansuzcms.com. This is hard coded in, and there's currently no interface for adding new theme repositories (but one's coming!). If you're adventurous and desperate, ansuz's main repository is the same code you've got, so you could easily change the hardcoded value to your own instance of ansuz and be off and running.
</div>
<% end -%>
<table class='subdued'>
<thead>
<tr>
@@ -2,6 +2,9 @@
<% content_for :sidebar do -%>
<%= link_to "New Ansuz Theme", new_admin_ansuz_theme_path -%><br />
<%= link_to "Themes Feed", ansuz_themes_path(:format => 'xml') -%>
<div class='note'>
An Ansuz Theme consists of a name and a public git repository url (a private repository would work if you set up the appropriate ssh keys, etc.). Right now, it's impossible to install a theme (see <a href="http://ansuz.lighthouseapp.com/projects/15780-ansuz/tickets/6-right-now-a-theme-cannot-be-updated">this ticket</a> if you feel like fixing it!)
</div>
<% end -%>
<table class='subdued'>
<thead>
@@ -1,6 +1,9 @@
<%= title "Users" -%>
<% content_for :sidebar do -%>
<%= link_to "Add User", new_admin_user_path -%>
<div class='note'>
Right now the only users that exist are able to log in to the admin section. Soon we'll need site-users, and the Access Control Layer will need to be built. I intend this to be role-based, and built around the authorization plugin because of its fine granularity. I would want to be able to allow a plugin to programatically manage access to a page, etc.
</div>
<% end -%>
<table class='subdued'>
<thead>

0 comments on commit 44e3b05

Please sign in to comment.
You can’t perform that action at this time.