scaffolding_extensions 1.5.4 → 1.5.5

Sign up to get free protection for your applications and to get access to all the features.
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2005-2011 Jeremy Evans
1
+ Copyright (c) 2005-2012 Jeremy Evans
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
data/README CHANGED
@@ -21,14 +21,14 @@ to better suit your needs.
21
21
  Scaffolding Extensions currently supports:
22
22
 
23
23
  * Web Frameworks
24
- * Rails 3.1.0
25
- * Ramaze 2011.01.30
24
+ * Rails 3.2.3
25
+ * Ramaze 2011.12.28
26
26
  * Camping 2.1
27
- * Sinatra 1.2.6
28
- * Rack 1.2.2
27
+ * Sinatra 1.3.1
28
+ * Rack 1.4.0
29
29
  * Object Relational Mappers
30
- * ActiveRecord 3.1.0
31
- * Sequel 3.27.0
30
+ * ActiveRecord 3.2.3
31
+ * Sequel 3.34.0
32
32
  * DataMapper 1.0.2 (see doc/datamapper.txt for details)
33
33
  * Javascript Libaries (used for Ajax/Autocompleting, default is now JQuery)
34
34
  * Prototype 1.6.0.3
data/doc/rails.txt ADDED
@@ -0,0 +1,4 @@
1
+ Note that using Scaffolding Extensions with Rails requires that the
2
+ Rails app has the catch-all route (/controller/action/index), at
3
+ least for the controllers in which you are using Scaffolding
4
+ Extensions.
@@ -50,13 +50,13 @@ module ScaffoldingExtensions
50
50
  # Simple button with label text that submits a form to the given url, options are
51
51
  # passed to scaffold_form.
52
52
  def scaffold_button_to(text, url, options={})
53
- "#{scaffold_form(url, options)}\n<input type='submit' value='#{text}' />\n</form>"
53
+ "#{scaffold_form(url, options)}\n<input class=\"btn #{options[:class]}\" type='submit' value='#{text}' />\n</form>"
54
54
  end
55
55
 
56
56
  # Simple button with label text that submits a form via Ajax to the given action,
57
57
  # options are passed to scaffold_form_remote_tag.
58
58
  def scaffold_button_to_remote(text, action, options)
59
- "#{scaffold_form_remote_tag(action, options)}\n<input type='submit' value=#{text} />\n</form>"
59
+ "#{scaffold_form_remote_tag(action, options)}\n<input class=\"btn btn-primary\" type='submit' value=#{text} />\n</form>"
60
60
  end
61
61
 
62
62
  # If scaffolding didn't create the action, return the empty string if blank is true
@@ -163,7 +163,7 @@ module ScaffoldingExtensions
163
163
  soid = so.scaffold_id
164
164
  content = "<div class='habtm_ajax_add_associations' id='#{sn}_habtm_ajax_add_associations'>"
165
165
  klass.scaffold_habtm_associations.reject{|association| !scaffolded_method?("add_#{association}_to_#{sn}")}.each do |association|
166
- content << "#{scaffold_form_remote_tag("add_#{association}_to_#{sn}", :id=>soid)}\n#{scaffold_habtm_ajax_tag("#{sn}_#{association}_id", so, sn, association)}\n<input name='commit' type='submit' value='Add #{klass.scaffold_associated_human_name(association).singularize}' /></form>\n"
166
+ content << "#{scaffold_form_remote_tag("add_#{association}_to_#{sn}", :id=>soid)}\n#{scaffold_habtm_ajax_tag("#{sn}_#{association}_id", so, sn, association)}\n<input name='commit' class=\"btn btn-primary\" type='submit' value='Add #{klass.scaffold_associated_human_name(association).singularize}' /></form>\n"
167
167
  end
168
168
  content << "</div><div class='habtm_ajax_remove_associations' id='#{sn}_habtm_ajax_remove_associations'><ul id='#{sn}_associated_records_list'>"
