puffer 0.0.20 → 0.0.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. data/Gemfile +3 -1
  2. data/Gemfile.lock +45 -41
  3. data/README.md +2 -5
  4. data/VERSION +1 -1
  5. data/app/assets/stylesheets/puffer/application.css +1 -0
  6. data/app/assets/stylesheets/puffer/puffer_tree.css +65 -0
  7. data/{lib → app/controllers}/puffer/base.rb +3 -1
  8. data/app/controllers/puffer/{dashboard.rb → dashboard_base.rb} +1 -1
  9. data/app/controllers/puffer/dashboard_controller.rb +4 -0
  10. data/app/controllers/puffer/{sessions.rb → sessions_base.rb} +2 -2
  11. data/{lib/generators/puffer/install/templates → app/controllers/puffer}/sessions_controller.rb +2 -1
  12. data/app/controllers/puffer/tree_base.rb +50 -0
  13. data/app/helpers/puffer_helper.rb +2 -6
  14. data/app/helpers/puffer_tree_helper.rb +15 -0
  15. data/app/views/layouts/puffer.html.erb +54 -71
  16. data/app/views/layouts/puffer_base.html.erb +28 -0
  17. data/app/views/layouts/puffer_dashboard.html.erb +15 -32
  18. data/app/views/layouts/puffer_sessions.html.erb +7 -24
  19. data/app/views/puffer/base/index.html.erb +0 -1
  20. data/app/views/puffer/{dashboard → dashboard_base}/index.html.erb +0 -0
  21. data/app/views/puffer/{sessions → sessions_base}/new.html.erb +0 -0
  22. data/app/views/puffer/tree_base/_record.html.erb +27 -0
  23. data/app/views/puffer/tree_base/toggle.js.erb +6 -0
  24. data/app/views/puffer/tree_base/tree.html.erb +9 -0
  25. data/config/puffer_routes.rb +8 -0
  26. data/lib/puffer/controller/dsl.rb +11 -4
  27. data/lib/puffer/engine.rb +4 -0
  28. data/lib/puffer/extensions/controller.rb +0 -1
  29. data/lib/puffer/extensions/form.rb +1 -6
  30. data/lib/puffer/extensions/mapper.rb +7 -0
  31. data/lib/puffer/field.rb +87 -0
  32. data/lib/puffer/{fields.rb → field_set.rb} +2 -2
  33. data/lib/puffer.rb +2 -0
  34. data/puffer.gemspec +29 -22
  35. data/spec/dummy/app/controllers/admin/categories_controller.rb +4 -1
  36. data/spec/dummy/app/controllers/admin/posts_controller.rb +0 -2
  37. data/spec/dummy/app/controllers/puffer/sessions_controller.rb +1 -1
  38. data/spec/dummy/app/models/category.rb +2 -0
  39. data/spec/dummy/config/application.rb +1 -0
  40. data/spec/dummy/config/routes.rb +0 -7
  41. data/spec/dummy/db/migrate/{20100930132559_create_admin_users.rb → 20100930132559_create_users.rb} +1 -1
  42. data/spec/dummy/db/migrate/{20100930132656_create_admin_posts.rb → 20100930132656_create_posts.rb} +1 -1
  43. data/spec/dummy/db/migrate/{20100930132726_create_admin_categories.rb → 20100930132726_create_categories.rb} +6 -1
  44. data/spec/dummy/db/schema.rb +87 -0
  45. data/spec/dummy/db/seeds.rb +27 -0
  46. data/spec/lib/fields_spec.rb +13 -13
  47. metadata +62 -47
  48. data/config/routes.rb +0 -0
  49. data/lib/generators/puffer/install/USAGE +0 -6
  50. data/lib/generators/puffer/install/install_generator.rb +0 -13
  51. data/lib/generators/puffer/install/templates/dashboard_controller.rb +0 -3
  52. data/lib/puffer/controller/mapping.rb +0 -37
  53. data/lib/puffer/fields/field.rb +0 -89
  54. data/spec/dummy/app/controllers/puffer/dashboard_controller.rb +0 -3
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem 'rails', '>= 3.1.0.rc4'
3
+ gem 'rails', '>= 3.1.0.rc5'
4
4
  gem 'kaminari'
