bootstrap-sass-extras 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +7 -0
- data/.rspec +1 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +107 -0
- data/MIT-LICENSE +20 -0
- data/README.md +86 -0
- data/Rakefile +1 -0
- data/app/helpers/bootstrap_flash_helper.rb +17 -0
- data/bootstrap-sass-extras.gemspec +23 -0
- data/lib/.DS_Store +0 -0
- data/lib/bootstrap-sass-extras.rb +3 -0
- data/lib/bootstrap-sass-extras/engine.rb +9 -0
- data/lib/bootstrap-sass-extras/version.rb +3 -0
- data/lib/generators/.DS_Store +0 -0
- data/lib/generators/bootstrap/install/install_generator.rb +21 -0
- data/lib/generators/bootstrap/install/templates/.DS_Store +0 -0
- data/lib/generators/bootstrap/install/templates/en.bootstrap.yml +17 -0
- data/lib/generators/bootstrap/layout/layout_generator.rb +23 -0
- data/lib/generators/bootstrap/layout/templates/layout.html.erb +109 -0
- data/lib/generators/bootstrap/layout/templates/layout.html.haml +69 -0
- data/lib/generators/bootstrap/layout/templates/layout.html.slim +69 -0
- data/lib/generators/bootstrap/partial/partial_generator.rb +20 -0
- data/lib/generators/bootstrap/partial/templates/_login.html.erb +29 -0
- data/lib/generators/bootstrap/partial/templates/_navbar.html.erb +13 -0
- data/lib/generators/bootstrap/themed/templates/_form.html.erb +16 -0
- data/lib/generators/bootstrap/themed/templates/_form.html.haml +10 -0
- data/lib/generators/bootstrap/themed/templates/_form.html.slim +11 -0
- data/lib/generators/bootstrap/themed/templates/edit.html.erb +5 -0
- data/lib/generators/bootstrap/themed/templates/edit.html.haml +4 -0
- data/lib/generators/bootstrap/themed/templates/edit.html.slim +4 -0
- data/lib/generators/bootstrap/themed/templates/index.html.erb +40 -0
- data/lib/generators/bootstrap/themed/templates/index.html.haml +25 -0
- data/lib/generators/bootstrap/themed/templates/index.html.slim +27 -0
- data/lib/generators/bootstrap/themed/templates/new.html.erb +5 -0
- data/lib/generators/bootstrap/themed/templates/new.html.haml +4 -0
- data/lib/generators/bootstrap/themed/templates/new.html.slim +4 -0
- data/lib/generators/bootstrap/themed/templates/show.html.erb +23 -0
- data/lib/generators/bootstrap/themed/templates/show.html.haml +15 -0
- data/lib/generators/bootstrap/themed/templates/show.html.slim +17 -0
- data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.erb +14 -0
- data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.haml +11 -0
- data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.slim +12 -0
- data/lib/generators/bootstrap/themed/themed_generator.rb +148 -0
- data/script/rails +8 -0
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/mailers/.gitkeep +0 -0
- data/spec/dummy/app/models/.gitkeep +0 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +65 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +58 -0
- data/spec/dummy/lib/assets/.gitkeep +0 -0
- data/spec/dummy/log/.gitkeep +0 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/helpers/bootstrap_flash_helper_spec.rb +17 -0
- data/spec/spec_helper.rb +9 -0
- metadata +211 -0
@@ -0,0 +1,69 @@
|
|
1
|
+
!!! 5
|
2
|
+
%html(lang="en")
|
3
|
+
%head
|
4
|
+
%meta(charset="utf-8")
|
5
|
+
%meta(http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1")
|
6
|
+
%meta(name="viewport" content="width=device-width, initial-scale=1.0")
|
7
|
+
%title= content_for?(:title) ? yield(:title) : "<%= app_name %>"
|
8
|
+
= csrf_meta_tags
|
9
|
+
/ Le HTML5 shim, for IE6-8 support of HTML elements
|
10
|
+
/[if lt IE 9]
|
11
|
+
= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js"
|
12
|
+
= stylesheet_link_tag "application", :media => "all"
|
13
|
+
%link(href="images/apple-touch-icon-144x144.png" rel="apple-touch-icon-precomposed" sizes="144x144")
|
14
|
+
%link(href="images/apple-touch-icon-114x114.png" rel="apple-touch-icon-precomposed" sizes="114x114")
|
15
|
+
%link(href="images/apple-touch-icon-72x72.png" rel="apple-touch-icon-precomposed" sizes="72x72")
|
16
|
+
%link(href="images/apple-touch-icon.png" rel="apple-touch-icon-precomposed")
|
17
|
+
%link(href="favicon.ico" rel="shortcut icon")
|
18
|
+
|
19
|
+
|
20
|
+
%body
|
21
|
+
.navbar.navbar-<%= layout_type %>-top
|
22
|
+
.navbar-inner
|
23
|
+
.<%= container_class %>
|
24
|
+
%a.btn.btn-navbar(data-target=".nav-collapse" data-toggle="collapse")
|
25
|
+
%span.icon-bar
|
26
|
+
%span.icon-bar
|
27
|
+
%span.icon-bar
|
28
|
+
%a.brand(href="#") <%= app_name %>
|
29
|
+
.container.nav-collapse
|
30
|
+
%ul.nav
|
31
|
+
%li= link_to "Link 1", "/path1"
|
32
|
+
%li= link_to "Link 2", "/path2"
|
33
|
+
%li= link_to "Link 3", "/path3"
|
34
|
+
|
35
|
+
.<%= container_class %>
|
36
|
+
<%- if layout_type == "fluid" -%>
|
37
|
+
|
38
|
+
.row-fluid
|
39
|
+
.span3
|
40
|
+
.well.sidebar-nav
|
41
|
+
%ul.nav.nav-list
|
42
|
+
%li.nav-header Sidebar
|
43
|
+
%li= link_to "Link 1", "/path1"
|
44
|
+
%li= link_to "Link 2", "/path2"
|
45
|
+
%li= link_to "Link 3", "/path3"
|
46
|
+
.span9
|
47
|
+
= bootstrap_flash
|
48
|
+
= yield
|
49
|
+
<% else %>
|
50
|
+
.row
|
51
|
+
.span9
|
52
|
+
= bootstrap_flash
|
53
|
+
= yield
|
54
|
+
.span3
|
55
|
+
.well.sidebar-nav
|
56
|
+
%h3 Sidebar
|
57
|
+
%ul.nav.nav-list
|
58
|
+
%li.nav-header Sidebar
|
59
|
+
%li= link_to "Link 1", "/path1"
|
60
|
+
%li= link_to "Link 2", "/path2"
|
61
|
+
%li= link_to "Link 3", "/path3"
|
62
|
+
<% end %>
|
63
|
+
%footer
|
64
|
+
%p © Company 2013
|
65
|
+
/
|
66
|
+
Javascripts
|
67
|
+
\==================================================
|
68
|
+
/ Placed at the end of the document so the pages load faster
|
69
|
+
= javascript_include_tag "application"
|
@@ -0,0 +1,69 @@
|
|
1
|
+
doctype html
|
2
|
+
html lang="en"
|
3
|
+
head
|
4
|
+
meta charset="utf-8"
|
5
|
+
meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"
|
6
|
+
meta name="viewport" content="width=device-width, initial-scale=1.0"
|
7
|
+
title= content_for?(:title) ? yield(:title) : "<%= app_name %>"
|
8
|
+
= csrf_meta_tags
|
9
|
+
|
10
|
+
/! Le HTML5 shim, for IE6-8 support of HTML elements
|
11
|
+
/[if lt IE 9]
|
12
|
+
= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js"
|
13
|
+
= stylesheet_link_tag "application", :media => "all"
|
14
|
+
link href="images/apple-touch-icon-144x144.png" rel="apple-touch-icon-precomposed" sizes="144x144"
|
15
|
+
link href="images/apple-touch-icon-114x114.png" rel="apple-touch-icon-precomposed" sizes="114x114"
|
16
|
+
link href="images/apple-touch-icon-72x72.png" rel="apple-touch-icon-precomposed" sizes="72x72"
|
17
|
+
link href="images/apple-touch-icon.png" rel="apple-touch-icon-precomposed"
|
18
|
+
link href="favicon.ico" rel="shortcut icon"
|
19
|
+
|
20
|
+
body
|
21
|
+
.navbar.navbar-<%= layout_type %>-top
|
22
|
+
.navbar-inner
|
23
|
+
.<%= container_class %>
|
24
|
+
a.btn.btn-navbar data-target=".nav-collapse" data-toggle="collapse"
|
25
|
+
span.icon-bar
|
26
|
+
span.icon-bar
|
27
|
+
span.icon-bar
|
28
|
+
a.brand href="#"<%= app_name %>
|
29
|
+
.<%=container_class%>.nav-collapse
|
30
|
+
ul.nav
|
31
|
+
li= link_to "Link 1", "/path1"
|
32
|
+
li= link_to "Link 2", "/path2"
|
33
|
+
li= link_to "Link 3", "/path3"
|
34
|
+
|
35
|
+
.<%= container_class %>
|
36
|
+
<%- if layout_type == "fluid" -%>
|
37
|
+
|
38
|
+
.row-fluid
|
39
|
+
.span3
|
40
|
+
.well.sidebar-nav
|
41
|
+
ul.nav.nav-list
|
42
|
+
li.nav-header Sidebar
|
43
|
+
li= link_to "Link 1", "/path1"
|
44
|
+
li= link_to "Link 2", "/path2"
|
45
|
+
li= link_to "Link 3", "/path3"
|
46
|
+
.span9
|
47
|
+
= bootstrap_flash
|
48
|
+
= yield
|
49
|
+
<% else %>
|
50
|
+
.row
|
51
|
+
.span9
|
52
|
+
= bootstrap_flash
|
53
|
+
= yield
|
54
|
+
.span3
|
55
|
+
.well.sidebar-nav
|
56
|
+
h3 Sidebar
|
57
|
+
ul.nav.nav-list
|
58
|
+
li.nav-header Sidebar
|
59
|
+
li= link_to "Link 1", "/path1"
|
60
|
+
li= link_to "Link 2", "/path2"
|
61
|
+
li= link_to "Link 3", "/path3"
|
62
|
+
<% end %>
|
63
|
+
footer
|
64
|
+
p © Company 2013
|
65
|
+
/!
|
66
|
+
Javascripts
|
67
|
+
\==================================================
|
68
|
+
/! Placed at the end of the document so the pages load faster
|
69
|
+
= javascript_include_tag "application"
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
module Bootstrap
|
4
|
+
module Generators
|
5
|
+
class PartialGenerator < ::Rails::Generators::Base
|
6
|
+
source_root File.expand_path("../templates", __FILE__)
|
7
|
+
desc "This generator generates bootstrap HTML partials"
|
8
|
+
argument :component_name, :type => :string, :default => "application",
|
9
|
+
:banner => "navbar, navbar-devise, carousel"
|
10
|
+
|
11
|
+
attr_reader :app_name
|
12
|
+
|
13
|
+
def generate_partial
|
14
|
+
app = ::Rails.application
|
15
|
+
ext = app.config.generators.options[:rails][:template_engine] || :erb
|
16
|
+
copy_file "_#{component_name}.html.#{ext}", "app/views/shared/_#{component_name}.html.#{ext}"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<h2>Sign in</h2>
|
2
|
+
|
3
|
+
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :class => 'form-horizontal' }) do |f| %>
|
4
|
+
<div class="control-group">
|
5
|
+
<%= f.label :email, :class => 'control-label' %>
|
6
|
+
<div class="controls">
|
7
|
+
<%= f.email_field :email %>
|
8
|
+
</div>
|
9
|
+
</div>
|
10
|
+
<div class="control-group">
|
11
|
+
<%= f.label :password, :class => 'control-label' %>
|
12
|
+
<div class="controls">
|
13
|
+
<%= f.password_field :password %>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<% if devise_mapping.rememberable? -%>
|
18
|
+
<div class='control-group' >
|
19
|
+
<%= f.label :remember_me, :class => 'control-label' %>
|
20
|
+
<%= f.check_box :remember_me %>
|
21
|
+
</div>
|
22
|
+
<% end -%>
|
23
|
+
|
24
|
+
<div class="form-actions">
|
25
|
+
<%= f.submit "Sign in", :class => 'btn' %>
|
26
|
+
</div>
|
27
|
+
<% end %>
|
28
|
+
|
29
|
+
<%= render :partial => "devise/shared/links" %>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<%%= form_for @<%= resource_name %>, :html => { :class => 'form-horizontal' } do |f| %>
|
2
|
+
<%- columns.each do |column| -%>
|
3
|
+
<div class="control-group">
|
4
|
+
<%%= f.label :<%= column.name %>, :class => 'control-label' %>
|
5
|
+
<div class="controls">
|
6
|
+
<%%= f.<%= column.field_type %> :<%= column.name %>, :class => '<%= column.field_type %>' %>
|
7
|
+
</div>
|
8
|
+
</div>
|
9
|
+
<%- end -%>
|
10
|
+
|
11
|
+
<div class="form-actions">
|
12
|
+
<%%= f.submit nil, :class => 'btn btn-primary' %>
|
13
|
+
<%%= link_to t('.cancel', :default => t("helpers.links.cancel")),
|
14
|
+
<%= controller_routing_path %>_path, :class => 'btn' %>
|
15
|
+
</div>
|
16
|
+
<%% end %>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
= form_for @<%= resource_name %>, :html => { :class => 'form-horizontal' } do |f|
|
2
|
+
<%- columns.each do |column| -%>
|
3
|
+
.control-group
|
4
|
+
= f.label :<%= column.name %>, :class => 'control-label'
|
5
|
+
.controls
|
6
|
+
= f.<%= column.field_type %> :<%= column.name %>, :class => '<%= column.field_type %>'
|
7
|
+
<%- end -%>
|
8
|
+
.form-actions
|
9
|
+
= f.submit nil, :class => 'btn btn-primary'
|
10
|
+
= link_to t('.cancel', :default => t("helpers.links.cancel")), <%= controller_routing_path %>_path, :class => 'btn'
|
@@ -0,0 +1,11 @@
|
|
1
|
+
= form_for @<%= resource_name %>, :html => { :class => "form-horizontal" } do |f|
|
2
|
+
<%- columns.each do |column| -%>
|
3
|
+
.control-group
|
4
|
+
= f.label :<%= column.name %>, :class => 'control-label'
|
5
|
+
.controls
|
6
|
+
= f.<%= column.field_type %> :<%= column.name %>, :class => '<%= column.field_type %>'
|
7
|
+
<%- end -%>
|
8
|
+
.form-actions
|
9
|
+
= f.submit nil, :class => 'btn btn-primary'
|
10
|
+
'
|
11
|
+
= link_to t('.cancel', :default => t("helpers.links.cancel")), <%= controller_routing_path %>_path, :class => 'btn'
|
@@ -0,0 +1,40 @@
|
|
1
|
+
<%%- model_class = <%= resource_name.classify %> -%>
|
2
|
+
<div class="page-header">
|
3
|
+
<h1><%%=t '.title', :default => model_class.model_name.human.pluralize %></h1>
|
4
|
+
</div>
|
5
|
+
<table class="table table-striped">
|
6
|
+
<thead>
|
7
|
+
<tr>
|
8
|
+
<th><%%= model_class.human_attribute_name(:id) %></th>
|
9
|
+
<%- columns.each do |column| -%>
|
10
|
+
<th><%%= model_class.human_attribute_name(:<%= column.name %>) %></th>
|
11
|
+
<%- end -%>
|
12
|
+
<th><%%= model_class.human_attribute_name(:created_at) %></th>
|
13
|
+
<th><%%=t '.actions', :default => t("helpers.actions") %></th>
|
14
|
+
</tr>
|
15
|
+
</thead>
|
16
|
+
<tbody>
|
17
|
+
<%% @<%= plural_resource_name %>.each do |<%= resource_name %>| %>
|
18
|
+
<tr>
|
19
|
+
<td><%%= link_to <%= resource_name %>.id, <%= singular_controller_routing_path %>_path(<%= resource_name %>) %></td>
|
20
|
+
<%- columns.each do |column| -%>
|
21
|
+
<td><%%= <%= resource_name %>.<%= column.name %> %></td>
|
22
|
+
<%- end -%>
|
23
|
+
<td><%%=l <%= resource_name %>.created_at %></td>
|
24
|
+
<td>
|
25
|
+
<%%= link_to t('.edit', :default => t("helpers.links.edit")),
|
26
|
+
edit_<%= singular_controller_routing_path %>_path(<%= resource_name %>), :class => 'btn btn-mini' %>
|
27
|
+
<%%= link_to t('.destroy', :default => t("helpers.links.destroy")),
|
28
|
+
<%= singular_controller_routing_path %>_path(<%= resource_name %>),
|
29
|
+
:method => :delete,
|
30
|
+
:data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) },
|
31
|
+
:class => 'btn btn-mini btn-danger' %>
|
32
|
+
</td>
|
33
|
+
</tr>
|
34
|
+
<%% end %>
|
35
|
+
</tbody>
|
36
|
+
</table>
|
37
|
+
|
38
|
+
<%%= link_to t('.new', :default => t("helpers.links.new")),
|
39
|
+
new_<%= singular_controller_routing_path %>_path,
|
40
|
+
:class => 'btn btn-primary' %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
- model_class = <%= resource_name.classify %>
|
2
|
+
.page-header
|
3
|
+
%h1=t '.title', :default => model_class.model_name.human.pluralize
|
4
|
+
%table.table.table-striped
|
5
|
+
%thead
|
6
|
+
%tr
|
7
|
+
%th= model_class.human_attribute_name(:id)
|
8
|
+
<%- columns.each do |column| -%>
|
9
|
+
%th= model_class.human_attribute_name(:<%= column.name %>)
|
10
|
+
<%- end -%>
|
11
|
+
%th= model_class.human_attribute_name(:created_at)
|
12
|
+
%th=t '.actions', :default => t("helpers.actions")
|
13
|
+
%tbody
|
14
|
+
- @<%= plural_resource_name %>.each do |<%= resource_name %>|
|
15
|
+
%tr
|
16
|
+
%td= link_to <%= resource_name %>.id, <%= singular_controller_routing_path %>_path(<%= resource_name %>)
|
17
|
+
<%- columns.each do |column| -%>
|
18
|
+
%td= <%= resource_name %>.<%= column.name %>
|
19
|
+
<%- end -%>
|
20
|
+
%td=l <%= resource_name %>.created_at
|
21
|
+
%td
|
22
|
+
= link_to t('.edit', :default => t("helpers.links.edit")), edit_<%= singular_controller_routing_path %>_path(<%= resource_name %>), :class => 'btn btn-mini'
|
23
|
+
= link_to t('.destroy', :default => t("helpers.links.destroy")), <%= singular_controller_routing_path %>_path(<%= resource_name %>), :method => :delete, :data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) }, :class => 'btn btn-mini btn-danger'
|
24
|
+
|
25
|
+
= link_to t('.new', :default => t("helpers.links.new")), new_<%= singular_controller_routing_path %>_path, :class => 'btn btn-primary'
|
@@ -0,0 +1,27 @@
|
|
1
|
+
- model_class = <%= resource_name.classify %>
|
2
|
+
div class="page-header"
|
3
|
+
h1=t '.title', :default => model_class.model_name.human.pluralize
|
4
|
+
table class="table table-striped"
|
5
|
+
thead
|
6
|
+
tr
|
7
|
+
th= model_class.human_attribute_name(:id)
|
8
|
+
<%- columns.each do |column| -%>
|
9
|
+
th= model_class.human_attribute_name(:<%= column.name %>)
|
10
|
+
<%- end -%>
|
11
|
+
th= model_class.human_attribute_name(:created_at)
|
12
|
+
th=t '.actions', :default => t("helpers.actions")
|
13
|
+
tbody
|
14
|
+
- @<%= plural_resource_name %>.each do |<%= resource_name %>|
|
15
|
+
tr
|
16
|
+
td= link_to <%= resource_name %>.id, <%= singular_controller_routing_path %>_path(<%= resource_name %>)
|
17
|
+
<%- columns.each do |column| -%>
|
18
|
+
td= <%= resource_name %>.<%= column.name %>
|
19
|
+
<%- end -%>
|
20
|
+
td=l <%= resource_name %>.created_at
|
21
|
+
td
|
22
|
+
= link_to t('.edit', :default => t("helpers.links.edit")), edit_<%= singular_controller_routing_path %>_path(<%= resource_name %>), :class => 'btn btn-mini'
|
23
|
+
'
|
24
|
+
= link_to t('.destroy', :default => t("helpers.links.destroy")), <%= singular_controller_routing_path %>_path(<%= resource_name %>), :method => :delete, :data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) }, :class => 'btn btn-mini btn-danger'
|
25
|
+
|
26
|
+
= link_to t('.new', :default => t("helpers.links.new")), new_<%= singular_controller_routing_path %>_path, :class => 'btn btn-primary'
|
27
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<%%- model_class = <%= resource_name.classify %> -%>
|
2
|
+
<div class="page-header">
|
3
|
+
<h1><%%=t '.title', :default => model_class.model_name.human %></h1>
|
4
|
+
</div>
|
5
|
+
|
6
|
+
<dl class="dl-horizontal">
|
7
|
+
<%- columns.each do |column| -%>
|
8
|
+
<dt><strong><%%= model_class.human_attribute_name(:<%= column.name %>) %>:</strong></dt>
|
9
|
+
<dd><%%= @<%= resource_name %>.<%= column.name %> %></dd>
|
10
|
+
<%- end -%>
|
11
|
+
</dl>
|
12
|
+
|
13
|
+
<div class="form-actions">
|
14
|
+
<%%= link_to t('.back', :default => t("helpers.links.back")),
|
15
|
+
<%= controller_routing_path %>_path, :class => 'btn' %>
|
16
|
+
<%%= link_to t('.edit', :default => t("helpers.links.edit")),
|
17
|
+
edit_<%= singular_controller_routing_path %>_path(@<%= resource_name %>), :class => 'btn' %>
|
18
|
+
<%%= link_to t('.destroy', :default => t("helpers.links.destroy")),
|
19
|
+
<%= singular_controller_routing_path %>_path(@<%= resource_name %>),
|
20
|
+
:method => 'delete',
|
21
|
+
:data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) },
|
22
|
+
:class => 'btn btn-danger' %>
|
23
|
+
</div>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
- model_class = <%= resource_name.classify %>
|
2
|
+
.page-header
|
3
|
+
%h1=t '.title', :default => model_class.model_name.human
|
4
|
+
|
5
|
+
<%- columns.each do |column| -%>
|
6
|
+
%p
|
7
|
+
%strong= model_class.human_attribute_name(:<%= column.name %>) + ':'
|
8
|
+
%br
|
9
|
+
= @<%= resource_name %>.<%= column.name %>
|
10
|
+
<%- end -%>
|
11
|
+
|
12
|
+
.form-actions
|
13
|
+
= link_to t('.back', :default => t("helpers.links.back")), <%= controller_routing_path %>_path, :class => 'btn'
|
14
|
+
= link_to t('.edit', :default => t("helpers.links.edit")), edit_<%= singular_controller_routing_path %>_path(@<%= resource_name %>), :class => 'btn'
|
15
|
+
= link_to t('.destroy', :default => t("helpers.links.destroy")), <%= singular_controller_routing_path %>_path(@<%= resource_name %>), :method => "delete", :data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) }, :class => 'btn btn-danger'
|
@@ -0,0 +1,17 @@
|
|
1
|
+
- model_class = <%= resource_name.classify %>
|
2
|
+
div class="page-header"
|
3
|
+
h1=t '.title', :default => model_class.model_name.human
|
4
|
+
|
5
|
+
<%- columns.each do |column| -%>
|
6
|
+
p
|
7
|
+
strong= model_class.human_attribute_name(:<%= column.name %>) + ':'
|
8
|
+
br
|
9
|
+
= @<%= resource_name %>.<%= column.name %>
|
10
|
+
<%- end -%>
|
11
|
+
|
12
|
+
.form-actions
|
13
|
+
= link_to t('.back', :default => t("helpers.links.back")), <%= controller_routing_path %>_path, :class => 'btn'
|
14
|
+
'
|
15
|
+
= link_to t('.edit', :default => t("helpers.links.edit")), edit_<%= singular_controller_routing_path %>_path(@<%= resource_name %>), :class => 'btn'
|
16
|
+
'
|
17
|
+
= link_to t('.destroy', :default => t("helpers.links.destroy")), <%= singular_controller_routing_path %>_path(@<%= resource_name %>), :method => "delete", :data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) }, :class => 'btn btn-danger'
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<%%= simple_form_for @<%= resource_name %>, :html => { :class => 'form-horizontal' } do |f| %>
|
2
|
+
<%- columns.each do |column| -%>
|
3
|
+
<%%= f.input :<%= column.name %> %>
|
4
|
+
<%- end -%>
|
5
|
+
<%- if ::SimpleForm::FormBuilder.instance_methods.include?(:wrapped_button) -%>
|
6
|
+
<%%= f.button :wrapped, :cancel => <%= controller_routing_path %>_path %>
|
7
|
+
<%- else -%>
|
8
|
+
<div class="form-actions">
|
9
|
+
<%%= f.button :submit, :class => 'btn-primary' %>
|
10
|
+
<%%= link_to t('.cancel', :default => t("helpers.links.cancel")),
|
11
|
+
<%= controller_routing_path %>_path, :class => 'btn' %>
|
12
|
+
</div>
|
13
|
+
<%- end -%>
|
14
|
+
<%% end %>
|