Skip to content
This repository has been archived by the owner on Aug 15, 2018. It is now read-only.

Commit

Permalink
updated admin interface quite a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Adams committed Nov 20, 2008
1 parent 97d9951 commit 84d584d
Show file tree
Hide file tree
Showing 25 changed files with 230 additions and 205 deletions.
2 changes: 1 addition & 1 deletion app/helpers/page_admin_helper.rb
Expand Up @@ -88,7 +88,7 @@ def tree_ul(acts_as_tree_set, init=true, &block)

def tree_table(acts_as_tree_set, init=true, level=0, &block)
if acts_as_tree_set.size > 0
ret = '<table class=\'tree\'>'
ret = '<table class=\'tree subdued\'>'
ret << ' <thead>'
ret << ' <tr>'
ret << ' <th>Title</th>'
Expand Down
22 changes: 11 additions & 11 deletions app/views/admin/pages/_form.html.erb
@@ -1,21 +1,21 @@
<%= error_messages_for 'page' %>
<!--[form:page]-->
<div id="cms_form" style="display:block;">
<%= form_heading "Name (URL)", text_field('page', 'name', 'onKeyUp' => "document.getElementById('name_preview').innerHTML = this.value.replace(/ /g, '_')") %>
<span class='path'><b><%= @page.ancestor_path %><span id=name_preview><%= @page.name %></span></b></span><br/>
<%= form_heading "Name (URL)", text_field('page', 'name', 'onKeyUp' => "document.getElementById('name_preview').innerHTML = this.value.replace(/ /g, '_')") + "<span class='path'><b>#{@page.ancestor_path}<span id=name_preview>#{@page.name}</span></b></span><br/>" %>
<%= form_heading "Title", text_field('page', 'title') %>
<%= form_heading "Full Title", text_field('page', 'full_title') %>
<% if current_user.can_publish? %>
<%= form_heading 'Published', '<select id="page_published" name="page[published]">' + options_for_select([true, false], @page.published) + '</select>' %>
<% end %>
<div class=advanced_options>
<% toggle_content_box "Advanced Options" do %>
<table class='form-table'>
<%= form_row '<label for="page_display_title" class="advanced_options">Displayed on page</label>', '<select id="page_display_title" name="page[display_title]">' + options_for_select([true, false], @page.display_title) + '</select>' %>
<%= form_row '<label for="page_show_sub_menu" class="advanced_options">Display Sub-menu</label> ', '<select id="page_show_sub_menu" name="page[show_sub_menu]">' + options_for_select([true, false], @page.show_sub_menu) + '</select>' %>
<%= form_row '<label for="page_linked" class="advanced_options">Linked</label>', '<select id="page_linked" name="page[linked]">' + options_for_select([true, false], @page.linked) + '</select>' %>
</table>
<br />
<% end %>
<div class="advanced_options">
<% toggle_content_box "Advanced Options" do %>
<table class='form-table'>
<%= form_row '<label for="page_display_title" class="advanced_options">Displayed on page</label>', '<select id="page_display_title" name="page[display_title]">' + options_for_select([true, false], @page.display_title) + '</select>' %>
<%= form_row '<label for="page_show_sub_menu" class="advanced_options">Display Sub-menu</label> ', '<select id="page_show_sub_menu" name="page[show_sub_menu]">' + options_for_select([true, false], @page.show_sub_menu) + '</select>' %>
<%= form_row '<label for="page_linked" class="advanced_options">Linked</label>', '<select id="page_linked" name="page[linked]">' + options_for_select([true, false], @page.linked) + '</select>' %>
</table>
<br />
<% end %>
</div>
</div><!-- end float left-->
<!--[eoform:page]-->
5 changes: 4 additions & 1 deletion app/views/admin/pages/index.html.erb
@@ -1,9 +1,12 @@
<%= title "Manage Pages" -%>
<% content_for :sidebar do -%>
<%= link_to "Create Page", new_admin_page_path, :class => 'button icon add' %>
<div class='note'>
Pages are a central component of ansuz, as they provide the structure onto which the page plugin system latches, as well as providing nice hierarchical urls for your content.
</div>
<% end -%>
<div id='tree2'>

