beautiful_scaffold 1.0.2 → 2.0.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -0
  3. data/CHANGELOG +24 -1
  4. data/Gemfile +24 -9
  5. data/Gemfile.lock +209 -0
  6. data/README.rdoc +25 -26
  7. data/Rakefile +27 -4
  8. data/beautiful_scaffold.gemspec +6 -4
  9. data/lib/beautiful_scaffold/version.rb +3 -0
  10. data/lib/generators/beautiful_jointable_generator.rb +39 -6
  11. data/lib/generators/beautiful_migration_generator.rb +11 -19
  12. data/lib/generators/beautiful_scaffold_common_methods.rb +51 -26
  13. data/lib/generators/beautiful_scaffold_generator.rb +100 -43
  14. data/lib/generators/templates/app/assets/javascripts/application-bs.js +5 -6
  15. data/lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js +64 -77
  16. data/lib/generators/templates/app/assets/javascripts/bootstrap-datetimepicker-for-beautiful-scaffold.js +25 -41
  17. data/lib/generators/templates/app/assets/javascripts/fixed_menu.js +3 -1
  18. data/lib/generators/templates/app/assets/javascripts/jstree.min.js +6 -0
  19. data/lib/generators/templates/app/assets/stylesheets/application-bs.css +14 -6
  20. data/lib/generators/templates/app/assets/stylesheets/beautiful-scaffold.css.scss +10 -1
  21. data/lib/generators/templates/app/assets/stylesheets/themes/default-dark/32px.png +0 -0
  22. data/lib/generators/templates/app/assets/stylesheets/themes/default-dark/40px.png +0 -0
  23. data/lib/generators/templates/app/assets/stylesheets/themes/default-dark/style.scss +1146 -0
  24. data/lib/generators/templates/app/assets/stylesheets/themes/default-dark/throbber.gif +0 -0
  25. data/lib/generators/templates/app/assets/stylesheets/themes/default/32px.png +0 -0
  26. data/lib/generators/templates/app/assets/stylesheets/themes/default/40px.png +0 -0
  27. data/lib/generators/templates/app/assets/stylesheets/themes/default/style.scss +1102 -0
  28. data/lib/generators/templates/app/assets/stylesheets/themes/default/throbber.gif +0 -0
  29. data/lib/generators/templates/app/controllers/base.rb +7 -5
  30. data/lib/generators/templates/app/controllers/master_base.rb +18 -24
  31. data/lib/generators/templates/app/helpers/beautiful_helper.rb +83 -61
  32. data/lib/generators/templates/app/initializers/link_renderer.rb +23 -18
  33. data/lib/generators/templates/app/views/_form.html.erb +2 -2
  34. data/lib/generators/templates/app/views/_form_habtm_tag.html.erb +6 -2
  35. data/lib/generators/templates/app/views/_mass_inserting.html.erb +38 -30
  36. data/lib/generators/templates/app/views/_modal_columns.html.erb +3 -3
  37. data/lib/generators/templates/app/views/index.html.erb +83 -79
  38. data/lib/generators/templates/app/views/layout.html.erb +29 -36
  39. data/lib/generators/templates/app/views/partials/_forget_password.html.erb +2 -2
  40. data/lib/generators/templates/app/views/partials/_form_field.html.erb +7 -7
  41. data/lib/generators/templates/app/views/partials/_index_batch.html.erb +1 -1
  42. data/lib/generators/templates/app/views/partials/_index_column.html.erb +4 -4
  43. data/lib/generators/templates/app/views/partials/_index_header.html.erb +1 -1
  44. data/lib/generators/templates/app/views/partials/_index_search.html.erb +1 -1
  45. data/lib/generators/templates/app/views/partials/_register_form.html.erb +2 -2
  46. data/lib/generators/templates/app/views/partials/_show_field.html.erb +3 -3
  47. data/lib/generators/templates/app/views/partials/_sign_in_form.html.erb +1 -1
  48. data/lib/generators/templates/app/views/partials/_sign_in_sign_out.html.erb +2 -2
  49. data/lib/generators/templates/app/views/show.html.erb +2 -2
  50. data/lib/generators/templates/app/views/treeview.html.erb +8 -5
  51. metadata +21 -19
  52. data/lib/generators/templates/app/assets/javascripts/jquery.jstree.js +0 -4551
  53. data/lib/generators/templates/app/assets/stylesheets/datepicker.css +0 -224
  54. data/lib/generators/templates/app/assets/stylesheets/reset.css +0 -48
  55. data/lib/generators/templates/app/assets/stylesheets/themes/default/d.gif +0 -0
  56. data/lib/generators/templates/app/assets/stylesheets/themes/default/d.png +0 -0
  57. data/lib/generators/templates/app/assets/stylesheets/themes/default/style.css +0 -74
  58. data/lib/generators/templates/app/assets/stylesheets/timepicker.css +0 -89
  59. data/test/scaffold_test.rb +0 -68
@@ -6,17 +6,21 @@
6
6
  :linked_model_name => "tag",
7
7
  :plural_linked_model_name => "tags",
8
8
  :namespace_bs => "admin",
9
+ :engine_bs => "YOUR_ENGINE_OR_EMPTY_STRING",
9
10
  :field_to_search_for_linked_model => "name",
11
+ :attr_to_show => "caption",
10
12
  :f => f
11
13
  }
12
14
  # Example to put in a _form.html.erb
13
15
  %>
14
- <% path_namespace = '/' + namespace_bs if not namespace_bs.blank? %>
16
+ <% path_namespace = "/" %>
17
+ <% path_namespace += "#{engine_bs}/" if engine_bs.present? %>
18
+ <% path_namespace += "/#{namespace_bs}/" if namespace_bs.present? %>
15
19
 
16
20
  <div class="form-group">
17
21
  <%= f.label plural_linked_model_name.to_sym, t(plural_linked_model_name.to_sym, :default => plural_linked_model_name.capitalize), :class => "control-label" %>
18
22
  <div>
19
- <ul class="bs-tagit" id="<%= model_name %>_<%= linked_model_name %>_ids" name="<%= model_name %>[<%= linked_model_name %>_ids][]" data-url="<%= path_namespace %>/<%= plural_linked_model_name %>/search_and_filter.json" data-param="q[<%= field_to_search_for_linked_model %>_cont]" data-result="caption">
23
+ <ul class="bs-tagit" id="<%= model_name %>_<%= linked_model_name %>_ids" name="<%= model_name %>[<%= linked_model_name %>_ids][]" data-url="<%= path_namespace %><%= plural_linked_model_name %>/search_and_filter.json" data-param="q[<%= field_to_search_for_linked_model %>_cont]" data-result="<%= attr_to_show %>">
20
24
  <% begin %>
21
25
  <% for elt in model_class.send(plural_linked_model_name) %>
22
26
  <li data-value="<%= elt.id %>"><%= elt.caption %></li>
@@ -1,37 +1,45 @@
1
1
  <% model = ("#{(engine.blank? ? '' : "#{engine.camelize}::")}#{model_name.camelize}").constantize %>
2
2
  <% formparams = [] %>
3
- <% if not namespace.blank? then %>
3
+ <% if !namespace.blank? %>
4
4
  <% formparams << namespace %>
5
5
  <% end %>
6
6
  <% formparams << model.new %>
7
- <%= form_for formparams, :method => :post, :html => { :class => "well well-small form-inline mass-inserting #{(params[:mass_inserting] ? 'setfocus' : '')}" } do |f| %>
8
- <%= hidden_field_tag :mass_inserting, true %>
9
- <% for col in model_columns %>
10
- <div <%= visible_column(model_name, col, 'inline') %> class="col-<%= col %>">
11
- <%=
12
- ar = model.columns_hash[col]
13
- if not ar.nil? then
14
- case ar.type
15
- when :integer then
16
- if col =~ /.*_id/ then
17
- f.collection_select((col).to_sym, col.camelize.constantize.all, :id, :caption, { :include_blank => true, :selected => (begin params[:q][col + "_eq"].to_i rescue '' end) }, {:class => "form-control"})
18
- else
19
- f.text_field(col.to_sym, :placeholder => t(i18n_translate_path(model_name, col)).capitalize, :class => "form-control")
20
- end
21
- when :boolean then
22
- (
23
- "<label class='bs-label-ib'>#{f.check_box(col.to_sym, {}, true, false)}#{t(i18n_translate_path(model_name, col)).capitalize}</label>".html_safe
24
- )
25
- else
26
- f.text_field(col.to_sym, :placeholder => t(i18n_translate_path(model_name, col)).capitalize, :class => "form-control")
27
- end
28
- else
29
- f.collection_select((col + '_id').to_sym, col.camelize.constantize.all, :id, :caption, { :include_blank => true, :selected => (begin params[:q][col + "_id_eq"].to_i rescue '' end) }, {:class => "form-control"})
30
- end
31
- %>
7
+ <div class="container-fluid mb-3">
8
+ <div class="row">
9
+ <div class="col-md">
10
+ <div class="card card-body bg-light">
11
+ <%= form_for formparams, :method => :post, :html => { :class => "form-inline mass-inserting #{(params[:mass_inserting] ? 'setfocus' : '')}" } do |f| %>
12
+ <%= hidden_field_tag :mass_inserting, true %>
13
+ <% for col in model_columns %>
14
+ <div <%= visible_column(model_name, col, 'inline') %> class="form-group mr-sm-2 col-<%= col %>">
15
+ <%=
16
+ ar = model.columns_hash[col]
17
+ if !ar.nil?
18
+ case ar.type
19
+ when :integer then
20
+ if col =~ /.*_id/
21
+ f.collection_select((col).to_sym, col.camelize.constantize.all, :id, :caption, { :include_blank => true, :selected => (begin params[:q]["#{col}_eq"].to_i rescue '' end) }, {:class => "form-control"})
22
+ else
23
+ f.text_field(col.to_sym, :placeholder => t(i18n_translate_path(model_name, col), default: "#{model_name}.#{col}").capitalize, :class => "form-control")
24
+ end
25
+ when :boolean then
26
+ (
27
+ "<label class='bs-label-ib'>#{f.check_box(col.to_sym, {}, true, false)}#{t(i18n_translate_path(model_name, col), default: "#{model_name}.#{col}").capitalize}</label>".html_safe
28
+ )
29
+ else
30
+ f.text_field(col.to_sym, :placeholder => t(i18n_translate_path(model_name, col), default: "#{model_name}.#{col}").capitalize, :class => "form-control")
31
+ end
32
+ else
33
+ f.collection_select(("#{false ? "#{engine}_" : ''}#{col}_id").to_sym, ("#{(engine.blank? ? '' : "#{engine.camelize}::")}#{col.camelize}").constantize.all, :id, :caption, { :include_blank => true, :selected => (begin params[:q]["#{col}_id_eq"].to_i rescue '' end) }, {:class => "form-control"})
34
+ end
35
+ %>
36
+ </div>
37
+ <% end %>
38
+ <div class="form-group">
39
+ <%= f.submit t(:create, :default => "Create"), :class => "btn btn-outline-secondary", :data => { :disable_with => t(:saving, :default => "Saving...") } %>
40
+ </div>
41
+ <% end %>
42
+ </div>
32
43
  </div>
33
- <% end %>
34
- <div style="display:inline;">
35
- <%= f.submit t(:create, :default => "Create"), :class => "btn btn-default", :data => { :disable_with => t(:saving, :default => "Saving...") } %>
36
44
  </div>
37
- <% end %>
45
+ </div>
@@ -2,8 +2,8 @@
2
2
  <div class="modal-dialog">
3
3
  <div class="modal-content">
4
4
  <div class="modal-header">
5
+ <h5 class="modal-title"><%= t(:select_columns, :default => "Select Columns") %></h5>
5
6
  <button type="button" class="close" data-dismiss="modal">×</button>
6
- <h3><%= t(:select_columns, :default => "Select Columns") %></h3>
7
7
  </div>
8
8
  <div class="modal-body">
9
9
  <% for field in model_columns %>
@@ -13,8 +13,8 @@
13
13
  <% end %>
14
14
  </div>
15
15
  <div class="modal-footer">
16
- <button type="button" class="btn btn-primary" id="filter-columns" data-url="/<%= engine_name %><%= model_name %>/select_fields">Ok</button>
17
- <button type="button" class="btn btn-default" id="cancel-filter-columns"><%= t(:cancel, :default => "Cancel") %></button>
16
+ <button type="button" class="btn btn-primary" id="filter-columns" data-url="<%= select_fields_url(model_name) %>">Ok</button>
17
+ <button type="button" class="btn btn-light" id="cancel-filter-columns"><%= t(:cancel, :default => "Cancel") %></button>
18
18
  </div>
19
19
  </div>
20
20
  </div>
@@ -1,72 +1,75 @@
1
- <h2><%%= t(:listing, :default => "Listing") %> <%%= <%= i18n_t_m_p(singular_table_name) %> %></h2>
2
-
3
- <p>
4
- <%%= link_to '<i class="fa fa-plus"></i> '.html_safe + t(:new, :default => "New") + ' ' + <%= i18n_t_m(model) %>, new_<%= namespace_for_route %><%= singular_table_name %>_path, :class => "btn btn-default" %>
5
- <%% if <%= model_with_engine_camelize %>.columns.map(&:name).include?("<%= model %>_id") then %>
6
- <%%= link_to '<i class="fa fa-folder-close"></i> '.html_safe + t(:treeview, :default => "Treeview") + ' ' + <%= i18n_t_m(model) %>, treeview_<%= namespace_for_route %><%= model_pluralize %>_path, :class => "btn btn-default" %>
7
- <%% end %>
8
- </p>
1
+ <div class="container-fluid">
2
+ <div class="row">
3
+ <div class="col-md">
4
+ <h2 class="title-index"><%%= t(:listing, :default => "Listing") %> <%%= <%= i18n_t_m_p(singular_table_name) %> %></h2>
5
+ <p>
6
+ <%%= link_to '<i class="fa fa-plus"></i> '.html_safe + t(:new, :default => "New") + ' ' + <%= i18n_t_m(model) %>, new_<%= namespace_for_route %><%= singular_table_name %>_path, :class => "btn btn-outline-secondary" %>
7
+ <%% if <%= model_with_engine_camelize %>.columns.map(&:name).include?("<%= model %>_id") %>
8
+ <%%= link_to '<i class="fa fa-folder-close"></i> '.html_safe + t(:treeview, :default => "Treeview") + ' ' + <%= i18n_t_m(model) %>, treeview_<%= namespace_for_route %><%= model_pluralize %>_path, :class => "btn btn-outline-secondary" %>
9
+ <%% end %>
10
+ </p>
11
+ </div>
12
+ </div>
13
+ </div>
9
14
 
10
15
  <%%= render :partial => "layouts/mass_inserting", :locals => { :engine => '<%= engine_opt %>', :namespace => '<%= namespace_alone %>', :model_name => '<%= model %>', :model_columns => [<%= attributes.map{ |e| "'#{e.name}'" }.join(',') %>] } %>
11
16
 
12
17
  <%%# Set your scopes below (string in array) %>
13
18
  <%% scopes = [] %>
14
- <%% if not scopes.blank? then %>
15
- <div class="btn-toolbar">
16
- <div class="btn-group">
17
- <%%= link_to "All (#{@<%= model %>_scope_for_scope.count})", <%= namespace_for_route %><%= plural_table_name %>_path(:scope => ""), :class => "btn btn-default #{((session[:scope][:<%= model %>].to_s == '') ? 'active' : '')}" %>
18
- <%% for scope in scopes %>
19
- <%%= link_to "#{scope} (#{@<%= model %>_scope_for_scope.send(scope).count})", <%= namespace_for_route %><%= plural_table_name %>_path(:scope => scope), :class => "btn btn-default #{((session[:scope][:<%= model %>].to_s == scope) ? 'active' : '')}" %>
20
- <%% end %>
19
+ <%% if !scopes.blank? %>
20
+ <div class="container-fluid mb-3" id="scopes-div" data-present-title="<%%= t(:help_scope, :default => "Filter by scope") %>" data-present-description="<%%= t(:help_scope_description, :default => "Filter by scope") %>" data-present-order="1">
21
+ <div class="row">
22
+ <div class="col-md btn-toolbar">
23
+ <div class="btn-group">
24
+ <%%= link_to "All (#{@<%= model %>_scope_for_scope.count})", <%= namespace_for_route %><%= plural_table_name %>_path(:scope => ""), :class => "btn btn-outline-secondary #{((session[:scope][:<%= model %>].to_s == '') ? 'active' : '')}" %>
25
+ <%% for scope in scopes %>
26
+ <%%= link_to "#{scope} (#{@<%= model %>_scope_for_scope.send(scope).count})", <%= namespace_for_route %><%= plural_table_name %>_path(:scope => scope), :class => "btn btn-outline-secondary #{((session[:scope][:<%= model %>].to_s == scope) ? 'active' : '')}" %>
27
+ <%% end %>
28
+ </div>
29
+ </div>
21
30
  </div>
22
31
  </div>
23
32
  <%% end %>
24
33
 
25
- <div class="row">
26
- <div class="col-md-12">
27
- <a class="btn btn-xs btn-default" id="hide-menu-btn">
28
- <i class="fa fa-caret-left"></i>
29
- <i class="fa fa-caret-left"></i>
30
- </a>
31
- <a class="btn btn-xs btn-default" id="show-menu-btn">
32
- <i class="fa fa-caret-right"></i>
33
- <i class="fa fa-caret-right"></i>
34
- </a>
35
-
36
- <a class="btn btn-xs btn-default pull-right" id="hide-search-btn">
37
- <i class="fa fa-caret-right"></i>
38
- <i class="fa fa-caret-right"></i>
39
- </a>
40
- <a class="btn btn-xs btn-default pull-right" id="show-search-btn">
41
- <i class="fa fa-caret-left"></i>
42
- <i class="fa fa-caret-left"></i>
43
- </a>
44
- </div>
45
- </div>
46
-
34
+ <div class="container-fluid">
47
35
  <div class="row">
48
36
  <div class="col-md-9">
49
- <%%= form_tag batch_<%= namespace_for_route %><%= plural_table_name %>_path, :class => "form-inline" do %>
50
- <div class="well well-small">
51
- <label class="control-label" for="select01"><%%= t(:batch, :default => "Batch") %></label>
52
-
53
- <select id="select01" name="actionprocess" class="form-control">
54
- <option value="destroy"><%%= t(:destroy, :default => "Destroy") %></option>
55
- <%= render_partial 'app/views/partials/_index_batch.html.erb' %>
56
- <!-- Beautiful_scaffold - AddField - Batch - Do not remove -->
57
- </select>
58
- <button class="btn btn-default" type="submit"><i class="fa fa-ok"></i> <%%= t(:process, :default => "Process") %></button>
37
+ <%%= form_tag batch_<%= namespace_for_route %><%= plural_table_name %>_path do %>
38
+ <div class="card card-body bg-light mb-3">
39
+ <div class="row">
40
+ <div class="form-inline col-md" id="batch-div" data-present-title="<%%= t(:help_batch, :default => "Batch processing") %>" data-present-description="<%%= t(:help_batch_description, :default => "Batch processing description") %>" data-present-order="2">
41
+ <label class="control-label mb-2 mr-sm-2" for="select01"><%%= t(:batch, :default => "Batch") %></label>
42
+
43
+ <select id="select01" name="actionprocess" class="custom-select mb-2 mr-sm-2">
44
+ <option value="destroy"><%%= t(:destroy, :default => "Destroy") %></option>
45
+ <option value="touch"><%%= t(:touch, :default => "Touch") %></option>
46
+ <%= render_partial 'app/views/partials/_index_batch.html.erb' %>
47
+ <!-- Beautiful_scaffold - AddField - Batch - Do not remove -->
48
+ </select>
49
+ <button class="btn btn-outline-secondary mb-2 mr-sm-2" type="submit"><i class="fa fa-ok"></i> <%%= t(:process, :default => "Process") %></button>
50
+ </div>
51
+ <div class="col-md">
52
+ <a class="btn btn-xs btn-light float-right" id="hide-search-btn">
53
+ <i class="fa fa-caret-right"></i>
54
+ <i class="fa fa-caret-right"></i>
55
+ </a>
56
+ <a class="btn btn-xs btn-light float-right" id="show-search-btn">
57
+ <i class="fa fa-caret-left"></i>
58
+ <i class="fa fa-caret-left"></i>
59
+ </a>
60
+ </div>
61
+ </div>
59
62
  </div>
60
63
 
61
64
  <%%= render :partial => "layouts/modal_columns", :locals => { :engine_name => '<%= engine_opt %>', :model_name => "<%= singular_table_name %>", :model_columns => [<%= (attributes.map{ |e| "'#{e.name}'" }.to_a + ["'created_at'", "'updated_at'"]).join(',') %>] } %>
62
65
 
63
- <table class="table table-striped table-bordered table-condensed">
66
+ <table class="table table-striped table-bordered table-sm">
64
67
  <thead>
65
68
  <tr>
66
69
  <th class="ac">
67
70
  <a class="" data-toggle="modal" href="#modal-columns" title="<%%= t(:select_columns, :default => "Select Columns") %>" ><i class="fa fa-th-list"></i></a>
68
71
  </th>
69
- <th>
72
+ <th id="checkall-div" data-present-title="<%%= t(:help_checkall, :default => "Check all elements") %>" data-present-description="<%%= t(:help_checkall_description, :default => "Check all elements visible on the page") %>" data-present-order="3">
70
73
  <%%= check_box_tag :checkall, '' %>
71
74
  </th>
72
75
  <%= render_partial 'app/views/partials/_index_header.html.erb' %>
@@ -78,7 +81,7 @@
78
81
  <%%= sorting_header("<%= singular_table_name %>", "updated_at", "<%= namespace_alone %>") %>
79
82
  </th>
80
83
  <th colspan="3">
81
- <label class="checkbox">
84
+ <label class="checkbox mb-0" id="checkallall-div" data-present-title="<%%= t(:help_checkallall, :default => "Check all elements") %>" data-present-description="<%%= t(:help_checkallall_description, :default => "Check all elements, that match current filter even if they are not visible on the page") %>" data-present-order="4">
82
85
  <%%= check_box_tag :checkallelt, 'all' %>
83
86
  <%%= pluralize(@<%= singular_table_name %>_scope.count, <%= i18n_t_m(singular_table_name) %>, <%= i18n_t_m_p(singular_table_name) %>) %>
84
87
  </label>
@@ -98,7 +101,7 @@
98
101
  <%%= l(<%= singular_table_name %>.updated_at, :format => :long) %>
99
102
  </td>
100
103
  <td class="ac am"><%%= link_to '<i class="fa fa-search"></i>'.html_safe, <%= namespace_for_route %><%= singular_table_name %>_path(<%= singular_table_name %>), :title => t(:show, :default => "Show") %></td>
101
- <td class="ac am"><%%= link_to '<i class="fa fa-pencil"></i>'.html_safe, edit_<%= namespace_for_route %><%= singular_table_name %>_path(<%= singular_table_name %>), :title => t(:edit, :default => "Edit") %></td>
104
+ <td class="ac am"><%%= link_to '<i class="fa fa-edit"></i>'.html_safe, edit_<%= namespace_for_route %><%= singular_table_name %>_path(<%= singular_table_name %>), :title => t(:edit, :default => "Edit") %></td>
102
105
  <td class="ac am"><%%= link_to '<i class="fa fa-times"></i>'.html_safe, <%= namespace_for_route %><%= singular_table_name %>_path(<%= singular_table_name %>), :data => { :confirm => t(:are_you_sure, :default => "Are you sure?") }, :method => :delete, :title => t(:destroy, :default => "Destroy") %></td>
103
106
  </tr>
104
107
  <%% end %>
@@ -112,45 +115,46 @@
112
115
  :inner_window => 0,
113
116
  :outer_window => 0,
114
117
  :previous_label => t(:prev, :default => "Previous"),
115
- :next_label => t(:next, :default => "Next") %>
118
+ :next_label => t(:next, :default => "Next"),
119
+ :renderer => WillPaginate::ActionView::BootstrapLinkRenderer
120
+ %>
116
121
 
117
122
  </div>
118
- <div class="btn-group pull-right">
119
- <%%= link_to '<i class="fa fa-download"></i> CSV'.html_safe, <%= namespace_for_route %><%= plural_table_name %>_path(:format => :csv), :class => "btn btn-default" %>
120
- <%%= link_to '<i class="fa fa-download"></i> XML'.html_safe, <%= namespace_for_route %><%= plural_table_name %>_path(:format => :xml), :class => "btn btn-default" %>
121
- <%%= link_to '<i class="fa fa-download"></i> JSON'.html_safe, <%= namespace_for_route %><%= plural_table_name %>_path(:format => :json), :class => "btn btn-default" %>
122
- <%%= link_to '<i class="fa fa-download"></i> PDF'.html_safe, <%= namespace_for_route %><%= plural_table_name %>_path(:format => :pdf), :class => "btn btn-default" %>
123
+ <div class="btn-group btn-group-sm float-right">
124
+ <%%= link_to '<i class="fa fa-download"></i> CSV'.html_safe, <%= namespace_for_route %><%= plural_table_name %>_path(:format => :csv), :class => "btn btn-outline-secondary" %>
125
+ <%%= link_to '<i class="fa fa-download"></i> XML'.html_safe, <%= namespace_for_route %><%= plural_table_name %>_path(:format => :xml), :class => "btn btn-outline-secondary" %>
126
+ <%%= link_to '<i class="fa fa-download"></i> JSON'.html_safe, <%= namespace_for_route %><%= plural_table_name %>_path(:format => :json), :class => "btn btn-outline-secondary" %>
127
+ <%%= link_to '<i class="fa fa-download"></i> PDF'.html_safe, <%= namespace_for_route %><%= plural_table_name %>_path(:format => :pdf), :class => "btn btn-outline-secondary" %>
123
128
  </div>
124
129
  </div>
125
130
  <%% end %>
126
131
  </div>
127
132
  <div class="col-md-3">
128
- <%%= search_form_for @q, :url => <%= namespace_for_route + 'search_' + model_pluralize + '_path' %>, :html => { :class => "well well-small search-and-filter" }, :method => :post do |f| %>
129
-
130
- <h3><%%= t("search_and_filter", :default => "Search & filter") %></h3>
131
-
132
- <%= render_partial 'app/views/partials/_index_search.html.erb' %>
133
-
134
- <!-- Beautiful_scaffold - AddField - Search - Do not remove -->
135
-
136
- <div class="panel-group">
137
- <div class="panel panel-default">
138
- <div class="panel-heading">
139
- <a class="accordion-toggle" data-toggle="collapse-next">
140
- <%%= t(:more_options, :default => "More options...") %>
141
- </a>
142
- </div>
143
- <div class="panel-collapse collapse">
144
- <div class="panel-body">
145
- <%= render_partial 'app/views/partials/_index_search_default_fields.html.erb' %>
133
+ <%%= search_form_for @q, :url => <%= namespace_for_route + 'search_' + model_pluralize + '_path' %>, :html => { :class => "card bg-light mb-3 search-and-filter" }, :method => :post do |f| %>
134
+ <div class="card-header"><%%= t("search_and_filter", :default => "Search & filter") %></div>
135
+ <div class="card-body">
136
+ <div class="card-text">
137
+ <%= render_partial 'app/views/partials/_index_search.html.erb' %>
138
+ <!-- Beautiful_scaffold - AddField - Search - Do not remove -->
139
+ <div class="panel-group">
140
+ <div class="panel panel-default">
141
+ <div class="panel-heading">
142
+ <a class="badge badge-light accordion-toggle" data-toggle="collapse-next">
143
+ <%%= t(:more_options, :default => "More options...") %>
144
+ </a>
145
+ </div>
146
+ <div class="panel-collapse collapse">
147
+ <div class="panel-body">
148
+ <%= render_partial 'app/views/partials/_index_search_default_fields.html.erb' %>
149
+ </div>
150
+ </div>
146
151
  </div>
147
152
  </div>
153
+ <%%= f.submit t(:filter, :default => "Filter"), :class => "btn btn-primary btn-sm btn-block" %>
154
+ <%%= link_to t(:cancel, :default => "Cancel"), <%= namespace_for_route %><%= model_pluralize %>_path(:nosearch => "ok"), :class => "btn btn-light btn-sm btn-block" %>
148
155
  </div>
149
156
  </div>
150
-
151
-
152
- <%%= f.submit t(:filter, :default => "Filter"), :class => "btn btn-primary" %>
153
- <%%= link_to t(:cancel, :default => "Cancel"), <%= namespace_for_route %><%= model_pluralize %>_path(:nosearch => "ok"), :class => "btn btn-default" %>
154
157
  <%% end %>
155
158
  </div>
156
159
  </div>
160
+ </div>
@@ -5,63 +5,56 @@
5
5
  <title>Beautiful Scaffold</title>
6
6
 
7
7
  <meta name="description" content="Beautiful Scaffold">
8
- <meta name="author" content="You or me Sylvain Claudel (http://blog.escarworld.com)">
8
+ <meta name="author" content="You or me Sylvain Claudel (https://blog.rivsc.ovh)">
9
9
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
10
10
 
11
- <%%= stylesheet_link_tag "application-bs" %>
12
- <%%= javascript_include_tag "application-bs" %>
11
+ <!--TODO remove cdn-->
12
+ <script src="https://unpkg.com/driver.js/dist/driver.min.js"></script>
13
+ <link rel="stylesheet" href="https://unpkg.com/driver.js/dist/driver.min.css">
14
+
15
+ <%%= stylesheet_link_tag "<%= engine_name %>application-bs" %>
16
+ <%%= javascript_include_tag "<%= engine_name %>application-bs" %>
13
17
 
14
18
  <%%= csrf_meta_tags %>
15
19
  <%%= yield :head %>
16
20
  </head>
17
- <body style="display:none;">
18
- <div class="navbar navbar-default navbar-fixed-top">
19
- <div class="container">
20
- <div class="navbar-header">
21
- <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
22
- <span class="sr-only">Toggle navigation</span>
23
- <i class="fa fa-bars"></i>
24
- </button>
25
- <a class="navbar-brand" href="#">
26
- Beautiful-Scaffold
27
- </a>
28
- </div>
29
- <div class="navbar-collapse collapse">
30
- <ul class="nav navbar-nav">
31
- <li class="active"><a href="/">Home</a></li>
32
- <%%= render :partial => "layouts/beautiful_menu" %>
33
- </ul>
34
- <ul class="nav navbar-nav pull-right">
35
- <li>
36
- <!-- Beautiful_scaffold - Signin - Do not remove -->
37
- </li>
38
- </ul>
39
- </div>
21
+ <body>
22
+ <div class="navbar navbar-expand-md navbar-dark bg-dark">
23
+ <div class="navbar-header">
24
+ <a class="navbar-brand" href="#">
25
+ Beautiful-Scaffold
26
+ </a>
27
+ <button type="button" class="navbar-toggler collapsed" data-toggle="collapse" data-target=".navbar-collapse">
28
+ <span class="navbar-toggler-icon"></span>
29
+ </button>
30
+ </div>
31
+ <div class="navbar-collapse collapse">
32
+ <nav class="nav navbar-nav">
33
+ <a href="/" class="nav-link">Home</a>-
34
+ <%%= render :partial => "layouts/beautiful_menu" %>
35
+ </nav>
36
+ <i class="fa fa-question-circle text-white float-right" id="bs-help"></i>
37
+ <!-- Beautiful_scaffold - Signin - Do not remove -->
40
38
  </div>
41
39
  </div>
42
40
  <div class="container-fluid">
43
41
  <div class="row">
44
- <div class="col-md-2">
45
- <ul class="nav nav-pills nav-stacked">
46
- <%%= render :partial => "layouts/beautiful_menu" %>
47
- </ul>
48
- </div>
49
- <div class="col-md-10">
50
- <%% if not flash[:notice].blank? then %>
42
+ <div class="col-md filler">
43
+ <%% if !flash[:notice].blank? %>
51
44
  <div class="alert alert-info">
52
45
  <a class="close" data-dismiss="alert" href="#">×</a>
53
46
  <h4 class="alert-heading">Info : </h4>
54
47
  <%%= flash[:notice] %>
55
48
  </div>
56
49
  <%% end %>
57
- <%% if not flash[:error].blank? then %>
50
+ <%% if !flash[:error].blank? %>
58
51
  <div class="alert alert-danger">
59
52
  <a class="close" data-dismiss="alert" href="#">×</a>
60
53
  <h4 class="alert-heading">Error : </h4>
61
54
  <%%= flash[:error] %>
62
55
  </div>
63
56
  <%% end %>
64
- <div>
57
+ <div class="mt-2">
65
58
  <%%= yield %>
66
59
  </div>
67
60
  </div>
@@ -76,7 +69,7 @@
76
69
  <!-- Beautiful_scaffold - Modal - Do not remove -->
77
70
 
78
71
  <script type="text/javascript">
79
- <%% if not @opened_modal.blank? then %>
72
+ <%% if !@opened_modal.blank? %>
80
73
  $('<%%= @opened_modal %>').modal('show');
81
74
  <%% end %>
82
75
  </script>
@@ -2,8 +2,8 @@
2
2
  <div class="modal-dialog">
3
3
  <div class="modal-content">
4
4
  <div class="modal-header">
5
+ <h5 class="modal-title"><%%= t(:forgot_password, :default => "Forgot password") %></h5>
5
6
  <button type="button" class="close" data-dismiss="modal">×</button>
6
- <h3><%%= t(:forgot_password, :default => "Forgot password") %></h3>
7
7
  </div>
8
8
  <div class="modal-body">
9
9
  <%%= form_for('<%= model %>', :as => '<%= model %>', :url => password_path('<%= model %>'), :html => { :method => :post, :class => "form-horizontal" }) do |f| %>
@@ -15,7 +15,7 @@
15
15
  </div>
16
16
  <div class="form-group">
17
17
  <div>
18
- <%%= f.submit t(:send_me_reset_password_instructions, :default => "Send me reset password instructions"), :class => 'btn btn-default' %>
18
+ <%%= f.submit t(:send_me_reset_password_instructions, :default => "Send me reset password instructions"), :class => 'btn btn-light' %>
19
19
  </div>
20
20
  </div>
21
21
  <%% end %>