sferik-merb-admin 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -14,7 +14,7 @@ At the command prompt, type:
14
14
 
15
15
  In your app, add the following dependency to `config/dependencies.rb`:
16
16
 
17
- dependency "sferik-merb-admin", "0.2.3", :require_as => "merb-admin"
17
+ dependency "sferik-merb-admin", "0.2.4", :require_as => "merb-admin"
18
18
 
19
19
  Add the following route to `config/router.rb`:
20
20
 
data/Rakefile CHANGED
@@ -12,7 +12,7 @@ AUTHOR = "Erik Michaels-Ober"
12
12
  EMAIL = "sferik@gmail.com"
13
13
  HOMEPAGE = "http://twitter.com/sferik"
14
14
  SUMMARY = "MerbAdmin is a merb slice that provides an easy-to-use interface for managing your data."
15
- GEM_VERSION = "0.2.3"
15
+ GEM_VERSION = "0.2.4"
16
16
 
17
17
  spec = Gem::Specification.new do |s|
18
18
  s.rubyforge_project = "merb"
@@ -1,8 +1,6 @@
1
- <div class="form-row page">
2
1
  <div>
3
2
  <%= text_field(property.name, :maxlength => property.length, :label => property.field.capitalize.gsub('_', ' ')) %>
4
3
  <p class="help">
5
4
  <%= !property.nullable? || property.serial? ? "Required." : "Optional." %>
6
5
  </p>
7
6
  </div>
8
- </div>
@@ -1,9 +1,7 @@
1
1
  <% value = eval("@instance.#{property.field}") %>
2
- <div class="form-row page">
3
2
  <div>
4
3
  <%= text_field(property.name, :class => "vDateField", :label => property.field.capitalize.gsub('_', ' '), :value => value.respond_to?(:strftime) ? value.strftime("%Y-%m-%d") : nil) %>
5
4
  <p class="help">
6
5
  <%= !property.nullable? ? "Required." : "Optional." %>
7
6
  </p>
8
7
  </div>
9
- </div>
@@ -1,9 +1,7 @@
1
1
  <% value = eval("@instance.#{property.field}") %>
2
- <div class="form-row page">
3
2
  <div>
4
3
  <%= text_field(property.name, :class => "vDateField", :label => property.field.capitalize.gsub('_', ' '), :value => value.respond_to?(:strftime) ? value.strftime("%Y-%m-%d %H:%M:%S") ? nil) %>
5
4
  <p class="help">
6
5
  <%= !property.nullable? ? "Required." : "Optional." %>
7
6
  </p>
8
7
  </div>
9
- </div>
@@ -1,8 +1,6 @@
1
- <div class="form-row page">
2
1
  <div>
3
2
  <%= text_field(property.name, :maxlength => property.length, :label => property.field.capitalize.gsub('_', ' ')) %>
4
3
  <p class="help">
5
4
  <%= !property.nullable? || property.serial? ? "Required." : "Optional." %>
6
5
  </p>
7
6
  </div>
8
- </div>
@@ -1,4 +1,3 @@
1
- <div class="form-row page">
2
1
  <div>
3
2
  <% if property.type.respond_to?(:flag_map) #Enum or Flag type %>
4
3
  <%= select(property.name, :collection => property.type.flag_map.map{|x| [x[1], x[1].to_s.capitalize.gsub('_', ' ')]}.sort{|a, b| a[1] <=> b[1]}, :label => property.field.capitalize.gsub('_', ' ')) %>
@@ -9,4 +8,3 @@
9
8
  <%= !property.nullable? || property.serial? ? "Required." : "Optional." %>
10
9
  </p>
11
10
  </div>
12
- </div>
@@ -1,4 +1,3 @@
1
- <div class="form-row page">
2
1
  <div>
3
2
  <% case property.type.to_s %>
4
3
  <% when "DataMapper::Types::Text" %>
@@ -13,4 +12,3 @@
13
12
  </p>
14
13
  <% end %>
15
14
  </div>
16
- </div>
@@ -1,9 +1,7 @@
1
1
  <% value = eval("@instance.#{property.field}") %>