<div id='tree2' class='fullwidth'>
<%= tree_table(@page_hierarchy) {|item| link_to h(item.name), edit_admin_page_path(item) } %>
</div>
9 changes: 7 additions & 2 deletions app/views/admin/pages/new.html.erb
@@ -1,4 +1,9 @@
<h1 style="text-align:center;">Create a New Page</h1>
<%= title "Create a new page" %>
<% content_for :sidebar do %>
<%= link_to "Manage Pages", admin_pages_path, :class => "button icon back" %>
<% end %>
<% form_tag admin_pages_path, :html => { 'name' => 'page_form' } do %>
<%= hidden_field 'page', 'parent_id' %>
<%= hidden_field 'page', 'page_order' %>
Expand All @@ -8,5 +13,5 @@
<%= hidden_field_tag "page_plugins[]", page_plugin -%>
<% end -%>
<% end -%>
<%= submit_tag 'Create', :class => 'submit' %>
<%= submit_tag 'Create Page' %>
<% end -%>
36 changes: 19 additions & 17 deletions app/views/admin/roles/index.html.erb
Expand Up @@ -6,21 +6,23 @@
</div>
<% end %>

<table class='subdued'>
<thead>
<tr>
<th>Role</th>
<th></th>
</tr>
</thead>
<tbody>
<% @roles.each do |role| -%>
<tr class='<%= cycle('odd', 'even') -%>'>
<td><%= link_to role.name, admin_role_path(role) -%></td>
<td>
<%= link_to "Delete", admin_role_path(role), :method => :delete, :confirm => "Are you sure you want to delete this role?" -%>
</td>
<div class='fullwidth'>
<table class='subdued'>
<thead>
<tr>
<th>Role</th>
<th></th>
</tr>
<% end -%>
</tbody>
</table>
</thead>
<tbody>
<% @roles.each do |role| -%>
<tr class='<%= cycle('odd', 'even') -%>'>
<td><%= link_to role.name, admin_role_path(role) -%></td>
<td>
<%= link_to famfamfam_icon("delete"), admin_role_path(role), :method => :delete, :confirm => "Are you sure you want to delete this role?" -%>
</td>
</tr>
<% end -%>
</tbody>
</table>
</div>
2 changes: 1 addition & 1 deletion app/views/admin/site_settings/show.html.erb
Expand Up @@ -5,5 +5,5 @@
<% end -%>
<table class='form-table'>
<%= form_row "Site Title", @settings.site_title -%>
<%= form_row "User Theme", "<img src='#{fetch_theme_preview_admin_site_settings_path(:id => @settings.get_theme_setting)}' alt='#{@settings.get_theme_setting}' />" + "<br />" + @settings.get_theme_setting + " " + link_to("(change)", choose_theme_admin_site_settings_path) -%>
<%= form_row "User Theme", "<img src='#{fetch_theme_preview_ansuz_themes_path(:id => @settings.get_theme_setting)}' alt='#{@settings.get_theme_setting}' />" + "<br />" + @settings.get_theme_setting + " " + link_to("(change)", choose_theme_admin_site_settings_path) -%>
</table>
7 changes: 4 additions & 3 deletions config/initializers/setup_admin_menu_entries.rb
@@ -1,9 +1,10 @@
Ansuz::PluginManagerInstance.register_admin_menu_entry "Themes", 'Choose a Theme', '/admin/site_settings/choose_theme', :span_options => { :note => "Easily change the look and feel of your site." }
Ansuz::PluginManagerInstance.register_admin_menu_entry "Create", 'Page', '/admin/pages/new', :span_options => { :note => "Create a new page." }

Ansuz::PluginManagerInstance.register_admin_menu_entry "Content", 'Manage Pages', '/admin/pages', :span_options => { :note => "This is where your site's primary content lives." }
Ansuz::PluginManagerInstance.register_admin_menu_entry "Manage", 'Pages', '/admin/pages', :span_options => { :note => "This is where your site's primary content lives." }
Ansuz::PluginManagerInstance.register_admin_menu_entry "Manage", 'Roles', '/admin/roles'