169
169
  klass.scaffold_habtm_associations.reject{|association| !scaffolded_method?("remove_#{association}_from_#{sn}")}.each do |association|
@@ -269,7 +269,7 @@ module ScaffoldingExtensions
269
269
  #{scaffold_form(scaffold_url("#{action}#{@scaffold_suffix}", options), :attributes=>scaffold_form_enctype(fields))}
270
270
  #{scaffold_model_field_tags(fields)}
271
271
  #{(yield content; content) if block_given?}
272
- <input type='submit' value="#{@scaffold_submit_value || "#{action.capitalize} #{@scaffold_options[:singular_lc_human_name]}"}" />
272
+ <input class='btn btn-primary' type='submit' value="#{@scaffold_submit_value || "#{action.capitalize} #{@scaffold_options[:singular_lc_human_name]}"}" />
273
273
  </form>
274
274
  END
275
275
  end
@@ -180,7 +180,9 @@ module ScaffoldingExtensions
180
180
  if add_methods.include?(:browse)
181
181
  scaffold_define_method("browse#{suffix}") do
182
182
  @page ||= scaffold_request_param(:page).to_i > 1 ? scaffold_request_param(:page).to_i : 1
183
- @next_page, @scaffold_objects = klass.scaffold_browse_find_objects(:session=>scaffold_session, :page=>@page)
183
+ unless @scaffold_objects
184
+ @next_page, @scaffold_objects = klass.scaffold_browse_find_objects(:session=>scaffold_session, :page=>@page)
185
+ end
184
186
  @scaffold_listtable_type = :browse
185
187
  send(render_meth, :listtable)
186
188
  end
@@ -72,7 +72,7 @@ module ScaffoldingExtensions::MetaModel
72
72
  # - :auto_complete: Hash containing the default options to use for the scaffold
73
73
  # autocompleter (iv: @scaffold_auto_complete_options)
