bowtie 0.4.5 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
data/bowtie.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{bowtie}
3
- s.version = "0.4.5"
3
+ s.version = "0.4.6"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
6
6
  s.authors = ["Tomás Pollak"]
@@ -1,6 +1,5 @@
1
1
  <%=
2
2
 
3
- html =''
4
3
  name = @p
5
4
  begin
6
5
  value = @resource.send(@p)
@@ -8,17 +7,12 @@
8
7
  value = ''
9
8
  end
10
9
 
11
- case @p.class.to_s.gsub("DataMapper::Property::",'')
12
- when "Array", /Class/ # weird how datamapper names enum classes
13
- html += '<select class="array" name="resource['+name+']">'
14
- @resource.model.options_for_subtype(name.to_sym).each do |option|
15
- selected = value.to_s == option.to_s ? 'selected="selected"' : ''
16
- html += '<option value="'+option.to_s+'" '+selected+'>'+option.to_s.titleize+'</option>'
17
- end
18
- html += '</select>'
10
+ html =''
11
+
12
+ case value.class.name
19
13
  when "TrueClass", "FalseClass", /Boolean/
20
14
  checked = value == true ? 'checked="checked"' : ''
21
- html += '<input name="resource['+name+']" type="checkbox" '+checked+' />'
15
+ html += '<input name="resource['+name.to_s+']" type="checkbox" '+checked+' />'
22
16
  else
23
17
  html += '<input class="string" type="text" name="resource['+name.to_s+']" value="'+value.to_s+'" />'
24
18
  end
@@ -13,7 +13,7 @@
13
13
  <% @p = p %>
14
14
  <% next if %w(id _id created_at _created_at _type).include?(@p.to_s) %>
15
15
  <tr>
16
- <td class="left-col"><%= @p.to_s.titleize %> <small>(<%= @p.class.name.to_s.gsub("DataMapper::Property::",'') %>)</small></td>
16
+ <td class="left-col"><%= @p.to_s %> <small>(<%= @resource.send(p).class.name %>)</small></td>
17
17
  <td class="right-col"><%= partial(:field) %></td>
18
18
  </tr>
19
19
  <% end %>
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bowtie
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 5
10
- version: 0.4.5
9
+ - 6
10
+ version: 0.4.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Tom\xC3\xA1s Pollak"