2
- <div class="form-row page">
3
2
  <div>
4
3
  <%= text_field(property.name, :class => "vTimeField", :label => property.field.capitalize.gsub('_', ' '), :value => value.respond_to?(:strftime) ? value.strftime("%H:%M:%S") : nil) %>
5
4
  <p class="help">
6
5
  <%= !property.nullable? ? "Required." : "Optional." %>
7
6
  </p>
8
7
  </div>
9
- </div>
@@ -1,5 +1,3 @@
1
- <div class="form-row page">
2
1
  <div>
3
2
  <%= check_box(property.name, :label => property.field.capitalize.gsub('_', ' ')) %>
4
3
  </div>
5
- </div>
@@ -7,10 +7,18 @@
7
7
  <%= form_for(@instance, :action => slice_url(:admin_update, :model_name => @model_name.snake_case, :id => @instance.id)) do %>
8
8
  <div>
9
9
  <fieldset class="module aligned">
10
- <h2><%= @model_name %> info</h2>
11
10
  <% @properties.each do |property| %>
12
11
  <% next if [:id, :created_at, :created_on, :updated_at, :updated_on].include?(property.name) %>
12
+ <div class="<%= @instance.errors[property.name] ? "form-row errors" : "form-row"%>">
13
+ <% if @instance.errors[property.name] %>
14
+ <ul class="errorlist">
15
+ <% @instance.errors[property.name].each do |error| %>
16
+ <li><%= error %></li>
17
+ <% end %>
18
+ </ul>
19
+ <% end %>
13
20
  <%= partial(property.primitive.to_s.snake_case, :property => property) -%>
21
+ </div>
14
22
  <% end %>
15
23
  </fieldset>
16
24
  <div class="submit-row" >
@@ -2,10 +2,18 @@
2
2
  <%= form_for(@instance, :action => slice_url(:admin_create, :model_name => @model_name.snake_case)) do %>
3
3
  <div>
4
4
  <fieldset class="module aligned">
5
- <h2><%= @model_name %> info</h2>
6
5
  <% @properties.each do |property| %>
7
6
  <% next if [:id, :created_at, :created_on, :updated_at, :updated_on].include?(property.name) %>
7
+ <div class="<%= @instance.errors[property.name] ? "form-row errors" : "form-row"%>">
8
+ <% if @instance.errors[property.name] %>
9
+ <ul class="errorlist">
10
+ <% @instance.errors[property.name].each do |error| %>
11
+ <li><%= error %></li>
12
+ <% end %>
13
+ </ul>
14
+ <% end %>
8
15
  <%= partial(property.primitive.to_s.snake_case, :property => property) -%>
16
+ </div>
9
17
  <% end %>
10
18
  </fieldset>
11
19
  <div class="submit-row" >
@@ -1,7 +1,7 @@
1
1
  <% if message && message[:error] %>
2
- <ul class="errorlist">
3
- <li><%=h message[:error] %></li>
4
- </ul>
2
+ <p class="errornote">
3
+ <%=h message[:error] %>
4
+ </p>
5
5
  <% end %>
6
6
  <% if message && message[:notice] %>
7
7
  <ul class="messagelist">
data/lib/merb-admin.rb CHANGED
@@ -22,7 +22,7 @@ if defined?(Merb::Plugins)
22
22
 
23
23
  # Slice metadata
24
24
  self.description = "MerbAdmin is a merb slice that uses your DataMapper models to provide an easy-to-use, Django-style interface for content managers."
25
- self.version = "0.2.3"
25
+ self.version = "0.2.4"
26
26
  self.author = "Erik Michaels-Ober"
27
27
 
28
28
  # Stub classes loaded hook - runs before LoadClasses BootLoader
data/spec/spec_helper.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  require 'rubygems'
2
2
  require 'merb-core'
3
3
  require 'merb-slices'
4
+ require 'merb-helpers'
5
+ require 'merb-assets'
4
6
  require 'spec'
5
7
 
6
8
  # Add merb-admin.rb to the search path
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sferik-merb-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Michaels-Ober
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-10 00:00:00 -07:00
12
+ date: 2009-08-11 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency