puffer 0.0.10 → 0.0.11

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.10
1
+ 0.0.11
@@ -18,9 +18,11 @@
18
18
  <td><%= render_field field, record %></td>
19
19
  <% end -%>
20
20
  <td class="actions">
21
- <%= link_to 'show', resource.member_path(record), :class => 'show_entry' if show_fields.present? || resource.children.present? %>
22
- <%= link_to 'edit', resource.edit_path(record), :class => 'edit_entry' if update_fields.present? %>
23
- <%= link_to 'destroy', resource.member_path(record), :confirm => "Are you sure?", :method => :delete, :class => 'remove_entry' if configuration.destroy %>
21
+ <%= link_to 'edit', resource.edit_path(record) if update_fields.present? %>
22
+ <% controller._members.each do |member| %>
23
+ <%= link_to member.label, resource.member_path(record, :action => member.action) if member.display? %>
24
+ <% end %>
25
+ <%= link_to 'destroy', resource.member_path(record), :confirm => "Are you sure?", :method => :delete if configuration.destroy %>
24
26
  </td>
25
27
  </tr>
26
28
  <% end -%>
@@ -206,21 +206,10 @@ h1
206
206
  vertical-align: top;
207
207
  }
208
208
 
209
- .list_table th.actions
210
- {
211
- position: static;
212
- }
213
-
214
209
  .list_table td.actions
215
210
  {
216
- position: static;
217
211
  white-space: nowrap;
218
- width: 100px;
219
- }
220
-
221
- .list_table td.actions a
222
- {
223
- line-height: 140%;
212
+ width: 50px;
224
213
  }
225
214
 
226
215
  .list_table th
@@ -273,7 +262,7 @@ h1
273
262
  background: #f4f4f4;
274
263
  }
275
264
 
276
- label, input, textarea
265
+ label, input, textarea, select
277
266
  {
278
267
  font-family: Helvetica, Arial, sans-serif;
279
268
  }
@@ -302,6 +291,11 @@ input[type=submit]
302
291
  font-size: 11pt;
303
292
  }
304
293
 
294
+ select
295
+ {
296
+ font-size: 11pt;
297
+ }
298
+
305
299
  #search
306
300
  {
307
301
  width: 120px;
@@ -4,10 +4,39 @@ module Puffer
4
4
 
5
5
  %w(match get post put delete).each do |method|
6
6
  define_method method do |*args|
7
- push args.unshift(method)
7
+ push Action.new(args.unshift(method))
8
8
  end
9
9
  end
10
10
 
11
11
  end
12
+
13
+ class Action < Array
14
+
15
+ def initialize *args
16
+ super *args
17
+ options = extract_options!
18
+ @display = options.key?(:display) ? options.delete(:display) : true
19
+ @label = options.delete(:label)
20
+ push options
21
+ end
22
+
23
+ def method
24
+ first
25
+ end
26
+
27
+ def action
28
+ second
29
+ end
30
+
31
+ def label
32
+ @label || second
33
+ end
34
+
35
+ def display?
36
+ @display
37
+ end
38
+
39
+ end
40
+
12
41
  end
13
42
  end
@@ -0,0 +1,15 @@
1
+ module Puffer
2
+ module Inputs
3
+ class Hidden < Puffer::Inputs::Base
4
+
5
+ def input
6
+ builder.hidden_field field, field.input_options
7
+ end
8
+
9
+ def html
10
+ input
11
+ end
12
+
13
+ end
14
+ end
15
+ end
@@ -3,7 +3,15 @@ module Puffer
3
3
  class Select < Puffer::Inputs::Base
4
4
 
5
5
  def input
6
- builder.select field, field.options[:select], {:include_blank => field.options[:include_blank]}, field.input_options
6
+ options = case field.options[:select]
7
+ when Symbol then
8
+ send field.options[:select]
9
+ when Proc then
10
+ field.options[:select].bind(temptate).call
11
+ else
12
+ field.options[:select]
13
+ end
14
+ builder.select field, options, {:include_blank => field.options[:include_blank]}, field.input_options
7
15
  end
8
16
 
9
17
  end
data/puffer.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{puffer}
8
- s.version = "0.0.10"
8
+ s.version = "0.0.11"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["pyromaniac"]
12
- s.date = %q{2011-02-03}
12
+ s.date = %q{2011-02-04}
13
13
  s.description = %q{In Soviet Russia puffer admins you}
14
14
  s.email = %q{kinwizard@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -95,6 +95,7 @@ Gem::Specification.new do |s|
95
95
  "lib/puffer/inputs/collection_association.rb",
96
96
  "lib/puffer/inputs/date_time.rb",
97
97
  "lib/puffer/inputs/file.rb",
98
+ "lib/puffer/inputs/hidden.rb",
98
99
  "lib/puffer/inputs/password.rb",
99
100
  "lib/puffer/inputs/select.rb",
100
101
  "lib/puffer/inputs/text.rb",
@@ -206,21 +206,10 @@ h1
206
206
  vertical-align: top;
207
207
  }
208
208
 
209
- .list_table th.actions
210
- {
211
- position: static;
212
- }
213
-
214
209
  .list_table td.actions
215
210
  {
216
- position: static;
217
211
  white-space: nowrap;
218
- width: 100px;
219
- }
220
-
221
- .list_table td.actions a
222
- {
223
- line-height: 140%;
212
+ width: 50px;
224
213
  }
225
214
 
226
215
  .list_table th
@@ -273,7 +262,7 @@ h1
273
262
  background: #f4f4f4;
274
263
  }
275
264
 
276
- label, input, textarea
265
+ label, input, textarea, select
277
266
  {
278
267
  font-family: Helvetica, Arial, sans-serif;
279
268
  }
@@ -302,6 +291,11 @@ input[type=submit]
302
291
  font-size: 11pt;
303
292
  }
304
293
 
294
+ select
295
+ {
296
+ font-size: 11pt;
297
+ }
298
+
305
299
  #search
306
300
  {
307
301
  width: 120px;
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puffer
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 10
10
- version: 0.0.10
9
+ - 11
10
+ version: 0.0.11
11
11
  platform: ruby
12
12
  authors:
13
13
  - pyromaniac
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-03 00:00:00 +03:00
18
+ date: 2011-02-04 00:00:00 +03:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -269,6 +269,7 @@ files:
269
269
  - lib/puffer/inputs/collection_association.rb
270
270
  - lib/puffer/inputs/date_time.rb
271
271
  - lib/puffer/inputs/file.rb
272
+ - lib/puffer/inputs/hidden.rb
272
273
  - lib/puffer/inputs/password.rb
273
274
  - lib/puffer/inputs/select.rb
274
275
  - lib/puffer/inputs/text.rb