Ansuz::PluginManagerInstance.register_admin_menu_entry "Ansuz", 'Manage Roles', '/admin/roles'
Ansuz::PluginManagerInstance.register_admin_menu_entry "Ansuz", 'Site Settings', '/admin/site_settings', :span_options => { :note => "Change your site title, etc." }
Ansuz::PluginManagerInstance.register_admin_menu_entry "Ansuz", 'Choose a Theme', '/admin/site_settings/choose_theme', :span_options => { :note => "Easily change the look and feel of your site." }
Ansuz::PluginManagerInstance.register_admin_menu_entry "Ansuz", 'List Plugins', '/admin/plugins'
Ansuz::PluginManagerInstance.register_admin_menu_entry "Ansuz", 'Logout', '/admin/account/logout'

Expand Down
2 changes: 1 addition & 1 deletion lib/ansuz/plugin_manager.rb
@@ -1,7 +1,7 @@
module Ansuz
class PluginManager
attr_accessor :plugins, :plugin_nav, :admin_plugin_nav, :admin_menu, :admin_menu_top_level_entries, :page_types
ADMIN_MENU_TOP_LEVEL_ENTRIES = ["Content", "Add-ons", "Themes", "Ansuz"]
ADMIN_MENU_TOP_LEVEL_ENTRIES = ["Create", "Manage", "Ansuz"]

def initialize
@plugins = []
Expand Down
38 changes: 21 additions & 17 deletions public/stylesheets/admin.css
Expand Up @@ -35,7 +35,6 @@ h3{
#header {
width:100%;
text-align: left;
background-color: #0084ff;
color: white;
padding: 10px;
height: 40px;
Expand Down Expand Up @@ -132,11 +131,10 @@ h3{
}

#bd h1{
font-size: 160%;
background-color: #ddd;
padding: 4px 10px;
font-size: 200%;
padding: 0;
margin-bottom: 10px;
color: #444;
color: black;
}

#bd h2{
Expand Down Expand Up @@ -168,7 +166,7 @@ ul.grid li.item img:hover {
border: 10px solid #bbb;
}
ul.grid li.item.active img {
border-color: #0084FF;
border-color: #777;
}
#tree li li:hover {
background-color: #eee;
Expand All @@ -189,7 +187,7 @@ ul.grid li.item.active img {
}

#admin-menu li:hover span{
background: #006bcf;
background: #333;
}

#admin-menu li span, #admin-menu li a{
Expand Down Expand Up @@ -228,19 +226,14 @@ ul.grid li.item.active img {

#admin-menu li span.note{
margin: 0;
background-color: #555;
font-size: 75%;
font-style: oblique;
background: transparent;
}

#admin-menu li li:hover span.note,
#admin-menu li li:hover a{
background-color: #333;
}
#admin-menu li li span span.note,
#admin-menu li li:hover span span.note{
background-color: #006bcf;
}

