dry_crud 1.7.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. checksums.yaml +15 -0
  2. data/MIT-LICENSE +1 -1
  3. data/README.rdoc +126 -87
  4. data/VERSION +1 -1
  5. data/lib/generators/dry_crud/dry_crud_generator.rb +42 -22
  6. data/lib/generators/dry_crud/templates/INSTALL +5 -5
  7. data/lib/generators/dry_crud/templates/app/assets/stylesheets/crud.scss +0 -20
  8. data/lib/generators/dry_crud/templates/app/assets/stylesheets/sample.scss +24 -4
  9. data/lib/generators/dry_crud/templates/app/controllers/crud/generic_model.rb +89 -0
  10. data/lib/generators/dry_crud/templates/app/controllers/crud/nestable.rb +70 -0
  11. data/lib/generators/dry_crud/templates/app/controllers/crud/rememberable.rb +64 -0
  12. data/lib/generators/dry_crud/templates/app/controllers/crud/render_callbacks.rb +46 -0
  13. data/lib/generators/dry_crud/templates/app/controllers/crud/responder.rb +31 -0
  14. data/lib/generators/dry_crud/templates/app/controllers/crud/searchable.rb +55 -0
  15. data/lib/generators/dry_crud/templates/app/controllers/crud/sortable.rb +63 -0
  16. data/lib/generators/dry_crud/templates/app/controllers/crud_controller.rb +66 -69
  17. data/lib/generators/dry_crud/templates/app/controllers/list_controller.rb +23 -326
  18. data/lib/generators/dry_crud/templates/app/helpers/actions_helper.rb +64 -0
  19. data/lib/generators/dry_crud/templates/app/helpers/crud/form_builder.rb +331 -0
  20. data/lib/generators/dry_crud/templates/app/helpers/crud/table_builder.rb +280 -0
  21. data/lib/generators/dry_crud/templates/app/helpers/form_helper.rb +52 -0
  22. data/lib/generators/dry_crud/templates/app/helpers/format_helper.rb +164 -0
  23. data/lib/generators/dry_crud/templates/app/helpers/i18n_helper.rb +85 -0
  24. data/lib/generators/dry_crud/templates/app/helpers/table_helper.rb +83 -0
  25. data/lib/generators/dry_crud/templates/app/helpers/utility_helper.rb +84 -0
  26. data/lib/generators/dry_crud/templates/app/views/crud/_actions_edit.html.erb +3 -3
  27. data/lib/generators/dry_crud/templates/app/views/crud/_actions_edit.html.haml +3 -3
  28. data/lib/generators/dry_crud/templates/app/views/crud/_actions_index.html.erb +1 -1
  29. data/lib/generators/dry_crud/templates/app/views/crud/_actions_index.html.haml +1 -1
  30. data/lib/generators/dry_crud/templates/app/views/crud/_actions_show.html.erb +3 -3
  31. data/lib/generators/dry_crud/templates/app/views/crud/_actions_show.html.haml +3 -3
  32. data/lib/generators/dry_crud/templates/app/views/crud/_attrs.html.erb +1 -1
  33. data/lib/generators/dry_crud/templates/app/views/crud/_attrs.html.haml +1 -1
  34. data/lib/generators/dry_crud/templates/app/views/crud/_form.html.erb +1 -1
  35. data/lib/generators/dry_crud/templates/app/views/crud/_form.html.haml +1 -1
  36. data/lib/generators/dry_crud/templates/app/views/crud/edit.html.erb +1 -1
  37. data/lib/generators/dry_crud/templates/app/views/crud/edit.html.haml +1 -1
  38. data/lib/generators/dry_crud/templates/app/views/crud/new.html.erb +2 -2
  39. data/lib/generators/dry_crud/templates/app/views/crud/new.html.haml +2 -2
  40. data/lib/generators/dry_crud/templates/app/views/crud/show.html.erb +1 -1
  41. data/lib/generators/dry_crud/templates/app/views/crud/show.html.haml +1 -1
  42. data/lib/generators/dry_crud/templates/app/views/layouts/_flash.html.haml +1 -1
  43. data/lib/generators/dry_crud/templates/app/views/layouts/_nav.html.erb +1 -1
  44. data/lib/generators/dry_crud/templates/app/views/layouts/_nav.html.haml +1 -1
  45. data/lib/generators/dry_crud/templates/app/views/layouts/crud.html.erb +15 -7
  46. data/lib/generators/dry_crud/templates/app/views/layouts/crud.html.haml +18 -8
  47. data/lib/generators/dry_crud/templates/app/views/list/_search.html.erb +3 -3
  48. data/lib/generators/dry_crud/templates/app/views/list/_search.html.haml +3 -3
  49. data/lib/generators/dry_crud/templates/app/views/list/index.html.erb +1 -1
  50. data/lib/generators/dry_crud/templates/app/views/list/index.html.haml +1 -1
  51. data/lib/generators/dry_crud/templates/app/views/shared/_error_messages.html.erb +1 -1
  52. data/lib/generators/dry_crud/templates/app/views/shared/_error_messages.html.haml +1 -1
  53. data/lib/generators/dry_crud/templates/app/views/shared/_labeled.html.erb +2 -4
  54. data/lib/generators/dry_crud/templates/app/views/shared/_labeled.html.haml +2 -3
  55. data/lib/generators/dry_crud/templates/config/initializers/field_error_proc.rb +5 -1
  56. data/lib/generators/dry_crud/templates/config/locales/crud.de.yml +64 -0
  57. data/lib/generators/dry_crud/templates/config/locales/{en_crud.yml → crud.en.yml} +2 -2
  58. data/lib/generators/dry_crud/templates/spec/controllers/crud_test_models_controller_spec.rb +241 -231
  59. data/lib/generators/dry_crud/templates/spec/helpers/crud/form_builder_spec.rb +226 -0
  60. data/lib/generators/dry_crud/templates/spec/helpers/{standard_table_builder_spec.rb → crud/table_builder_spec.rb} +36 -34
  61. data/lib/generators/dry_crud/templates/spec/helpers/form_helper_spec.rb +238 -0
  62. data/lib/generators/dry_crud/templates/spec/helpers/format_helper_spec.rb +244 -0
  63. data/lib/generators/dry_crud/templates/spec/helpers/i18n_helper_spec.rb +132 -0
  64. data/lib/generators/dry_crud/templates/spec/helpers/table_helper_spec.rb +265 -0
  65. data/lib/generators/dry_crud/templates/spec/helpers/utility_helper_spec.rb +74 -0
  66. data/lib/generators/dry_crud/templates/spec/support/crud_controller_examples.rb +185 -100
  67. data/lib/generators/dry_crud/templates/spec/support/crud_controller_test_helper.rb +58 -49
  68. data/lib/generators/dry_crud/templates/test/{functional → controllers}/crud_test_models_controller_test.rb +112 -91
  69. data/lib/generators/dry_crud/templates/test/{unit/helpers/standard_form_builder_test.rb → helpers/crud/form_builder_test.rb} +79 -62
  70. data/lib/generators/dry_crud/templates/test/{unit/helpers/standard_table_builder_test.rb → helpers/crud/table_builder_test.rb} +31 -28
  71. data/lib/generators/dry_crud/templates/test/helpers/custom_assertions_test.rb +85 -0
  72. data/lib/generators/dry_crud/templates/test/helpers/form_helper_test.rb +129 -0
  73. data/lib/generators/dry_crud/templates/test/helpers/format_helper_test.rb +163 -0
  74. data/lib/generators/dry_crud/templates/test/helpers/i18n_helper_test.rb +79 -0
  75. data/lib/generators/dry_crud/templates/test/helpers/table_helper_test.rb +217 -0
  76. data/lib/generators/dry_crud/templates/test/helpers/utility_helper_test.rb +63 -0
  77. data/lib/generators/dry_crud/templates/test/{functional → support}/crud_controller_test_helper.rb +70 -59
  78. data/lib/generators/dry_crud/templates/test/{crud_test_model.rb → support/crud_test_model.rb} +107 -75
  79. data/lib/generators/dry_crud/templates/test/support/custom_assertions.rb +83 -0
  80. metadata +83 -146
  81. data/Rakefile +0 -211
  82. data/lib/generators/dry_crud/templates/app/helpers/crud_helper.rb +0 -168
  83. data/lib/generators/dry_crud/templates/app/helpers/list_helper.rb +0 -27
  84. data/lib/generators/dry_crud/templates/app/helpers/standard_form_builder.rb +0 -261
  85. data/lib/generators/dry_crud/templates/app/helpers/standard_helper.rb +0 -304
  86. data/lib/generators/dry_crud/templates/app/helpers/standard_table_builder.rb +0 -178
  87. data/lib/generators/dry_crud/templates/spec/helpers/crud_helper_spec.rb +0 -146
  88. data/lib/generators/dry_crud/templates/spec/helpers/list_helper_spec.rb +0 -154
  89. data/lib/generators/dry_crud/templates/spec/helpers/standard_form_builder_spec.rb +0 -215
  90. data/lib/generators/dry_crud/templates/spec/helpers/standard_helper_spec.rb +0 -387
  91. data/lib/generators/dry_crud/templates/test/custom_assertions.rb +0 -78
  92. data/lib/generators/dry_crud/templates/test/unit/custom_assertions_test.rb +0 -117
  93. data/lib/generators/dry_crud/templates/test/unit/helpers/crud_helper_test.rb +0 -111
  94. data/lib/generators/dry_crud/templates/test/unit/helpers/list_helper_test.rb +0 -123
  95. data/lib/generators/dry_crud/templates/test/unit/helpers/standard_helper_test.rb +0 -281
  96. data/test/templates/Gemfile +0 -46
  97. data/test/templates/app/controllers/admin/cities_controller.rb +0 -7
  98. data/test/templates/app/controllers/admin/countries_controller.rb +0 -13
  99. data/test/templates/app/controllers/ajax_controller.rb +0 -9
  100. data/test/templates/app/controllers/people_controller.rb +0 -13
  101. data/test/templates/app/controllers/vips_controller.rb +0 -19
  102. data/test/templates/app/helpers/cities_helper.rb +0 -9
  103. data/test/templates/app/helpers/people_helper.rb +0 -8
  104. data/test/templates/app/models/city.rb +0 -28
  105. data/test/templates/app/models/country.rb +0 -16
  106. data/test/templates/app/models/person.rb +0 -12
  107. data/test/templates/app/views/admin/cities/_actions_index.html.erb +0 -2
  108. data/test/templates/app/views/admin/cities/_actions_index.html.haml +0 -2
  109. data/test/templates/app/views/admin/cities/_attrs.html.erb +0 -1
  110. data/test/templates/app/views/admin/cities/_attrs.html.haml +0 -1
  111. data/test/templates/app/views/admin/cities/_form.html.erb +0 -7
  112. data/test/templates/app/views/admin/cities/_form.html.haml +0 -5
  113. data/test/templates/app/views/admin/cities/_hello.html.erb +0 -1
  114. data/test/templates/app/views/admin/cities/_hello.html.haml +0 -1
  115. data/test/templates/app/views/admin/cities/_list.html.erb +0 -3
  116. data/test/templates/app/views/admin/cities/_list.html.haml +0 -3
  117. data/test/templates/app/views/admin/countries/_list.html.erb +0 -4
  118. data/test/templates/app/views/admin/countries/_list.html.haml +0 -3
  119. data/test/templates/app/views/ajax/_actions_index.html.erb +0 -8
  120. data/test/templates/app/views/ajax/_actions_index.html.haml +0 -8
  121. data/test/templates/app/views/ajax/_actions_show.html.erb +0 -4
  122. data/test/templates/app/views/ajax/_actions_show.html.haml +0 -4
  123. data/test/templates/app/views/ajax/_form.html.erb +0 -2
  124. data/test/templates/app/views/ajax/_form.html.haml +0 -2
  125. data/test/templates/app/views/ajax/_hello.html.erb +0 -1
  126. data/test/templates/app/views/ajax/_hello.html.haml +0 -1
  127. data/test/templates/app/views/ajax/ajax.js.erb +0 -1
  128. data/test/templates/app/views/ajax/ajax.js.haml +0 -1
  129. data/test/templates/app/views/ajax/edit.js.erb +0 -1
  130. data/test/templates/app/views/ajax/edit.js.haml +0 -1
  131. data/test/templates/app/views/ajax/show.js.erb +0 -1
  132. data/test/templates/app/views/ajax/show.js.haml +0 -1
  133. data/test/templates/app/views/ajax/update.js.erb +0 -5
  134. data/test/templates/app/views/ajax/update.js.haml +0 -5
  135. data/test/templates/app/views/layouts/_nav.html.erb +0 -6
  136. data/test/templates/app/views/layouts/_nav.html.haml +0 -5
  137. data/test/templates/app/views/layouts/bootstrap.html.erb +0 -68
  138. data/test/templates/app/views/layouts/bootstrap.html.haml +0 -49
  139. data/test/templates/app/views/people/_attrs.html.erb +0 -5
  140. data/test/templates/app/views/people/_attrs.html.haml +0 -4
  141. data/test/templates/app/views/people/_list.html.erb +0 -1
  142. data/test/templates/app/views/people/_list.html.haml +0 -1
  143. data/test/templates/config/database.yml +0 -21
  144. data/test/templates/config/locales/en_cities.yml +0 -56
  145. data/test/templates/config/routes.rb +0 -32
  146. data/test/templates/db/migrate/20100511174904_create_people_and_cities.rb +0 -26
  147. data/test/templates/db/seeds.rb +0 -74
  148. data/test/templates/spec/controllers/admin/cities_controller_spec.rb +0 -74
  149. data/test/templates/spec/controllers/admin/countries_controller_spec.rb +0 -56
  150. data/test/templates/spec/controllers/people_controller_spec.rb +0 -80
  151. data/test/templates/spec/routing/cities_routing_spec.rb +0 -11
  152. data/test/templates/spec/routing/countries_routing_spec.rb +0 -11
  153. data/test/templates/test/fixtures/cities.yml +0 -11
  154. data/test/templates/test/fixtures/countries.yml +0 -11
  155. data/test/templates/test/fixtures/people.yml +0 -14
  156. data/test/templates/test/functional/admin/cities_controller_test.rb +0 -59
  157. data/test/templates/test/functional/admin/countries_controller_test.rb +0 -42
  158. data/test/templates/test/functional/people_controller_test.rb +0 -68
