easy_admin_ui 0.2.0 → 0.2.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/README +7 -4
- data/VERSION +1 -1
- data/easy_admin_ui.gemspec +2 -2
- data/lib/easy_admin_ui/view_helpers.rb +4 -4
- data/templates/easy_admin_ui/index.html.erb +1 -1
- metadata +4 -4
data/README
CHANGED
@@ -10,7 +10,7 @@ Requirements
|
|
10
10
|
* formtastic
|
11
11
|
* will_paginate
|
12
12
|
|
13
|
-
Tested with Rails
|
13
|
+
Tested with Rails 3.0.1.
|
14
14
|
|
15
15
|
To Do
|
16
16
|
=====
|
@@ -38,7 +38,7 @@ class Admin::UsersController < ActionController::Base
|
|
38
38
|
easy_admin :per_page => 50,
|
39
39
|
:order => 'created_at',
|
40
40
|
:page_title => 'Users',
|
41
|
-
:columns => ['Login', 'Email', 'Created'],
|
41
|
+
:columns => ['Login', ['Email', 'my_nowrap_class'], 'Name', 'Created'],
|
42
42
|
:show_actions => true,
|
43
43
|
:skip_new => true
|
44
44
|
end
|
@@ -52,8 +52,8 @@ Then you need a partial below users/ named '_user.html.erb':
|
|
52
52
|
<%=
|
53
53
|
table_row(:id => "tr_user_#{user.id}", :class => "#{cyc = cycle("even", "odd")}",
|
54
54
|
:cells => [
|
55
|
-
|
56
|
-
|
55
|
+
user.login,
|
56
|
+
[user.email, 'my_nowrap_class'],
|
57
57
|
date_hm(user.created_at),
|
58
58
|
],
|
59
59
|
:actions => [
|
@@ -62,6 +62,9 @@ Then you need a partial below users/ named '_user.html.erb':
|
|
62
62
|
])
|
63
63
|
-%>
|
64
64
|
|
65
|
+
To add a class to your table cells just pass an array as done with the user.email
|
66
|
+
field in the above example.
|
67
|
+
|
65
68
|
Copy icons:
|
66
69
|
|
67
70
|
$ rake easy_admin_ui:copy_assets
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/easy_admin_ui.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{easy_admin_ui}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Martin Moen Wulffeld"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-11-03}
|
13
13
|
s.description = %q{Very simple DRY admin UI.}
|
14
14
|
s.email = %q{martin@wulffeld.org}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -4,22 +4,22 @@ module EasyAdminUi
|
|
4
4
|
will_paginate(collection, :previous_label => t('will_paginate.previous'), :next_label => t('will_paginate.next'))
|
5
5
|
end
|
6
6
|
|
7
|
-
def table(items,
|
7
|
+
def table(items, columns, actions, options = {}, &block)
|
8
8
|
html = ''.html_safe
|
9
|
-
html << table_head(
|
9
|
+
html << table_head(columns, actions, options)
|
10
10
|
html << render(items)
|
11
11
|
html << my_table_end
|
12
12
|
html
|
13
13
|
end
|
14
14
|
|
15
|
-
def table_head(
|
15
|
+
def table_head(columns, actions, options = {})
|
16
16
|
options[:class] ||= 'easy'
|
17
17
|
html = ''.html_safe
|
18
18
|
html << "<table class='#{options[:class]}' id='#{options[:id]}'>".html_safe
|
19
19
|
html <<
|
20
20
|
content_tag(:thead,
|
21
21
|
content_tag(:tr, (
|
22
|
-
|
22
|
+
columns.map do |title, th_class|
|
23
23
|
th_class ||= []
|
24
24
|
content_tag(:th,
|
25
25
|
[
|
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
<%= wpaginate @items if @items.respond_to?(:total_pages) %>
|
10
10
|
|
11
|
-
<%= table(@items, @options[:columns], @options[:
|
11
|
+
<%= table(@items, @options[:columns], @options[:show_actions]) %>
|
12
12
|
|
13
13
|
<%= wpaginate @items if @items.respond_to?(:total_pages) %>
|
14
14
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy_admin_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Martin Moen Wulffeld
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-11-03 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|