.note{
margin: 10px 0;
Expand All @@ -258,14 +251,14 @@ ul.grid li.item.active img {

a.button{
padding: 10px;
background-color: #ccc;
color: black;
color: #444;
text-decoration: none;
width: 200px;
display: block;
font-weight: bold;
}
a.button:hover {
background-color: #bbb !important;
color: black;
}
a.button.icon{
padding-left: 30px;
Expand Down Expand Up @@ -393,6 +386,10 @@ input, textarea{
border-width: 1px;
border-color: #bbb;
}
input:focus, textarea:focus {
border-color: #888;
}

.blog-post-form input.title{
width: 98%;
}
Expand Down Expand Up @@ -426,6 +423,13 @@ color: white;
text-decoration: none;
padding: 8px 12px;
}
#supplemental-nav ul li a:hover{
#supplemental-nav ul li a:hover {
background-color: #333;
}
#bd .fullwidth{
margin: 0 -5px 0 -5px !important;
}
ul.admin_actions li{
float: left;
padding: 2px 6px;
}
11 changes: 7 additions & 4 deletions public/stylesheets/form-tables.css
Expand Up @@ -158,14 +158,17 @@ table.form-table td .updated {
.form-table input, .form-table textarea {
border-color: #999 !important;
}
.form-table input:focus, .form-table textarea:focus {
border-color: #666 !important;
}

.form-table td, .form-table th {
border-bottom-color: #fff !important;
}

.form-heading h3{
background-color: #eee;
font-size: 14px;
padding: 7px;
margin: 0 0 10px;
font-size: 12px;
font-weight: bold;
color: #777;
font-family: "Bitstream Vera Sans", Arial, sans-serif;
}
23 changes: 8 additions & 15 deletions public/stylesheets/tables.css
Expand Up @@ -91,7 +91,13 @@ tbody th {

tbody td {
background: #fff;
color: #333;
font-weight: normal;
}
tbody td a{
color: #333;
text-decoration: none;
}

tbody tr.odd td {
background: #eee;
Expand All @@ -100,46 +106,33 @@ tbody tr.odd td {
tbody tr th a:link {
font: bold 0.9em tahoma, arial, sans-serif;
color: #5E7796;
text-decoration: underline;

}

tbody tr th a:visited {
color: #5E7796;
text-decoration: none;

}

tbody tr th a:hover {
color: #5E7796;
text-decoration: none;

text-decoration: underline;
}

tbody tr th a:active {
color: #5E7796;
text-decoration: line-through;
}

tbody td a:link {
color: #0084ff;
text-decoration: underline;
}

tbody td a:visited {
color: #0084ff;
text-decoration: none;
}

tbody td a:hover {
color: #0084ff;
text-decoration: none;
text-decoration: underline;
}

tbody td a:active {
font: normal 0.9em tahoma, arial, sans-serif;
color: #0084ff;
text-decoration: underline;
}
tbody tr.selected td,
tbody tr.selected:hover td{
Expand Down
1 change: 0 additions & 1 deletion public/stylesheets/tree2.css
Expand Up @@ -47,7 +47,6 @@ table.tree td{
padding: 0 4px;
}
table.tree td.item a{
font-weight: bold;
}
table.tree td.page-controls .page_controls{
display: none;
Expand Down
47 changes: 25 additions & 22 deletions vendor/plugins/ansuz_blog/app/views/admin/blog_posts/index.html.erb
Expand Up @@ -7,26 +7,29 @@
<h2>Tag Cloud</h2>
<%= tag_cloud :url => :admin_tag_path -%>
<% end -%>
<table class='subdued'>
<thead>
<tr>
<th>Title</th>
<th>Created At</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<% @blog_posts.each do |blog_post| -%>
<tr class='<%= cycle('odd', 'even') -%>'>
<td><%= link_to h(blog_post.title), admin_blog_post_path(blog_post) -%></td>
<td><%= blog_post.created_at.to_s(:db) -%></td>
<td>
<ul class='admin_actions'>
<li><%= link_to "Edit", edit_admin_blog_post_path(blog_post) -%></li>
<li><%= link_to "Delete", admin_blog_post_path(blog_post), :method => :delete, :confirm => "Are you sure you want to delete this blog post?" -%></li>
</ul>
</td>
<div class='fullwidth'>
<table class='subdued'>
<thead>
<tr>
<th>Title</th>
<th>Created At</th>
<th></th>
</tr>
<% end -%>
</tbody>
</table>
</thead>
<tbody>
<% @blog_posts.each do |blog_post| -%>
<tr class='<%= cycle('odd', 'even') -%>'>
<td><%= link_to h(blog_post.title), admin_blog_post_path(blog_post) -%></td>
<td><%= blog_post.created_at.to_s(:db) -%></td>
<td>
<ul class='admin_actions'>
<li><%= link_to famfamfam_icon("pencil"), edit_admin_blog_post_path(blog_post) -%></li>
<li><%= link_to famfamfam_icon("delete"), admin_blog_post_path(blog_post), :method => :delete, :confirm => "Are you sure you want to delete this blog post?" -%></li>
</ul>
<div class='clear'></div>
</td>
</tr>
<% end -%>
</tbody>
</table>
</div>

0 comments on commit 84d584d

Please sign in to comment.