74
74
  SCAFFOLD_OPTIONS = {:text_to_string=>false,
75
- :table_classes=>{:form=>'formtable', :list=>'sortable', :show=>'sortable'},
75
+ :table_classes=>{:form=>'table formtable', :list=>'table table-bordered table-condensed sortable', :show=>'table sortable'},
76
76
  :column_type_options=>{},
77
77
  :column_types=>{},
78
78
  :column_options=>{},
@@ -16,7 +16,7 @@
16
16
  <% end %>
17
17
 
18
18
  <br /><br />
19
- <input type='submit' value="Update <%= sn %>'s <%= mpn %>" />
19
+ <input class="btn btn-primary" type='submit' value="Update <%= sn %>'s <%= mpn %>" />
20
20
  </form>
21
21
 
22
22
  <% if '' != (edit_link = scaffold_check_link("Edit #{sn}", true, "edit_#{@scaffold_options[:singular_name]}", :id=>soid)) %>
@@ -1,6 +1,8 @@
1
+ <!DOCTYPE html>
1
2
  <html>
2
3
  <head>
3
4
  <title>Scaffolding Extensions<%= " - #{@scaffold_title}" if @scaffold_title %></title>
5
+ <link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css" />
4
6
  <style type="text/css">
5
7
  body { background-color: #fff; color: #333; }
6
8
 
@@ -10,6 +12,7 @@
10
12
  line-height: 18px;
11
13
  }
12
14
 
15
+ h1, h4 { margin-bottom: 10px; }
13
16
  h4 { font-size: 16px; }
14
17
 
15
18
  pre {
data/scaffolds/list.rhtml CHANGED
@@ -7,7 +7,7 @@
7
7
  <%=scaffold_raw scaffold_select_tag('id', @scaffold_objects) %>
8
8
  <% end %>
9
9
  <br /><br />
10
- <input type="submit" value="<%= haction %> <%= hn %>" />
10
+ <input class="btn btn-<%= scaffold_idempotent_action?(action) ? 'primary' : 'danger' %>" type="submit" value="<%= haction %> <%= hn %>" />
11
11
  </form>
12
12
 
13
13
  <%=scaffold_raw scaffold_manage_link %>
@@ -21,13 +21,13 @@
21
21
  <td><%=h entry.scaffold_value(column).to_s %></td>
22
22
  <% end %>
23
23
  <% if show %>
24
- <td><%=scaffold_raw scaffold_button_to(s, scaffold_url(ss, :id=>eid), :method=>:get) %></td>
24
+ <td><%=scaffold_raw scaffold_button_to(s, scaffold_url(ss, :id=>eid), :method=>:get, :class=>'btn-info') %></td>
25
25
  <% end %>
26
26
  <% if edit %>
27
- <td><%=scaffold_raw scaffold_button_to(e, scaffold_url(es, :id=>eid), :method=>:get) %></td>
27
+ <td><%=scaffold_raw scaffold_button_to(e, scaffold_url(es, :id=>eid), :method=>:get, :class=>'btn-primary') %></td>
28
28
  <% end %>
29
29
  <% if delete %>
30
- <td><%=scaffold_raw scaffold_button_to(d, scaffold_url(ds, :id=>eid)) %></td>
30
+ <td><%=scaffold_raw scaffold_button_to(d, scaffold_url(ds, :id=>eid), :class=>'btn-danger') %></td>
31
31
  <% end %>
32
32
  </tr>
33
33
  <% end %>
@@ -55,10 +55,10 @@
55
55
  <%=scaffold_raw scaffold_field_tag(:hidden, :value=>field, :name=>"null#{scaffold_param_list_suffix}") %>
56
56
  <% end %>
57
57
  <% if @scaffold_search_results_form_params[:page] > 1 %>
58
- <input type="submit" name="page_previous" value="Previous Page" />
58
+ <input class="btn btn-info" type="submit" name="page_previous" value="Previous Page" />
59
59
  <% end %>
60
60
  <% if @scaffold_search_results_form_params[:next_page] %>
61
- <input type="submit" name="page_next" value="Next Page" />
61
+ <input class="btn btn-primary" type="submit" name="page_next" value="Next Page" />
62
62
  <% end %>
63
63
  </form>
64
64
  <% end %>
@@ -17,7 +17,7 @@
17
17
  <% end %>
18
18
  </p>
19
19
 
20
- <input type="submit" value="Merge <%= @scaffold_options[:plural_lc_human_name] %>" />
20
+ <input class="btn btn-danger" type="submit" value="Merge <%= @scaffold_options[:plural_lc_human_name] %>" />
21
21
  </form>
22
22
 
23
23
  <%=scaffold_raw scaffold_manage_link %>
@@ -2,8 +2,8 @@
2
2
 
3
3
  <%=scaffold_raw(scaffold_model_form('results', @scaffold_class.scaffold_fields(:search)) do |form|
4
4
  form << "<table class='#{@scaffold_class.scaffold_table_class(:form)}'><tbody>"
5
- form << "<tr><td><label for='null'>Null Fields</label>:</td><td><select name='null#{scaffold_param_list_suffix}' id='null' multiple='multiple'>#{@scaffold_class.scaffold_search_null_options.collect{|name, i| "<option value='#{i}'>#{name}</option>"}.join("\n")}</select></td></tr>\n"
6
- form << "<tr><td><label for='notnull'>Not Null Fields</label>:</td><td><select name='notnull#{scaffold_param_list_suffix}' id='notnull' multiple='multiple'>#{@scaffold_class.scaffold_search_null_options.collect{|name, i| "<option value='#{i}'>#{name}</option>"}.join("\n")}</select></td></tr>\n"
5
+ form << "<tr><td><label for='null'>Null Fields</label></td><td><select name='null#{scaffold_param_list_suffix}' id='null' multiple='multiple'>#{@scaffold_class.scaffold_search_null_options.collect{|name, i| "<option value='#{i}'>#{name}</option>"}.join("\n")}</select></td></tr>\n"
6
+ form << "<tr><td><label for='notnull'>Not Null Fields</label></td><td><select name='notnull#{scaffold_param_list_suffix}' id='notnull' multiple='multiple'>#{@scaffold_class.scaffold_search_null_options.collect{|name, i| "<option value='#{i}'>#{name}</option>"}.join("\n")}</select></td></tr>\n"
7
7
  form << '</tbody></table>'
8
8
  @scaffold_submit_value = @scaffold_title
9
9
  end)%>
metadata CHANGED
@@ -1,33 +1,22 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: scaffolding_extensions
3
- version: !ruby/object:Gem::Version
4
- hash: 11
5
- prerelease: false
6
- segments:
7
- - 1
8
- - 5
9
- - 4
10
- version: 1.5.4
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.5.5
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Jeremy Evans
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-09-14 00:00:00 -07:00
19
- default_executable:
12
+ date: 2012-04-05 00:00:00.000000000 Z
20
13
  dependencies: []
21
-
22
14
  description:
23
15
  email: code@jeremyevans.net
24
16
  executables: []
25
-
26
17
  extensions: []
27
-
28
18
  extra_rdoc_files: []
29
-
30
- files:
19
+ files:
31
20
  - MIT-LICENSE
32
21
  - README
33
22
  - lib/scaffolding_extensions/model/active_record.rb
@@ -59,6 +48,7 @@ files:
59
48
  - doc/advanced.txt
60
49
  - doc/datamapper.txt
61
50
  - doc/rack.txt
51
+ - doc/rails.txt
62
52
  - contrib/scaffold_associations_tree/README
63
53
  - contrib/scaffold_associations_tree/bullet.gif
64
54
  - contrib/scaffold_associations_tree/minus.gif
@@ -84,16 +74,14 @@ files:
84
74
  - scaffolds/new.rhtml
85
75
  - scaffolds/search.rhtml
86
76
  - scaffolds/edit.rhtml
87
- has_rdoc: true
88
77
  homepage: http://scaffolding-ext.rubyforge.org/
89
78
  licenses: []
90
-
91
79
  post_install_message:
92
- rdoc_options:
80
+ rdoc_options:
93
81
  - --inline-source
94
82
  - --line-numbers
95
83
  - README
96
- - LICENSE
84
+ - MIT-LICENSE
97
85
  - lib
98
86
  - doc/merb.txt
99
87
  - doc/camping.txt
@@ -106,34 +94,25 @@ rdoc_options:
106
94
  - doc/advanced.txt
107
95
  - doc/datamapper.txt
108
96
  - doc/rack.txt
109
- require_paths:
97
+ - doc/rails.txt
98
+ require_paths:
110
99
  - lib
111
- required_ruby_version: !ruby/object:Gem::Requirement
100
+ required_ruby_version: !ruby/object:Gem::Requirement
112
101
  none: false
113
- requirements:
114
- - - ">="
115
- - !ruby/object:Gem::Version
116
- hash: 59
117
- segments:
118
- - 1
119
- - 8
120
- - 6
102
+ requirements:
103
+ - - ! '>='
104
+ - !ruby/object:Gem::Version
121
105
  version: 1.8.6
122
- required_rubygems_version: !ruby/object:Gem::Requirement
106
+ required_rubygems_version: !ruby/object:Gem::Requirement
123
107
  none: false
124
- requirements:
125
- - - ">="
126
- - !ruby/object:Gem::Version
127
- hash: 3
128
- segments:
129
- - 0
130
- version: "0"
108
+ requirements:
109
+ - - ! '>='
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
131
112
  requirements: []
132
-
133
113
  rubyforge_project: scaffolding-ext
134
- rubygems_version: 1.3.7
114
+ rubygems_version: 1.8.11
135
115
  signing_key:
136
116
  specification_version: 3
137
117
  summary: Administrative database front-end for multiple web-frameworks and ORMs
138
118
  test_files: []
139
-