5
5
  gem 'apotomo'
6
6
 
@@ -18,4 +18,6 @@ group :development, :test do
18
18
  gem 'forgery'
19
19
  gem 'fabrication'
20
20
  gem "jeweler"
21
+
22
+ gem 'nested_set'
21
23
  end
data/Gemfile.lock CHANGED
@@ -1,41 +1,40 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- actionmailer (3.1.0.rc4)
5
- actionpack (= 3.1.0.rc4)
4
+ actionmailer (3.1.0.rc5)
5
+ actionpack (= 3.1.0.rc5)
6
6
  mail (~> 2.3.0)
7
- actionpack (3.1.0.rc4)
8
- activemodel (= 3.1.0.rc4)
9
- activesupport (= 3.1.0.rc4)
7
+ actionpack (3.1.0.rc5)
8
+ activemodel (= 3.1.0.rc5)
9
+ activesupport (= 3.1.0.rc5)
10
10
  builder (~> 3.0.0)
11
11
  erubis (~> 2.7.0)
12
12
  i18n (~> 0.6)
13
- rack (~> 1.3.0)
14
- rack-cache (~> 1.0.1)
13
+ rack (~> 1.3.1)
14
+ rack-cache (~> 1.0.2)
15
15
  rack-mount (~> 0.8.1)
16
16
  rack-test (~> 0.6.0)
17
- sprockets (~> 2.0.0.beta.10)
18
- tzinfo (~> 0.3.27)
19
- activemodel (3.1.0.rc4)
20
- activesupport (= 3.1.0.rc4)
17
+ sprockets (~> 2.0.0.beta.12)
18
+ activemodel (3.1.0.rc5)
19
+ activesupport (= 3.1.0.rc5)
21
20
  bcrypt-ruby (~> 2.1.4)
22
21
  builder (~> 3.0.0)
23
22
  i18n (~> 0.6)
24
- activerecord (3.1.0.rc4)
25
- activemodel (= 3.1.0.rc4)
26
- activesupport (= 3.1.0.rc4)
27
- arel (~> 2.1.1)
28
- tzinfo (~> 0.3.27)
29
- activeresource (3.1.0.rc4)
30
- activemodel (= 3.1.0.rc4)
31
- activesupport (= 3.1.0.rc4)
32
- activesupport (3.1.0.rc4)
23
+ activerecord (3.1.0.rc5)
24
+ activemodel (= 3.1.0.rc5)
25
+ activesupport (= 3.1.0.rc5)
26
+ arel (~> 2.1.4)
27
+ tzinfo (~> 0.3.29)
28
+ activeresource (3.1.0.rc5)
29
+ activemodel (= 3.1.0.rc5)
30
+ activesupport (= 3.1.0.rc5)
31
+ activesupport (3.1.0.rc5)
33
32
  multi_json (~> 1.0)
34
33
  apotomo (1.1.2)
35
34
  cells (>= 3.5.6)
36
35
  hooks (~> 0.1.3)
37
36
  onfire (~> 0.2.0)
38
- arel (2.1.3)
37
+ arel (2.1.4)
39
38
  bcrypt-ruby (2.1.4)
40
39
  builder (3.0.0)
41
40
  capybara (1.0.0)
@@ -79,35 +78,38 @@ GEM
79
78
  treetop (~> 1.4.8)
80
79
  mime-types (1.16)
81
80
  multi_json (1.0.3)
81
+ nested_set (1.6.7)
82
+ activerecord (>= 3.0.0)
83
+ railties (>= 3.0.0)
82
84
  nokogiri (1.5.0)
83
85
  onfire (0.2.0)
84
- polyglot (0.3.1)
85
- rack (1.3.1)
86
+ polyglot (0.3.2)
87
+ rack (1.3.2)
86
88
  rack-cache (1.0.2)
87
89
  rack (>= 0.4)
88
90
  rack-mount (0.8.1)
89
91
  rack (>= 1.0.0)
