simple_admin 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,8 +4,8 @@ require 'meta_search'
4
4
  module SimpleAdmin
5
5
  class AdminController < ::ApplicationController
6
6
  before_filter :require_user
7
- before_filter :lookup_interface
8
- before_filter :lookup_before
7
+ before_filter :lookup_interface, :except => [:dashboard]
8
+ before_filter :lookup_before, :except => [:dashboard]
9
9
  before_filter :lookup_resource, :only => [:show, :edit, :update, :destroy]
10
10
 
11
11
  unloadable
@@ -83,6 +83,9 @@ module SimpleAdmin
83
83
  end
84
84
  end
85
85
 
86
+ def dashboard
87
+ end
88
+
86
89
  protected
87
90
 
88
91
  def require_user
@@ -47,7 +47,7 @@ module SimpleAdmin
47
47
  end
48
48
  end
49
49
  # If we are not showing an item or creating a new one, then check for new action items
50
- unless [:new, :show].include?(params[:action].to_sym)
50
+ unless [:new, :show, :dashboard].include?(params[:action].to_sym)
51
51
  if controller.action_methods.include?('new')
52
52
  content << link_to("New #{@interface.member.titlecase}",
53
53
  send("new_simple_admin_#{@interface.member}_path"))
@@ -1,7 +1,7 @@
1
1
  module SimpleAdmin
2
2
  module TitleHelper
3
3
  def title
4
- "#{page_title} | #{site_title}"
4
+ page_title ? "#{page_title} | #{site_title}" : site_title
5
5
  end
6
6
 
7
7
  def site_title
@@ -9,6 +9,8 @@ module SimpleAdmin
9
9
  end
10
10
 
11
11
  def page_title
12
+ return nil unless @interface
13
+
12
14
  options = @interface.options_for(params[:action].to_sym)
13
15
  case options[:title]
14
16
  when Proc
@@ -0,0 +1,3 @@
1
+ <% content_for :content do %>
2
+ <%= tabs %>
3
+ <% end %>
@@ -1,9 +1,7 @@
1
- <div class="simple_admin_edit">
2
- <% content_for :content do %>
3
- <% render :partial => 'form' %>
4
- <% end %>
1
+ <% content_for :content do %>
2
+ <% render :partial => 'form' %>
3
+ <% end %>
5
4
 
6
- <% content_for :sidebar do %>
7
- <%= sidebars %>
8
- <% end %>
9
- </div>
5
+ <% content_for :sidebar do %>
6
+ <%= sidebars %>
7
+ <% end %>
@@ -1,4 +1,3 @@
1
- <div class="simple_admin_index">
2
1
  <% content_for :content do %>
3
2
  <div class="paginated_collection">
4
3
  <div class="pagination_information">
@@ -81,4 +80,3 @@
81
80
 
82
81
  <%= sidebars %>
83
82
  <% end %>
84
- </div>
@@ -1,9 +1,7 @@
1
- <div class="simple_admin_new">
2
- <% content_for :content do %>
3
- <% render :partial => 'form' %>
4
- <% end %>
1
+ <% content_for :content do %>
2
+ <% render :partial => 'form' %>
3
+ <% end %>
5
4
 
6
- <% content_for :sidebar do %>
7
- <%= sidebars %>
8
- <% end %>
9
- </div>
5
+ <% content_for :sidebar do %>
6
+ <%= sidebars %>
7
+ <% end %>
@@ -1,24 +1,22 @@
1
- <div class="simple_admin_show">
2
- <% content_for :content do %>
3
- <div class="panel">
4
- <h3><%= @interface.member.titleize %> Details</h3>
5
- <div class="panel_contents">
6
- <div class="<%= @interface.member %> attributes_table"
7
- id="<%= ['attributes_table', @interface.member, @resource.to_param].join("_") %>">
8
- <table border="0" cellspacing="0" cellpadding="0">
9
- <% @interface.attributes_for(:show).each do |attr| %>
10
- <tr>
11
- <th><%= attr.title %></th>
12
- <td><%= data_for(attr) %></td>
13
- </tr>
14
- <% end %>
15
- </table>
16
- </div>
1
+ <% content_for :content do %>
2
+ <div class="panel">
3
+ <h3><%= @interface.member.titleize %> Details</h3>
4
+ <div class="panel_contents">
5
+ <div class="<%= @interface.member %> attributes_table"
6
+ id="<%= ['attributes_table', @interface.member, @resource.to_param].join("_") %>">
7
+ <table border="0" cellspacing="0" cellpadding="0">
8
+ <% @interface.attributes_for(:show).each do |attr| %>
9
+ <tr>
10
+ <th><%= attr.title %></th>
11
+ <td><%= data_for(attr) %></td>
12
+ </tr>
13
+ <% end %>
14
+ </table>
17
15
  </div>
18
16
  </div>
19
- <% end %>
17
+ </div>
18
+ <% end %>
20
19
 
21
- <% content_for :sidebar do %>
22
- <%= sidebars %>
23
- <% end %>
24
- </div>
20
+ <% content_for :sidebar do %>
21
+ <%= sidebars %>
22
+ <% end %>
@@ -1,5 +1,5 @@
1
1
  SimpleAdmin::Engine.routes.draw do
2
- root :to => "admin#index", :interface => SimpleAdmin::registered.first.try(:collection)
2
+ root :to => "admin#dashboard"
3
3
  SimpleAdmin::registered.each do |interface|
4
4
  resources interface.collection,
5
5
  :controller => :admin,
@@ -1,3 +1,3 @@
1
1
  module SimpleAdmin
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_admin
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 0
10
- version: 0.5.0
9
+ - 1
10
+ version: 0.5.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jeff Rafter
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-13 00:00:00 -07:00
18
+ date: 2011-08-15 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -208,6 +208,7 @@ files:
208
208
  - app/helpers/simple_admin/title_helper.rb
209
209
  - app/views/layouts/simple_admin.html.erb
210
210
  - app/views/simple_admin/admin/_form.html.erb
211
+ - app/views/simple_admin/admin/dashboard.html.erb
211
212
  - app/views/simple_admin/admin/edit.html.erb
212
213
  - app/views/simple_admin/admin/index.csv.erb
213
214
  - app/views/simple_admin/admin/index.html.erb