bowtie 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,9 +1,11 @@
1
- ## Bowtie: Zeroconf admin scaffold for your MongoMapper & DataMapper models
1
+ ## Bowtie: Simple admin scaffold for your MongoMapper & DataMapper models
2
2
 
3
3
  Bowtie reads the information on your models and creates a nice panel in which you can view, edit and destroy records easily.
4
4
 
5
5
  ## How does it look?
6
6
 
7
+ Glad you asked:
8
+
7
9
  ![Bowtie!](https://github.com/tomas/bowtie/raw/master/screenshot.png)
8
10
 
9
11
  ## Installation
@@ -16,7 +18,7 @@ Include it in your Gemfile and update your bundle:
16
18
 
17
19
  Or install it by hand:
18
20
 
19
- $ gem install bowtie
21
+ $ (sudo) gem install bowtie
20
22
 
21
23
  ## Configuration
22
24
 
@@ -25,19 +27,15 @@ Mount Bowtie wherever you want by editing your config.ru file, after loading you
25
27
  require 'my_app' # models are loaded
26
28
  require 'bowtie'
27
29
 
28
- BOWTIE_AUTH = {:user => 'admin', :pass => '12345' }
29
-
30
- app = Rack::Builder.new {
31
- map "/admin" do
32
- run Bowtie::Admin
33
- end
30
+ BOWTIE_AUTH = {:user => 'admin', :pass => '12345'}
34
31
 
35
- map '/' do
36
- run MyApp
37
- end
38
- }
32
+ map "/admin" do
33
+ run Bowtie::Admin
34
+ end
39
35
 
40
- run app
36
+ map '/' do
37
+ run MyApp
38
+ end
41
39
 
42
40
  Now you can go to /admin in your app's path and try out Bowtie using your user/pass combination. If not set, it defaults to admin/bowtie.
43
41
 
@@ -55,13 +53,9 @@ For DataMapper models:
55
53
  For MongoMapper models:
56
54
 
57
55
  * mongo_mapper
56
+ * bson_ext (not required, but recommended)
58
57
 
59
- From version 0.3, Bowtie is meant to be used from DataMapper 1.0.0 on. For previous versions please install with -v=0.2.5.
60
-
61
- ## TODO
62
-
63
- * Better handling of types (Text, JSON, IPAddress) in #show
64
- * Better handling of relationships in #show
58
+ From version 0.3, Bowtie is meant to be used from DataMapper 1.0.0 on. For previous versions of DM please install with -v=0.2.5.
65
59
 
66
60
  ## Copyright
67
61
 
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.3"
3
+ s.version = "0.4.4"
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,17 +1,21 @@
1
- <form class="resource" method="post" action="<%= model_path(@resource.class) %><%= '/' + @resource.id.to_s if @resource.id %>">
2
- <%= '<input type="hidden" name="_method" value="put">' if @resource.id %>
1
+ <% if @resource.new? %>
2
+ <form class="resource" method="post" action="<%= model_path(@resource.class) %>">
3
+ <% else %>
4
+ <form class="resource" method="post" action="<%= model_path(@resource.class) %>/<%= @resource.id %>">
5
+ <input type="hidden" name="_method" value="put">
6
+ <% end %>
3
7
 
4
8
  <%= partial(:errors) %>
5
9
 
6
10
  <table>
7
11
 
8
- <!-- filter id and created at fields. association ids pass -->
9
- <% @resource.class.field_names.each do |@p| %>
10
- <% next if %w(id _id created_at _created_at _type).include?(@p.to_s) %>
11
- <tr>
12
- <td class="left-col"><%= @p.to_s.titleize %> <small>(<%= @p.class.name.to_s.gsub("DataMapper::Property::",'') %>)</small></td>
13
- <td class="right-col"><%= partial(:field) %></td>
14
- </tr>
12
+ <% @resource.class.field_names.each do |p| %>
13
+ <% @p = p %>
14
+ <% next if %w(id _id created_at _created_at _type).include?(@p.to_s) %>
15
+ <tr>
16
+ <td class="left-col"><%= @p.to_s.titleize %> <small>(<%= @p.class.name.to_s.gsub("DataMapper::Property::",'') %>)</small></td>
17
+ <td class="right-col"><%= partial(:field) %></td>
18
+ </tr>
15
19
  <% end %>
16
20
 
17
21
  </table>
@@ -19,7 +19,8 @@
19
19
  </thead>
20
20
 
21
21
  <tbody>
22
- <% @resources.each do |@r| %>
22
+ <% @resources.each do |r| %>
23
+ <% @r = r %>
23
24
  <%= partial(:row) %>
24
25
  <% end %>
25
26
  </tbody>
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: 9
5
- prerelease:
4
+ hash: 7
5
+ prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 3
10
- version: 0.4.3
9
+ - 4
10
+ version: 0.4.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Tom\xC3\xA1s Pollak"
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  requirements: []
107
107
 
108
108
  rubyforge_project: bowtie
109
- rubygems_version: 1.5.2
109
+ rubygems_version: 1.3.7
110
110
  signing_key:
111
111
  specification_version: 3
112
112
  summary: Bowtie Admin Scaffold