90
92
  rack-ssl (1.3.2)
91
93
  rack
92
- rack-test (0.6.0)
94
+ rack-test (0.6.1)
93
95
  rack (>= 1.0)
94
- rails (3.1.0.rc4)
95
- actionmailer (= 3.1.0.rc4)
96
- actionpack (= 3.1.0.rc4)
97
- activerecord (= 3.1.0.rc4)
98
- activeresource (= 3.1.0.rc4)
99
- activesupport (= 3.1.0.rc4)
96
+ rails (3.1.0.rc5)
97
+ actionmailer (= 3.1.0.rc5)
98
+ actionpack (= 3.1.0.rc5)
99
+ activerecord (= 3.1.0.rc5)
100
+ activeresource (= 3.1.0.rc5)
101
+ activesupport (= 3.1.0.rc5)
100
102
  bundler (~> 1.0)
101
- railties (= 3.1.0.rc4)
102
- railties (3.1.0.rc4)
103
- actionpack (= 3.1.0.rc4)
104
- activesupport (= 3.1.0.rc4)
103
+ railties (= 3.1.0.rc5)
104
+ railties (3.1.0.rc5)
105
+ actionpack (= 3.1.0.rc5)
106
+ activesupport (= 3.1.0.rc5)
105
107
  rack-ssl (~> 1.3.2)
106
108
  rake (>= 0.8.7)
107
109
  rdoc (~> 3.4)
108
110
  thor (~> 0.14.6)
109
111
  rake (0.9.2)
110
- rdoc (3.8)
112
+ rdoc (3.9)
111
113
  rspec (2.6.0)
112
114
  rspec-core (~> 2.6.0)
113
115
  rspec-expectations (~> 2.6.0)
@@ -127,14 +129,15 @@ GEM
127
129
  ffi (>= 1.0.7)
128
130
  json_pure
129
131
  rubyzip
130
- sprockets (2.0.0.beta.10)
131
- hike (~> 1.0)
132
+ sprockets (2.0.0.beta.12)
133
+ hike (~> 1.2)
132
134
  rack (~> 1.0)
133
- tilt (!= 1.3.0, ~> 1.1)
134
- sqlite3 (1.3.3)
135
+ tilt (~> 1.1, != 1.3.0)
136
+ sqlite3 (1.3.4)
135
137
  thor (0.14.6)
136
138
  tilt (1.3.2)
137
- treetop (1.4.9)
139
+ treetop (1.4.10)
140
+ polyglot
138
141
  polyglot (>= 0.3.1)
139
142
  tzinfo (0.3.29)
140
143
  xpath (0.1.4)
@@ -154,6 +157,7 @@ DEPENDENCIES
154
157
  jeweler
155
158
  kaminari
156
159
  libnotify
157
- rails (>= 3.1.0.rc4)
160
+ nested_set
161
+ rails (>= 3.1.0.rc5)
158
162
  rspec-rails
159
163
  sqlite3
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Puffer - YARAI (Yet Another Rails Admin Interface). Rails 3 only.
1
+ # Puffer - YARAI (Yet Another Rails Admin Interface). Rails 3.1 only.
2
2
 
3
- Puffer was created to help project owner or moderators view and edit all the project`s data models. It is rails 3 only
3
+ Puffer was created to help project owner or moderators view and edit all the project`s data models. It is rails 3.1 only
4
4
 
5
5
  ## Keyfeatures
6
6
 
@@ -15,9 +15,6 @@ You can instal puffer as a gem:
15
15
  <pre>gem install puffer</pre>
16
16
  Or in Gemfile:
17
17
  <pre>gem "puffer"</pre>
18
- Next step is:
19
- <pre>rails g puffer:install</pre>
20
- This will install main puffer config file in your initializers and some css/js.
21
18
 
22
19
  ## Introduction.
23
20
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.20
1
+ 0.0.21
@@ -1,4 +1,5 @@
1
1
  /*
2
2
  *= require puffer/reset
3
3
  *= require puffer/puffer
4
+ *= require puffer/puffer_tree
4
5
  */
@@ -0,0 +1,65 @@
1
+ .puffer_tree *
2
+ {
3
+ font-size: 8pt;
4
+ }
5
+
6
+ .puffer_tree li
7
+ {
8
+ list-style: none;
9
+ position: relative;
10
+ }
11
+
12
+ .puffer_tree li ul
13
+ {
14
+ margin-left: 20px;
15
+ }
16
+
17
+ .puffer_tree li .record
18
+ {
19
+ margin-bottom: 5px;
20
+ border: 1px solid #ddd;
21
+ border-radius: 5px;
22
+ -moz-border-radius: 5px;
23
+ -webkit-border-radius: 5px;
24
+ }
25
+
26
+ .puffer_tree li .record dt
27
+ {
28
+ white-space: nowrap;
29
+ }
30
+
31
+ .puffer_tree li .record dd
32
+ {
33
+ width: 50px;
34
+ white-space: nowrap;
35
+ padding: 5px;
36
+ padding-left: 20px;
37
+ }
38
+
39
+ .puffer_tree li .record dt > span
40
+ {
41
+ display: table-cell;
42
+ *display: inline;
43
+ zoom: 1;
44
+ padding: 5px;
45
+ white-space: normal;
46
+ vertical-align: top;
47
+ }
48
+
49
+ .puffer_tree li .record dt > span.handle
50
+ {
51
+ padding-right: 10px;
52
+ color: #999;
53
+ }
54
+
55
+ .puffer_tree li .record .toggle
56
+ {
57
+ position: absolute;
58
+ left: -20px;
59
+ }
60
+
61
+ .puffer_tree li .record .toggle a
62
+ {
63
+ color: #999;
64
+ text-decoration: none;
65
+ }
@@ -3,7 +3,9 @@ module Puffer
3
3
  unloadable
4
4
 
5
5
  pufferize!
6
- define_fields :index, :show, :form, :create, :update
6
+ define_fieldset :index, :form
7
+ define_fieldset :show, :fallbacks => :index
8
+ define_fieldset :create, :update, :fallbacks => :form
7
9
 
8
10
  respond_to :html, :js
9
11
 
@@ -1,4 +1,4 @@
1
- class Puffer::Dashboard < ApplicationController
1
+ class Puffer::DashboardBase < ApplicationController
2
2
  unloadable
3
3
 
4
4
  pufferize!
@@ -0,0 +1,4 @@
1
+ class Puffer::DashboardController < Puffer::DashboardBase
2
+ unloadable
3
+
4
+ end
@@ -1,8 +1,8 @@
1
- class Puffer::Sessions < ApplicationController
1
+ class Puffer::SessionsBase < ApplicationController
2
2
  unloadable
3
3
 
4
4
  pufferize!
5
- define_fields :create
5
+ define_fieldset :create
6
6
 
7
7
  layout 'puffer_sessions'
8
8
 
@@ -1,4 +1,5 @@
1
- class Puffer::SessionsController < Puffer::Sessions
1
+ class Puffer::SessionsController < Puffer::SessionsBase
2
+ unloadable
2
3
  # This is example session controller for puffer authentication.
3
4
  # You can define your own actions.
4
5
  # Also, you can redefine <tt>new<tt> action view as you wish,
@@ -0,0 +1,50 @@
1
+ module Puffer
2
+ class TreeBase < Puffer::Base
3
+ unloadable
4
+
5
+ helper :puffer_tree
6
+
7
+ define_fieldset :tree, :fallbacks => :index
8
+
9
+ def index
10
+ return super if params[:search]
11
+ @records = resource.collection_scope.includes(resource.includes)
12
+ if session[:expanded].present?
13
+ @records = @records.where(["depth in (0, 1) or parent_id in (#{session[:expanded].join(', ')})"]).arrange
14
+ else
15
+ @records = @records.with_depth([0, 1]).arrange
16
+ end
17
+ render 'tree'
18
+ end
19
+
20
+ member do
21
+ get :inherit, :label => 'inherit'
22
+ get :expand, :display => false
23
+ get :collapse, :display => false
24
+ end
25
+
26
+ def inherit
27
+ @parent = resource.member
28
+ @record = @parent.children.new
29
+ render 'new'
30
+ end
31
+
32
+ def expand
33
+ @parent = resource.member
34
+ session[:expanded] ||= []
35
+ session[:expanded].push params[:id] if @parent
36
+ session[:expanded].uniq!
37
+ @records = @parent.self_and_descendants.where(:parent_id => [@parent.parent_id] + session[:expanded]).includes(resource.includes).arrange
38
+ render 'toggle'
39
+ end
40
+
41
+ def collapse
42
+ @parent = resource.member
43
+ session[:expanded] ||= []
44
+ session[:expanded].delete params[:id]
45
+ @records = resource.collection_scope.where(:id => [@parent.id]).includes(resource.includes).arrange
46
+ render 'toggle'
47
+ end
48
+
49
+ end
50
+ end
@@ -1,12 +1,8 @@
1
1
  module PufferHelper
2
2
 
3
3
  def puffer_namespaces
4
- Rails.application.routes.puffer.each do |(prefix, groups)|
5
- controller = groups.values.first.first
6
- title = prefix.to_s.humanize
7
- path = send("#{prefix}_#{controller.controller_name}_path")
8
- current = controller.namespace == namespace
9
- yield title, path, current
4
+ Rails.application.routes.puffer.keys.each do |prefix|
5
+ yield prefix.to_s.humanize, send("#{prefix}_root_path"), prefix == namespace
10
6
  end
11
7
  end
12
8
 
@@ -0,0 +1,15 @@
1
+ module PufferTreeHelper
2
+
3
+ def puffer_tree hash, options = {}, &block
4
+ content_tag :ul, options do
5
+ puffer_tree_node hash, &block
6
+ end if hash.present?
7
+ end
8
+
9
+ def puffer_tree_node hash, &block
10
+ hash.keys.each do |node|
11
+ block.call node, render_tree(hash[node], &block)
12
+ end if hash.present?
13
+ end
14
+
15
+ end
@@ -1,77 +1,60 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title><%= [@title, 'Puffer'].compact.join(' - ') %></title>
5
- <meta http-equiv="content-type" content="text/html;charset=utf-8" />
6
- <%= csrf_meta_tag %>
7
- <%= stylesheet_link_tag "puffer/application" %>
8
- <%= javascript_include_tag "puffer/application" %>
9
- <%= yield :stylesheets %>
10
- <%= yield :javascripts %>
11
- </head>
12
- <body>
13
- <div class="body">
14
- <div class="header">
15
- <div class="logo">
16
- <%= link_to t('puffer.logo'), puffer_root_path %>
17
- </div>
18
- <ul class="namespaces">
19
- <% puffer_namespaces do |title, path, current| %>
20
- <li<%= raw(current ? ' class="selected"' : '') %>><%= link_to title, path %></li>
21
- <% end %>
22
- </ul>
1
+ <% content_for :header do %>
2
+ <ul class="namespaces">
3
+ <% puffer_namespaces do |title, path, current| %>
4
+ <li<%= raw(current ? ' class="selected"' : '') %>><%= link_to title, path %></li>
5
+ <% end %>
6
+ </ul>
7
+ <ul class="navigation">
8
+ <% puffer_navigation do |title, path, current| %>
9
+ <li<%= raw(current ? ' class="selected"' : '') %>><%= link_to title, path %></li>
10
+ <% end %>
11
+ </ul>
12
+ <% end %>
13
+
14
+ <% content_for :content do %>
15
+ <div class="columns">
16
+ <div class="column sidebar">
17
+ <div class="padder">
23
18
  <ul class="navigation">
