simple_admin 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/controllers/simple_admin/admin_controller.rb +5 -2
- data/app/helpers/simple_admin/header_helper.rb +1 -1
- data/app/helpers/simple_admin/title_helper.rb +3 -1
- data/app/views/simple_admin/admin/dashboard.html.erb +3 -0
- data/app/views/simple_admin/admin/edit.html.erb +6 -8
- data/app/views/simple_admin/admin/index.html.erb +0 -2
- data/app/views/simple_admin/admin/new.html.erb +6 -8
- data/app/views/simple_admin/admin/show.html.erb +19 -21
- data/config/routes.rb +1 -1
- data/lib/simple_admin/version.rb +1 -1
- metadata +5 -4
@@ -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
|
@@ -1,9 +1,7 @@
|
|
1
|
-
|
2
|
-
<%
|
3
|
-
|
4
|
-
<% end %>
|
1
|
+
<% content_for :content do %>
|
2
|
+
<% render :partial => 'form' %>
|
3
|
+
<% end %>
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
</div>
|
5
|
+
<% content_for :sidebar do %>
|
6
|
+
<%= sidebars %>
|
7
|
+
<% end %>
|
@@ -1,9 +1,7 @@
|
|
1
|
-
|
2
|
-
<%
|
3
|
-
|
4
|
-
<% end %>
|
1
|
+
<% content_for :content do %>
|
2
|
+
<% render :partial => 'form' %>
|
3
|
+
<% end %>
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
</div>
|
5
|
+
<% content_for :sidebar do %>
|
6
|
+
<%= sidebars %>
|
7
|
+
<% end %>
|
@@ -1,24 +1,22 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
<
|
4
|
-
|
5
|
-
<div class="
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
<
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
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
|
-
|
17
|
+
</div>
|
18
|
+
<% end %>
|
20
19
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
</div>
|
20
|
+
<% content_for :sidebar do %>
|
21
|
+
<%= sidebars %>
|
22
|
+
<% end %>
|
data/config/routes.rb
CHANGED
data/lib/simple_admin/version.rb
CHANGED
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:
|
4
|
+
hash: 9
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
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-
|
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
|