@@ -1,46 +0,0 @@
1
- source 'http://rubygems.org'
2
-
3
- gem 'rails', '>= 3.2'
4
-
5
- # Bundle edge Rails instead:
6
- # gem 'rails', :git => 'git://github.com/rails/rails.git'
7
-
8
- gem 'sqlite3', :platforms => :ruby
9
-
10
- platforms :jruby do
11
- gem 'jdbc-sqlite3'
12
- gem 'activerecord-jdbcsqlite3-adapter'
13
- end
14
-
15
- gem 'json'
16
-
17
- gem 'haml'
18
-
19
- gem 'kaminari'
20
-
21
- gem 'rspec-rails'
22
-
23
- # Gems used only for assets and not required
24
- # in production environments by default.
25
- group :assets do
26
- gem 'sass-rails' #, '~> 3.2.3'
27
- gem 'coffee-rails' #, '~> 3.2.1'
28
- gem 'uglifier' #, '>= 1.0.3'
29
- gem 'bootstrap-sass-rails'
30
- gem 'therubyracer', :require => RUBY_PLATFORM.include?('linux') && 'v8'
31
- end
32
-
33
- gem 'jquery-rails'
34
-
35
- # To use ActiveModel has_secure_password
36
- # gem 'bcrypt-ruby', '~> 3.0.0'
37
-
38
- # Use unicorn as the web server
39
- # gem 'unicorn'
40
-
41
- # Deploy with Capistrano
42
- # gem 'capistrano'
43
-
44
- # To use debugger
45
- # gem 'ruby-debug'
46
- # gem 'ruby-debug19', :require => 'ruby-debug'
@@ -1,7 +0,0 @@
1
- class Admin::CitiesController < AjaxController
2
-
3
- self.nesting = :admin, Country
4
-
5
- self.search_columns = :name, 'countries.name'
6
-
7
- end
@@ -1,13 +0,0 @@
1
- class Admin::CountriesController < AjaxController
2
-
3
- self.nesting = :admin
4
-
5
- self.search_columns = :name, :code
6
-
7
- def show
8
- super do |format|
9
- format.html { redirect_to index_url, flash.to_hash }
10
- end
11
- end
12
-
13
- end
@@ -1,9 +0,0 @@
1
- class AjaxController < CrudController
2
-
3
- respond_to :html, :json, :js
4
-
5
- def ajax
6
-
7
- end
8
-
9
- end
@@ -1,13 +0,0 @@
1
- class PeopleController < AjaxController
2
-
3
- self.search_columns = [:name, :children, :rating, :income, :birthdate, :remarks, 'cities.name']
4
-
5
- self.sort_mappings = {:city_id => 'cities.name'}
6
-
7
- private
8
-
9
- def list_entries
10
- super.includes(:city => :country).order('people.name, countries.code, cities.name')
11
- end
12
-
13
- end
@@ -1,19 +0,0 @@
1
- class VipsController < ListController
2
-
3
- self.search_columns = [:name, :children, :rating, :remarks, 'cities.name']
4
-
5
- self.sort_mappings = {:city_id => 'cities.name'}
6
-
7
- private
8
-
9
- class << self
10
- def model_class
11
- Person
12
- end
13
- end
14
-
15
- def list_entries
16
- super.where('rating > 5').includes(:city => :country).order('people.name, countries.code, cities.name')
17
- end
18
-
19
- end
@@ -1,9 +0,0 @@
1
- module CitiesHelper
2
- def format_city_id(entry)
3
- if city = entry.city
4
- link_to city, admin_country_city_path(city.country, city)
5
- else
6
- ta(:no_entry)
7
- end
8
- end
9
- end
@@ -1,8 +0,0 @@
1
- module PeopleHelper
2
-
3
- def format_person_income(person)
4
- income = person.income
5
- income.present? ? "#{f(income)} $" : StandardHelper::EMPTY_STRING
6
- end
7
-
8
- end
@@ -1,28 +0,0 @@
1
- class City < ActiveRecord::Base
2
-
3
- attr_protected nil
4
-
5
- belongs_to :country
6
- has_many :people
7
-
8
- validates :name, :presence => true
9
- validates :country, :presence => true
10
-
11
- before_destroy :protect_with_inhabitants
12
-
13
- default_scope includes(:country).order('countries.code, cities.name')
14
-
15
- def to_s
16
- "#{name} (#{country.code})"
17
- end
18
-
19
- private
20
-
21
- def protect_with_inhabitants
22
- if people.exists?
23
- errors.add(:base, :protect_with_inhabitants)
24
- false
25
- end
26
- end
27
-
28
- end
@@ -1,16 +0,0 @@
1
- class Country < ActiveRecord::Base
2
-
3
- attr_protected nil
4
-
5
- has_many :cities, :dependent => :destroy
6
-
7
- validates :name, :presence => true
8
- validates :code, :presence => true
9
-
10
- default_scope order('countries.name')
11
-
12
- def to_s
13
- name
14
- end
15
-
16
- end
@@ -1,12 +0,0 @@
1
- class Person < ActiveRecord::Base
2
-
3
- attr_protected nil
4
-
5
- belongs_to :city
6
-
7
- validates :name, :presence => true
8
-
9
- def to_s
10
- name
11
- end
12
- end
@@ -1,2 +0,0 @@
1
- <%= link_action_add %>
2
- <%= link_action_index admin_country_path(parent) %>
@@ -1,2 +0,0 @@
1
- = link_action_add
2
- = link_action_index admin_country_path(parent)
@@ -1 +0,0 @@
1
- <%= render_attrs @city, :people %>
@@ -1 +0,0 @@
1
- = render_attrs entry, :people
@@ -1,7 +0,0 @@
1
- <% remote ||= false %>
2
- <%= entry_form :remote => remote do |f| %>
3
- <%= f.labeled(:name, 'Called') do %>
4
- <%= f.input_field :name %>
5
- <% end %>
6
- <%= f.labeled_input_field :person_ids %>
7
- <% end %>
@@ -1,5 +0,0 @@
1
- - remote ||= false
2
- = entry_form :remote => remote do |f|
3
- = f.labeled(:name, 'Called') do
4
- = f.input_field :name
5
- = f.labeled_input_field :person_ids
@@ -1 +0,0 @@
1
- hello from cities
@@ -1 +0,0 @@
1
- hello from cities
@@ -1,3 +0,0 @@
1
- <% @title = ti(:country_title, :country => @parents.last) -%>
2
-
3
- <%= render 'crud/list' %>
@@ -1,3 +0,0 @@
1
- - @title = ti(:country_title, :country => @parents.last)
2
-
3
- = render 'crud/list'
@@ -1,4 +0,0 @@
1
- <%= crud_table do |t|
2
- col_show(t, :name) {|e| admin_country_cities_path(e) }
3
- t.sortable_attr(:code)
4
- end %>
@@ -1,3 +0,0 @@
1
- = crud_table do |t|
2
- - col_show(t, :name) {|e| admin_country_cities_path(e) }
3
- - t.sortable_attr(:code)
@@ -1,8 +0,0 @@
1
- <%= render :partial => 'crud/actions_index' %>
2
-
3
- <%= link_action ti(:'link.ajax'), nil, {:action => 'ajax'}, :method => :get, :remote => true %>
4
- <div id="response"></div>
5
-
6
- <% content_for :javascripts do %>
7
- var sayHello = function() { alert('Hello'); };
8
- <% end %>
@@ -1,8 +0,0 @@
1
- = render 'crud/actions_index'
2
-
3
- = link_action ti(:'link.ajax'), nil, {:action => 'ajax'}, :method => :get, :remote => true
4
-
5
- #response
6
-
7
- - content_for :javascripts do
8
- var sayHello = function() { alert('Hello'); };
@@ -1,4 +0,0 @@
1
- <%= link_action_index %>
2
- <%= link_action_edit %>
3
- <%= link_action ti(:"link.edit") + ' AJAX', 'pencil', edit_polymorphic_path(path_args(entry), :format => :js), :remote => true %>
4
- <%= link_action_destroy %>
@@ -1,4 +0,0 @@
1
- = link_action_index
2
- = link_action_edit
3
- = link_action ti(:"link.edit") + ' AJAX', 'pencil', edit_polymorphic_path(path_args(entry), :format => :js), :remote => true
4
- = link_action_destroy
@@ -1,2 +0,0 @@
1
- <% remote ||= false %>
2
- <%= entry_form :remote => remote %>
@@ -1,2 +0,0 @@
1
- - remote ||= false
2
- = entry_form :remote => remote
@@ -1 +0,0 @@
1
- hello from ajax
@@ -1 +0,0 @@
1
- hello from ajax
@@ -1 +0,0 @@
1
- $('#response').html("<%= escape_javascript(render 'hello') %>");
@@ -1 +0,0 @@
1
- $('#response').html("#{escape_javascript(render 'hello')}");
@@ -1 +0,0 @@
1
- $('#content').html('<%= escape_javascript(render 'form', :remote => true) %>');
@@ -1 +0,0 @@
1
- $('#content').html('#{escape_javascript(render 'form', :remote => true)}');
@@ -1 +0,0 @@
1
- $('#content').html('<%= escape_javascript(render 'attrs') %>');
@@ -1 +0,0 @@
1
- $('#content').html('#{escape_javascript(render 'attrs')}');
@@ -1,5 +0,0 @@
1
- <% if entry.errors.present? %>
2
- alert('<%= escape_javascript(entry.errors.full_messages.join("\n")) %>');
3
- <% else %>
4
- $('#content').html('<%= escape_javascript(render 'attrs') %>')
5
- <% end %>
@@ -1,5 +0,0 @@
1
- - if entry.errors.present?
2
- alert('#{escape_javascript(entry.errors.full_messages.join("\n"))}');
3
- - else
4
- $('#content').html('#{escape_javascript(render 'attrs')}')
5
-
@@ -1,6 +0,0 @@
1
- <%= link_to 'MyApp', root_path, :class => 'brand' %>
2
- <ul class="nav">
3
- <li><%= link_to t(:'global.menu.people'), people_path %></li>
4
- <li><%= link_to t(:'global.menu.countries'), admin_countries_path %></li>
5
- <li><%= link_to t(:'global.menu.vips'), vips_path %></li>
6
- </ul>
@@ -1,5 +0,0 @@
1
- = link_to 'MyApp', root_path, :class => 'brand'
2
- %ul.nav
3
- %li= link_to t(:'global.menu.people'), people_path
4
- %li= link_to t(:'global.menu.countries'), admin_countries_path
5
- %li= link_to t(:'global.menu.vips'), vips_path
@@ -1,68 +0,0 @@
1
- <!DOCTYPE html>
2
-
3
- <html lang="en">
4
- <head>
5
- <meta charset="utf-8" />
6
- <title><%= strip_tags(@title) %></title>
7
- <%= csrf_meta_tag %>
8
-
9
- <!-- HTML5 shim, for IE6-8 support of HTML elements -->
10
- <!--[if lt IE 9]>
11
- <script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
12
- <![endif]-->
13
-
14
- <%= stylesheet_link_tag 'application', :media => 'all' %>
15
- <style type="text/css">
16
- body { padding-top: 70px; }
17
- h1 { margin-bottom: 10px; }
18
- </style>
19
-
20
- <!-- fav and touch icons -->
21
- <link href="images/favicon.ico" rel="shortcut icon">
22
- <link href="images/apple-touch-icon.png" rel="apple-touch-icon">
23
- <link href="images/apple-touch-icon-72x72.png" rel="apple-touch-icon" sizes="72x72">
24
- <link href="images/apple-touch-icon-114x114.png" rel="apple-touch-icon" sizes="114x114">
25
-
26
- <%= yield :head %>
27
- </head>
28
- <body>
29
-
30
- <div class="navbar navbar-fixed-top">
31
- <div class="navbar-inner">
32
- <div class="container">
33
- <%= render 'layouts/nav' %>
34
- </div>
35
- </div>
36
- </div>
37
-
38
- <div class="container">
39
-
40
- <h1><%= @title %></h1>
41
-
42
- <%= render :partial => 'layouts/flash', :collection => [:notice, :alert], :as => :level %>
43
-
44
- <div class="actions btn-toolbar">
45
- <div class="pull-right">
46
- <%= yield :actions %>
47
- </div>
48
- <div class="pull-left">
49
- <%= yield :tools %>
50
- </div>
51
- </div>
52
-
53
- <div id="content">
54
- <%= yield %>
55
- </div>
56
-
57
- <footer>
58
- <p>&copy; code!z <%= Time.zone.now.year %></p>
59
- </footer>
60
-
61
- </div>
62
-
63
- <!-- Javascript placed at the end of the document so the pages load faster -->
64
- <%= javascript_include_tag 'application' %>
65
- <%= javascript_tag yield(:javascripts) if content_for?(:javascripts) %>
66
-
67
- </body>
68
- </html>
@@ -1,49 +0,0 @@
1
- !!! 5
2
-
3
- %html
4
- %head
5
- %meta{:charset => 'utf-8'}
6
- %title= strip_tags(@title)
7
- = csrf_meta_tag
8
-
9
- <!-- HTML5 shim, for IE6-8 support of HTML elements -->
10
- <!--[if lt IE 9]>
11
- <script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
12
- <![endif]-->
13
-
14
- = stylesheet_link_tag 'application', :media => 'all'
15
- %style{:type => "text/css"}
16
- body { padding-top: 70px; }
17
- h1 { margin-bottom: 10px; }
18
-
19
- %link{:href => "images/favicon.ico", :rel => "shortcut icon"}
20
- %link{:href => "images/apple-touch-icon.png", :rel => "apple-touch-icon"}
21
- %link{:href => "images/apple-touch-icon-72x72.png", :rel => "apple-touch-icon", :sizes => "72x72"}
22
- %link{:href => "images/apple-touch-icon-114x114.png", :rel => "apple-touch-icon", :sizes => "114x114"}
23
-
24
- = yield :head
25
-
26
- %body
27
-
28
- .navbar.navbar-fixed-top
29
- .navbar-inner
30
- .container= render 'layouts/nav'
31
-
32
- .container
33
-
34
- %h1= @title
35
-
36
- = render :partial => 'layouts/flash', :collection => [:notice, :alert], :as => :level
37
-
38
- .actions.btn-toolbar
39
- .pull-right= yield :actions
40
- .pull-left= yield :tools
41
-
42
- #content= yield
43
-
44
- %footer
45
- %p
46
- &copy; code!z #{Time.zone.now.year}
47
-
48
- = javascript_include_tag 'application'
49
- = javascript_tag yield(:javascripts) if content_for?(:javascripts)