24
- <% puffer_navigation do |title, path, current| %>
25
- <li<%= raw(current ? ' class="selected"' : '') %>><%= link_to title, path %></li>
19
+ <% sidebar_puffer_navigation do |title, path, current| %>
20
+ <li<%= raw(current ? ' class="selected"' : '') %>>
21
+ <%= link_to title, path %>
22
+ <% if current %>
23
+ <div class="additional">
24
+ <dl>
25
+ <dt>Links</dt>
26
+ <dd>
27
+ <%= link_to t(:list, :target => resource.human), resource.collection_path %>
28
+ <%= link_to t(:add, :target => resource.human), resource.new_path %>
29
+ </dd>
30
+ <dt>Search</dt>
31
+ <dd>
32
+ <%= form_tag resource.collection_path, {:method => :get} do %>
33
+ <%= text_field_tag :search, params[:search] %>
34
+ <%= submit_tag 'Search' %>
35
+
36
+ <% if false %>
37
+ <% if resource_session[:search].present? %>
38
+ <%= link_to 'clear', resource.collection_path(:search => '') %>
39
+ <% end %>
40
+ <% end %>
41
+ <% end %>
42
+ </dd>
43
+ </dl>
44
+ </div>
45
+ <% end %>
46
+ </li>
26
47
  <% end %>
27
48
  </ul>
28
- <div class="logout">
29
- <%= link_to t('puffer.logout'), puffer_session_url, :method => :delete %>
30
- </div>
49
+ <%= yield :sidebar %>
31
50
  </div>
32
- <div class="columns">
33
- <div class="column sidebar">
34
- <div class="padder">
35
- <ul class="navigation">
36
- <% sidebar_puffer_navigation do |title, path, current| %>
37
- <li<%= raw(current ? ' class="selected"' : '') %>>
38
- <%= link_to title, path %>
39
- <% if current %>
40
- <div class="additional">
41
- <dl>
42
- <dt>Links</dt>
43
- <dd>
44
- <%= link_to t(:list, :target => resource.human), resource.collection_path %>
45
- <%= link_to t(:add, :target => resource.human), resource.new_path %>
46
- </dd>
47
- <dt>Search</dt>
48
- <dd>
49
- <%= form_tag resource.collection_path, {:method => :get} do %>
50
- <%= text_field_tag :search, params[:search] %>
51
- <%= submit_tag 'Search' %>
52
-
53
- <% if false %>
54
- <% if resource_session[:search].present? %>
55
- <%= link_to 'clear', resource.collection_path(:search => '') %>
56
- <% end %>
57
- <% end %>
58
- <% end %>
59
- </dd>
60
- </dl>
61
- </div>
62
- <% end %>
63
- </li>
64
- <% end %>
65
- </ul>
66
- <%= yield :sidebar %>
67
- </div>
68
- </div>
69
- <div class="column">
70
- <div class="content">
71
- <%= yield %>
72
- </div>
73
- </div>
51
+ </div>
52
+ <div class="column">
53
+ <div class="content">
54
+ <%= yield %>
74
55
  </div>
75
56
  </div>
76
- </body>
77
- </html>
57
+ </div>
58
+ <% end %>
59
+
60
+ <%= render :file => 'layouts/puffer_base' %>
@@ -0,0 +1,28 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title><%= [@title, 'Puffer'].compact.join(' - ') %></title>
5
+ <meta http-equiv="content-type" content="text/html;charset=utf-8" />
6
+ <%= csrf_meta_tag %>
7
+ <%= stylesheet_link_tag "puffer/application" %>
8
+ <%= javascript_include_tag "puffer/application" %>
9
+ <%= yield :stylesheets %>
10
+ <%= yield :javascripts %>
11
+ </head>
12
+ <body>
13
+ <div class="body">
14
+ <div class="header">
15
+ <div class="logo">
16
+ <%= link_to t('puffer.logo'), puffer_root_path %>
17
+ </div>
18
+ <%= yield :header %>
19
+ <% if respond_to?(:current_user) && !current_user %>
20
+ <div class="logout">
21
+ <%= link_to t('puffer.logout'), puffer_session_url, :method => :delete %>
22
+ </div>
23
+ <% end %>
24
+ </div>
25
+ <%= yield :content %>
26
+ </div>
27
+ </body>
28
+ </html>
@@ -1,32 +1,15 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title><%= [@title, 'Puffer'].compact.join(' - ') %></title>
5
- <meta http-equiv="content-type" content="text/html;charset=utf-8" />
6
- <%= csrf_meta_tag %>
7
- <%= stylesheet_link_tag "puffer/application" %>
8
- <%= javascript_include_tag "puffer/application" %>
9
- <%= yield :stylesheets %>
10
- <%= yield :javascripts %>
11
- </head>
12
- <body>
13
- <div class="body">
14
- <div class="header">
15
- <div class="logo">
16
- <%= link_to t('puffer.logo'), puffer_root_path %>
17
- </div>
18
- <ul class="namespaces">
19
- <% puffer_namespaces do |title, path, current| %>
20
- <li<%= raw(current ? ' class="selected"' : '') %>><%= link_to title, path %></li>
21
- <% end %>
22
- </ul>
23
- <div class="logout">
24
- <%= link_to t('puffer.logout'), puffer_session_url, :method => :delete %>
25
- </div>
26
- </div>
27
- <div class="content dashboard">
28
- <%= yield %>
29
- </div>
30
- </div>
31
- </body>
32
- </html>
1
+ <% content_for :header do %>
2
+ <ul class="namespaces">
3
+ <% puffer_namespaces do |title, path, current| %>
4
+ <li<%= raw(current ? ' class="selected"' : '') %>><%= link_to title, path %></li>
5
+ <% end %>
6
+ </ul>
7
+ <% end %>
8
+
9
+ <% content_for :content do %>
10
+ <div class="content dashboard">
11
+ <%= yield %>
12
+ </div>
13
+ <% end %>
14
+
15
+ <%= render :file => 'layouts/puffer_base' %>
@@ -1,24 +1,7 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title><%= [@title, 'Puffer'].compact.join(' - ') %></title>
5
- <meta http-equiv="content-type" content="text/html;charset=utf-8" />
6
- <%= csrf_meta_tag %>
7
- <%= stylesheet_link_tag "puffer/application" %>
8
- <%= javascript_include_tag "puffer/application" %>
9
- <%= yield :stylesheets %>
10
- <%= yield :javascripts %>
11
- </head>
12
- <body>
13
- <div class="body">
14
- <div class="header">
15
- <div class="logo">
16
- <span><%= t('puffer.logo') %></span>
17
- </div>
18
- </div>
19
- <div class="content sessions">
20
- <%= yield %>
21
- </div>
22
- </div>
23
- </body>
24
- </html>
1
+ <% content_for :content do %>
2
+ <div class="content sessions">
3
+ <%= yield %>
4
+ </div>
5
+ <% end %>
6
+
7
+ <%= render :file => 'layouts/puffer_base' %>
@@ -32,4 +32,3 @@
32
32
  <p>Sorry, but there is no records in <%= resource.human %></p>
33
33
  <% end %>
34
34
  <%= paginate records, :url => resource.collection_path(:page => '') %>
35
-
@@ -0,0 +1,27 @@
1
+ <li id="<%= dom_id record %>">
2
+ <dl class="record columns">
3
+ <dt class="column">
4
+ <% unless record.leaf? || record.root? %>
5
+ <span class="toggle">
6
+ <% if children.blank? %>
7
+ <%= link_to '+', resource.member_path(record, :action => :expand), :remote => true %>
8
+ <% else %>
9
+ <%= link_to '–', resource.member_path(record, :action => :collapse), :remote => true %>
10
+ <% end %>
11
+ </span>
12
+ <% end %>
13
+ <span class="handle">⇅</span>
14
+ <% tree_fields.each do |field| -%>
15
+ <span><%= render_field field, record %></span>
16
+ <% end -%>
17
+ </dt>
18
+ <dd class="column">
19
+ <%= link_to 'edit', resource.edit_path(record) if update_fields.present? %>
20
+ <% controller._members.each do |member| %>
21
+ <%= link_to member.label, resource.member_path(record, :action => member.action) if member.display? %>
22
+ <% end %>
23
+ <%= link_to 'destroy', resource.member_path(record), :confirm => "Are you sure?", :method => :delete if configuration.destroy %>
24
+ </dd>
25
+ </dl>
26
+ <%= children %>
27
+ </li>