kono_utils_bootstrap_view4 0.1.0.pre.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (190) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +21 -0
  4. data/Rakefile +32 -0
  5. data/app/assets/config/kono_utils_bootstrap_view4_manifest.js +0 -0
  6. data/app/assets/javascripts/kono_utils_bootstrap_view4/application.js.erb +12 -0
  7. data/app/assets/javascripts/kono_utils_bootstrap_view4/kono_utils_bootstrap_view4.js +36 -0
  8. data/app/assets/stylesheets/kono_utils_bootstrap_view4/application.css.scss.erb +12 -0
  9. data/app/concepts/kono_utils/object/cell/base.rb +123 -0
  10. data/app/concepts/kono_utils/object/cell/buttons/base.rb +57 -0
  11. data/app/concepts/kono_utils/object/cell/buttons/collapse_search.rb +31 -0
  12. data/app/concepts/kono_utils/object/cell/buttons/create.rb +22 -0
  13. data/app/concepts/kono_utils/object/cell/buttons/delete.rb +32 -0
  14. data/app/concepts/kono_utils/object/cell/buttons/download.rb +23 -0
  15. data/app/concepts/kono_utils/object/cell/buttons/edit.rb +18 -0
  16. data/app/concepts/kono_utils/object/cell/buttons/list.rb +17 -0
  17. data/app/concepts/kono_utils/object/cell/buttons/reset_search.rb +21 -0
  18. data/app/concepts/kono_utils/object/cell/create/base.rb +8 -0
  19. data/app/concepts/kono_utils/object/cell/create/page_title.rb +10 -0
  20. data/app/concepts/kono_utils/object/cell/create/side_title.rb +5 -0
  21. data/app/concepts/kono_utils/object/cell/edits/base.rb +8 -0
  22. data/app/concepts/kono_utils/object/cell/edits/page_title.rb +10 -0
  23. data/app/concepts/kono_utils/object/cell/edits/side_title.rb +5 -0
  24. data/app/concepts/kono_utils/object/cell/form.rb +51 -0
  25. data/app/concepts/kono_utils/object/cell/forms/base.rb +13 -0
  26. data/app/concepts/kono_utils/object/cell/forms/container.rb +25 -0
  27. data/app/concepts/kono_utils/object/cell/forms/containers/layout.rb +16 -0
  28. data/app/concepts/kono_utils/object/cell/forms/containers/modal_layout.rb +7 -0
  29. data/app/concepts/kono_utils/object/cell/forms/containers/search_layout.rb +7 -0
  30. data/app/concepts/kono_utils/object/cell/forms/containers/table_layout.rb +8 -0
  31. data/app/concepts/kono_utils/object/cell/forms/field_selector.rb +77 -0
  32. data/app/concepts/kono_utils/object/cell/forms/field_selectors/layout.rb +7 -0
  33. data/app/concepts/kono_utils/object/cell/forms/field_selectors/modal_layout.rb +7 -0
  34. data/app/concepts/kono_utils/object/cell/forms/field_selectors/table_layout.rb +8 -0
  35. data/app/concepts/kono_utils/object/cell/forms/fields/association.rb +7 -0
  36. data/app/concepts/kono_utils/object/cell/forms/fields/base.rb +25 -0
  37. data/app/concepts/kono_utils/object/cell/forms/fields/bases/layout.rb +24 -0
  38. data/app/concepts/kono_utils/object/cell/forms/fields/bases/modal_layout.rb +7 -0
  39. data/app/concepts/kono_utils/object/cell/forms/fields/bases/table_layout.rb +11 -0
  40. data/app/concepts/kono_utils/object/cell/forms/fields/check_box.rb +10 -0
  41. data/app/concepts/kono_utils/object/cell/forms/fields/collection.rb +17 -0
  42. data/app/concepts/kono_utils/object/cell/forms/fields/date_field.rb +15 -0
  43. data/app/concepts/kono_utils/object/cell/forms/fields/date_time_field.rb +51 -0
  44. data/app/concepts/kono_utils/object/cell/forms/fields/enum.rb +20 -0
  45. data/app/concepts/kono_utils/object/cell/forms/fields/file_field.rb +31 -0
  46. data/app/concepts/kono_utils/object/cell/forms/fields/nested_modal_wrapper.rb +6 -0
  47. data/app/concepts/kono_utils/object/cell/forms/fields/nested_modal_wrappers/forms_container.rb +9 -0
  48. data/app/concepts/kono_utils/object/cell/forms/fields/nested_modal_wrappers/show.rb +14 -0
  49. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrapper.rb +63 -0
  50. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/form.rb +38 -0
  51. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms/layout.rb +13 -0
  52. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms/modal_layout.rb +7 -0
  53. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms/table_layout.rb +7 -0
  54. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms_container.rb +45 -0
  55. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms_containers/layout.rb +15 -0
  56. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms_containers/modal_layout.rb +9 -0
  57. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms_containers/table_layout.rb +16 -0
  58. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/header.rb +31 -0
  59. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/remove_button.rb +44 -0
  60. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/remove_buttons/layout.rb +10 -0
  61. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/remove_buttons/modal_layout.rb +7 -0
  62. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/remove_buttons/table_layout.rb +7 -0
  63. data/app/concepts/kono_utils/object/cell/forms/fields/read_only.rb +15 -0
  64. data/app/concepts/kono_utils/object/cell/forms/fields/time_field.rb +11 -0
  65. data/app/concepts/kono_utils/object/cell/forms/layout.rb +7 -0
  66. data/app/concepts/kono_utils/object/cell/forms/submit.rb +22 -0
  67. data/app/concepts/kono_utils/object/cell/index/base.rb +12 -0
  68. data/app/concepts/kono_utils/object/cell/index/page_title.rb +10 -0
  69. data/app/concepts/kono_utils/object/cell/index/row.rb +40 -0
  70. data/app/concepts/kono_utils/object/cell/index/row_buttons.rb +7 -0
  71. data/app/concepts/kono_utils/object/cell/index/row_footer.rb +6 -0
  72. data/app/concepts/kono_utils/object/cell/index/row_header.rb +11 -0
  73. data/app/concepts/kono_utils/object/cell/index/side_title.rb +5 -0
  74. data/app/concepts/kono_utils/object/cell/index/table.rb +15 -0
  75. data/app/concepts/kono_utils/object/cell/inject.rb +122 -0
  76. data/app/concepts/kono_utils/object/cell/modals/base.rb +6 -0
  77. data/app/concepts/kono_utils/object/cell/modals/bodies/layout.rb +7 -0
  78. data/app/concepts/kono_utils/object/cell/modals/body.rb +6 -0
  79. data/app/concepts/kono_utils/object/cell/modals/container.rb +24 -0
  80. data/app/concepts/kono_utils/object/cell/modals/containers/layout.rb +10 -0
  81. data/app/concepts/kono_utils/object/cell/modals/footer.rb +6 -0
  82. data/app/concepts/kono_utils/object/cell/modals/footers/layout.rb +7 -0
  83. data/app/concepts/kono_utils/object/cell/modals/header.rb +6 -0
  84. data/app/concepts/kono_utils/object/cell/modals/headers/layout.rb +7 -0
  85. data/app/concepts/kono_utils/object/cell/search.rb +27 -0
  86. data/app/concepts/kono_utils/object/cell/searches/form.rb +14 -0
  87. data/app/concepts/kono_utils/object/cell/show.rb +26 -0
  88. data/app/concepts/kono_utils/object/cell/shows/base.rb +8 -0
  89. data/app/concepts/kono_utils/object/cell/shows/page_title.rb +10 -0
  90. data/app/concepts/kono_utils/object/cell/shows/side_title.rb +5 -0
  91. data/app/concepts/kono_utils/object/view/create/side_title.erb +1 -0
  92. data/app/concepts/kono_utils/object/view/edits/side_title.erb +1 -0
  93. data/app/concepts/kono_utils/object/view/form.erb +9 -0
  94. data/app/concepts/kono_utils/object/view/forms/container.erb +5 -0
  95. data/app/concepts/kono_utils/object/view/forms/containers/layout.erb +3 -0
  96. data/app/concepts/kono_utils/object/view/forms/containers/modal_layout.erb +5 -0
  97. data/app/concepts/kono_utils/object/view/forms/containers/search_layout.erb +1 -0
  98. data/app/concepts/kono_utils/object/view/forms/containers/table_layout.erb +1 -0
  99. data/app/concepts/kono_utils/object/view/forms/field_selector.erb +1 -0
  100. data/app/concepts/kono_utils/object/view/forms/field_selectors/layout.erb +1 -0
  101. data/app/concepts/kono_utils/object/view/forms/field_selectors/modal_layout.erb +1 -0
  102. data/app/concepts/kono_utils/object/view/forms/field_selectors/table_layout.erb +1 -0
  103. data/app/concepts/kono_utils/object/view/forms/fields/association.erb +1 -0
  104. data/app/concepts/kono_utils/object/view/forms/fields/base.erb +1 -0
  105. data/app/concepts/kono_utils/object/view/forms/fields/bases/layout.erb +3 -0
  106. data/app/concepts/kono_utils/object/view/forms/fields/bases/layout.scss +25 -0
  107. data/app/concepts/kono_utils/object/view/forms/fields/bases/modal_layout.erb +3 -0
  108. data/app/concepts/kono_utils/object/view/forms/fields/bases/table_layout.erb +3 -0
  109. data/app/concepts/kono_utils/object/view/forms/fields/check_box.erb +1 -0
  110. data/app/concepts/kono_utils/object/view/forms/fields/collection.erb +1 -0
  111. data/app/concepts/kono_utils/object/view/forms/fields/nested_modal_wrapper.erb +23 -0
  112. data/app/concepts/kono_utils/object/view/forms/fields/nested_modal_wrappers/forms_container.erb +12 -0
  113. data/app/concepts/kono_utils/object/view/forms/fields/nested_modal_wrappers/show.erb +28 -0
  114. data/app/concepts/kono_utils/object/view/forms/fields/nested_wrapper.erb +18 -0
  115. data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/form.erb +17 -0
  116. data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/forms/layout.erb +18 -0
  117. data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/forms/modal_layout.erb +4 -0
  118. data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/forms/table_layout.erb +4 -0
  119. data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/forms_container.erb +11 -0
  120. data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/forms_containers/layout.erb +3 -0
  121. data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/forms_containers/modal_layout.erb +3 -0
  122. data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/forms_containers/table_layout.erb +14 -0
  123. data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/header.erb +27 -0
  124. data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/remove_button.erb +28 -0
  125. data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/remove_buttons/layout.erb +1 -0
  126. data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/remove_buttons/modal_layout.erb +1 -0
  127. data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/remove_buttons/table_layout.erb +3 -0
  128. data/app/concepts/kono_utils/object/view/forms/layout.erb +1 -0
  129. data/app/concepts/kono_utils/object/view/index/row.erb +10 -0
  130. data/app/concepts/kono_utils/object/view/index/row_buttons.erb +2 -0
  131. data/app/concepts/kono_utils/object/view/index/row_footer.erb +0 -0
  132. data/app/concepts/kono_utils/object/view/index/row_header.erb +8 -0
  133. data/app/concepts/kono_utils/object/view/index/side_title.erb +1 -0
  134. data/app/concepts/kono_utils/object/view/index/table.erb +9 -0
  135. data/app/concepts/kono_utils/object/view/inject.erb +8 -0
  136. data/app/concepts/kono_utils/object/view/modals/bodies/layout.erb +3 -0
  137. data/app/concepts/kono_utils/object/view/modals/body.erb +1 -0
  138. data/app/concepts/kono_utils/object/view/modals/container.erb +13 -0
  139. data/app/concepts/kono_utils/object/view/modals/containers/layout.erb +7 -0
  140. data/app/concepts/kono_utils/object/view/modals/footer.erb +1 -0
  141. data/app/concepts/kono_utils/object/view/modals/footers/layout.erb +3 -0
  142. data/app/concepts/kono_utils/object/view/modals/header.erb +1 -0
  143. data/app/concepts/kono_utils/object/view/modals/headers/layout.erb +3 -0
  144. data/app/concepts/kono_utils/object/view/search.erb +40 -0
  145. data/app/concepts/kono_utils/object/view/searches/form.erb +16 -0
  146. data/app/concepts/kono_utils/object/view/show.erb +6 -0
  147. data/app/concepts/kono_utils/object/view/shows/side_title.erb +1 -0
  148. data/app/inputs/file_input_download_input.rb +22 -0
  149. data/app/inputs/tempus_dominus_input.rb +38 -0
  150. data/app/views/kaminari/_first_page.html.erb +3 -0
  151. data/app/views/kaminari/_gap.html.erb +3 -0
  152. data/app/views/kaminari/_last_page.html.erb +3 -0
  153. data/app/views/kaminari/_next_page.html.erb +3 -0
  154. data/app/views/kaminari/_page.html.erb +9 -0
  155. data/app/views/kaminari/_paginator.html.erb +17 -0
  156. data/app/views/kaminari/_prev_page.html.erb +3 -0
  157. data/app/views/kono_utils/base_editing/edit.html.erb +8 -0
  158. data/app/views/kono_utils/base_editing/edit.inject.erb +2 -0
  159. data/app/views/kono_utils/base_editing/index.html.erb +10 -0
  160. data/app/views/kono_utils/base_editing/new.html.erb +9 -0
  161. data/app/views/kono_utils/base_editing/new.inject.erb +2 -0
  162. data/app/views/kono_utils/base_editing/show.html.erb +8 -0
  163. data/app/views/kono_utils/base_editing/success_create_show.inject.erb +6 -0
  164. data/app/views/kono_utils/base_editing/success_update_show.inject.erb +6 -0
  165. data/config/initializers/kaminari_config.rb +30 -0
  166. data/config/initializers/simple_form.rb +179 -0
  167. data/config/initializers/simple_form_bootstrap.rb +439 -0
  168. data/config/locales/kono_utils_bootstrap4.en.yml +15 -0
  169. data/config/locales/kono_utils_bootstrap4.it.yml +15 -0
  170. data/config/locales/simple_form.en.yml +31 -0
  171. data/config/routes.rb +2 -0
  172. data/lib/generators/kono_utils_bootstrap_view4/concept/concept_generator.rb +79 -0
  173. data/lib/generators/kono_utils_bootstrap_view4/concept/templates/form.template +8 -0
  174. data/lib/generators/kono_utils_bootstrap_view4/concept/templates/forms/field_selector.template +13 -0
  175. data/lib/generators/kono_utils_bootstrap_view4/install/install_generator.rb +76 -0
  176. data/lib/generators/kono_utils_bootstrap_view4/install/templates/kono_utils_bootstrap_view4.js.erb.template +20 -0
  177. data/lib/generators/kono_utils_bootstrap_view4/install/templates/kono_utils_bootstrap_view4.template +5 -0
  178. data/lib/kono_utils_bootstrap_view4.rb +26 -0
  179. data/lib/kono_utils_bootstrap_view4/application_icon_helper.rb +31 -0
  180. data/lib/kono_utils_bootstrap_view4/base_class_concept_ns.rb +47 -0
  181. data/lib/kono_utils_bootstrap_view4/base_search.rb +5 -0
  182. data/lib/kono_utils_bootstrap_view4/configuration.rb +20 -0
  183. data/lib/kono_utils_bootstrap_view4/editable_field.rb +63 -0
  184. data/lib/kono_utils_bootstrap_view4/engine.rb +59 -0
  185. data/lib/kono_utils_bootstrap_view4/paginate_proxer.rb +11 -0
  186. data/lib/kono_utils_bootstrap_view4/search_form_builder.rb +14 -0
  187. data/lib/kono_utils_bootstrap_view4/version.rb +3 -0
  188. data/lib/tasks/kono_utils_bootstrap_view4_tasks.rake +4 -0
  189. data/lib/templates/erb/scaffold/_form.html.erb +15 -0
  190. metadata +391 -0
@@ -0,0 +1,8 @@
1
+ <tr>
2
+ <% table_columns.each do |t| %>
3
+ <%= column_builder(t, :th) do %>
4
+ <%= print_column(t) %>
5
+ <% end %>
6
+ <% end %>
7
+ <th class="index-col-btn"></th>
8
+ </tr>
@@ -0,0 +1 @@
1
+ <%= concept("cell/buttons/create", base_class.new) if policy(base_class.new).new? %>
@@ -0,0 +1,9 @@
1
+ <%= pagination_top %>
2
+
3
+ <table class="table table-bordered table-hover">
4
+ <thead><%= concept("cell/index/row_header") %></thead>
5
+ <tbody><%= concept("cell/index/row", collection: model) %></tbody>
6
+ <tfoot><%= concept("cell/index/row_footer") %></tfoot>
7
+ </table>
8
+
9
+ <%= pagination_bottom %>
@@ -0,0 +1,8 @@
1
+ <% if target_container %>
2
+ var content = KonoUtilsBootstrap4.b64DecodeUnicode("<%= Base64.strict_encode64(form_content.to_s) -%>");
3
+ $("<%= target_container %>").<%= html_manipulation_method %>(content);
4
+ <% else %>
5
+ console.warn("Devi passare in params kono_utils[target_container]=valore dove valore è il "+
6
+ "selettore css del componente che tramite il metodo jquery "+
7
+ "<%= html_manipulation_method.upcase %> modificherà il contenuto che generiamo")
8
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <div class="modal-body">
2
+ <%= yield %>
3
+ </div>
@@ -0,0 +1 @@
1
+ <%= model.to_s %>
@@ -0,0 +1,13 @@
1
+ <%= concept("cell/modals/header", model, layout: layout_ns("cell/modals/headers/layout")) if have_header? %>
2
+ <%= concept("cell/modals/body", model, layout: layout_ns("cell/modals/bodies/layout")) %>
3
+ <%= concept("cell/modals/footer", model, layout: layout_ns("cell/modals/footers/layout")) if have_footer? %>
4
+
5
+ <script type="application/javascript">
6
+ var modal = $('#<%=modal_container_id %>');
7
+ modal.modal();
8
+ // codice per auto chiudere la modal una volta che si è spedita la form interna
9
+ modal.on('ajax:send', 'form', function (form) {
10
+ modal.modal('hide');
11
+ console.log('completato');
12
+ });
13
+ </script>
@@ -0,0 +1,7 @@
1
+ <div class="modal" tabindex="-1" role="dialog" id="<%= modal_container_id %>">
2
+ <div class="modal-dialog" role="document">
3
+ <div class="modal-content">
4
+ <%= yield %>
5
+ </div>
6
+ </div>
7
+ </div>
@@ -0,0 +1 @@
1
+ <%= model.to_footer %>
@@ -0,0 +1,3 @@
1
+ <div class="modal-footer">
2
+ <%= yield %>
3
+ </div>
@@ -0,0 +1 @@
1
+ <%= model.to_header %>
@@ -0,0 +1,3 @@
1
+ <div class="modal-header">
2
+ <%= yield %>
3
+ </div>
@@ -0,0 +1,40 @@
1
+ <div class="card search_panel">
2
+ <div class="card-header">
3
+ <div class="collapse_search" data-toggle="collapse" data-target="#<%= collapse_container_id %>">
4
+ <span><%= t(:search) %></span>
5
+ <div class="float-right icon-search">
6
+ <%= concept("cell/buttons/collapse_search", model.search_form_builder.to_model,
7
+ layout: form_layout,
8
+ collapsed_target: "##{collapse_container_id}") %>
9
+ </div>
10
+ </div>
11
+ </div>
12
+
13
+
14
+ <div id="<%= collapse_container_id %>" class="collapsible_panel collapse <%= data_loaded? ? 'show' : '' %>">
15
+ <div class="card-body">
16
+ <%= concept("cell/searches/form", model.search_form_builder.to_model,
17
+ layout: form_layout,
18
+ form_options: {url: model.search_form_builder.search_path, method: :get},
19
+ context: {base_class: model.search_form_builder.to_model.class}) %>
20
+ </div>
21
+
22
+ <!-- <div class="card-footer text-right text-muted">-->
23
+
24
+ <!-- < %= button_tag(t(:search), type: "submit", class: "btn btn-primary") %>-->
25
+
26
+
27
+ <!-- < % if search_model.data_loaded? and !reset_path.nil? %>-->
28
+ <!-- < %= link_to(content_tag(:span, nil, class: 'glyphicon glyphicon-remove'), reset_path, class: 'btn btn-info') %>-->
29
+ <!-- < % end %>-->
30
+
31
+
32
+ <!-- < % bf = ActiveSupport::SafeBuffer.new-->
33
+ <!-- buttons_editor.call(form, bf)-->
34
+ <!-- % >-->
35
+ <!-- < %= bf %>-->
36
+
37
+ <!-- </div>-->
38
+ </div>
39
+
40
+ </div>
@@ -0,0 +1,16 @@
1
+ <%= simple_form_for(*forms_options) do |f| %>
2
+
3
+ <%= concept("cell/forms/container", model, context: {form: f}, layout: container_layout) %>
4
+
5
+ <%= hidden_field_tag "kono_utils[form_id]", form_id %>
6
+
7
+ <div class="row">
8
+ <div class="col-md">
9
+ <div class="float-right">
10
+ <%= concept("cell/forms/submit", nil, context: {form: f}) %>
11
+ <%= concept("cell/buttons/reset_search", model.search_form_builder.to_model) %>
12
+ </div>
13
+ </div>
14
+ </div>
15
+
16
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <dl class="row">
2
+ <% displayable_attributes.each do |l| %>
3
+ <dt class="col-sm-3"><%= field_description(l) %></dt>
4
+ <dd class="col-sm-9"><%= get_field(l) %></dd>
5
+ <% end %>
6
+ </dl>
@@ -0,0 +1 @@
1
+ <%= concept("cell/buttons/list", base_class) if policy(base_class.new).index? %>
@@ -0,0 +1,22 @@
1
+ class FileInputDownloadInput < SimpleForm::Inputs::FileInput
2
+ def input(wrapper_options)
3
+
4
+ template.content_tag(:div, class: 'input-group') do
5
+
6
+ tmp = ActiveSupport::SafeBuffer.new
7
+
8
+ tmp << super
9
+ tmp << div_button { options[:download_button].show } if options[:download_button]
10
+ tmp << div_button { options[:remove_checkbox].show } if options[:remove_checkbox]
11
+
12
+ tmp
13
+ end
14
+ end
15
+
16
+ def div_button
17
+ template.content_tag(:div, class: 'input-group-append') do
18
+ yield
19
+ end
20
+ end
21
+
22
+ end
@@ -0,0 +1,38 @@
1
+ class TempusDominusInput < SimpleForm::Inputs::Base
2
+ def input(wrapper_options)
3
+
4
+ template.content_tag(:div, class: 'input-group date', data: {target_input: 'nearest'}, id: options[:date_time_picker_identifier]) do
5
+
6
+ tmp = ActiveSupport::SafeBuffer.new
7
+
8
+ tmp << @builder.text_field(attribute_name, input_html_options)
9
+ tmp << div_button
10
+
11
+ tmp
12
+ end
13
+ end
14
+
15
+ def input_html_options
16
+ super.merge({class: 'form-control datetimepicker-input'})
17
+ end
18
+
19
+ def div_button
20
+ template.content_tag(:div, class: 'input-group-append', data: {target: "##{options[:date_time_picker_identifier]}", toggle: 'datetimepicker'}) do
21
+ span_table
22
+ end
23
+ end
24
+
25
+ def span_table
26
+ template.content_tag(:div, class: 'input-group-text') do
27
+ icon_table
28
+ end
29
+ end
30
+
31
+ def icon_remove
32
+ "<i class='glyphicon glyphicon-remove'></i>".html_safe
33
+ end
34
+
35
+ def icon_table
36
+ "<i class='fa fa-calendar'></i>".html_safe
37
+ end
38
+ end
@@ -0,0 +1,3 @@
1
+ <li class="page-item">
2
+ <%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote, class: 'page-link' %>
3
+ </li>
@@ -0,0 +1,3 @@
1
+ <li class='page-item disabled'>
2
+ <%= link_to raw(t 'views.pagination.truncate'), '#', class: 'page-link' %>
3
+ </li>
@@ -0,0 +1,3 @@
1
+ <li class="page-item">
2
+ <%= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, remote: remote, class: 'page-link' %>
3
+ </li>
@@ -0,0 +1,3 @@
1
+ <li class="page-item">
2
+ <%= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, rel: 'next', remote: remote, class: 'page-link' %>
3
+ </li>
@@ -0,0 +1,9 @@
1
+ <% if page.current? %>
2
+ <li class="page-item active">
3
+ <%= content_tag :a, page, data: { remote: remote }, rel: page.rel, class: 'page-link' %>
4
+ </li>
5
+ <% else %>
6
+ <li class="page-item">
7
+ <%= link_to page, url, remote: remote, rel: page.rel, class: 'page-link' %>
8
+ </li>
9
+ <% end %>
@@ -0,0 +1,17 @@
1
+ <%= paginator.render do %>
2
+ <nav>
3
+ <ul class="pagination">
4
+ <%= first_page_tag unless current_page.first? %>
5
+ <%= prev_page_tag unless current_page.first? %>
6
+ <% each_page do |page| %>
7
+ <% if page.left_outer? || page.right_outer? || page.inside_window? %>
8
+ <%= page_tag page %>
9
+ <% elsif !page.was_truncated? -%>
10
+ <%= gap_tag %>
11
+ <% end %>
12
+ <% end %>
13
+ <%= next_page_tag unless current_page.last? %>
14
+ <%= last_page_tag unless current_page.last? %>
15
+ </ul>
16
+ </nav>
17
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <li class="page-item">
2
+ <%= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, rel: 'prev', remote: remote, class: 'page-link' %>
3
+ </li>
@@ -0,0 +1,8 @@
1
+ <% content_for :page_title do %>
2
+ <%= concept(base_class.concept_ns("cell/edits/page_title"), @object, context: {current_user: current_user,base_class:base_class}) %>
3
+ <% end %>
4
+ <% content_for :side_title do %>
5
+ <%= concept(base_class.concept_ns("cell/edits/side_title"), @object, context: {current_user: current_user,base_class:base_class}) %>
6
+ <% end %>
7
+
8
+ <%= concept(base_class.concept_ns("cell/form"), @object, context: {current_user: current_user,base_class:base_class}) %>
@@ -0,0 +1,2 @@
1
+ <%= concept(@object.class.concept_ns("cell/inject"), @object,
2
+ params: params, context: {current_user: current_user, base_class: @object.class}) -%>
@@ -0,0 +1,10 @@
1
+ <% content_for(:page_title) do %>
2
+ <%= concept(base_class.concept_ns("cell/index/page_title"), @objects, context: {current_user: current_user,base_class:base_class}) %>
3
+ <% end %>
4
+ <% content_for(:side_title) do %>
5
+ <%= concept(base_class.concept_ns("cell/index/side_title"), @objects, context: {current_user: current_user,base_class:base_class}) %>
6
+ <% end %>
7
+
8
+ <%= concept(base_class.concept_ns("cell/search"), @search, context: {current_user: current_user,base_class:base_class}) unless @search.nil? %>
9
+
10
+ <%= concept(base_class.concept_ns("cell/index/table"), @objects, context: {current_user: current_user,base_class:base_class}) %>
@@ -0,0 +1,9 @@
1
+ <% content_for(:page_title) do %>
2
+ <%= concept(base_class.concept_ns("cell/create/page_title"), @object, context: {current_user: current_user,base_class:base_class}) %>
3
+ <% end %>
4
+ <% content_for(:side_title) do %>
5
+ <%= concept(base_class.concept_ns("cell/create/side_title"), @object, context: {current_user: current_user,base_class:base_class}) %>
6
+ <% end %>
7
+
8
+
9
+ <%= concept(base_class.concept_ns("cell/form"), @object, context: {current_user: current_user,base_class:base_class}) %>
@@ -0,0 +1,2 @@
1
+ <%= concept(@object.class.concept_ns("cell/inject"), @object,
2
+ params: params, context: {current_user: current_user, base_class: @object.class}) -%>
@@ -0,0 +1,8 @@
1
+ <% content_for :page_title do %>
2
+ <%= concept(base_class.concept_ns("cell/shows/page_title"), @object, context: {current_user: current_user,base_class:base_class}) %>
3
+ <% end %>
4
+ <% content_for :side_title do %>
5
+ <%= concept(base_class.concept_ns("cell/shows/side_title"), @object, context: {current_user: current_user,base_class:base_class}) %>
6
+ <% end %>
7
+
8
+ <%= concept(base_class.concept_ns("cell/show"), @object, context: {current_user: current_user,base_class:base_class}) %>
@@ -0,0 +1,6 @@
1
+ <%= concept(@object.class.concept_ns("cell/inject"), @object,
2
+ params: params,
3
+ # target: params[:kono_utils][:modal_upgraded_target_container],
4
+ html_manipulation_method: 'append',
5
+ inject_show_modal: true,
6
+ context: {current_user: current_user, base_class: @object.class}) -%>
@@ -0,0 +1,6 @@
1
+ <%= concept(@object.class.concept_ns("cell/inject"), @object,
2
+ params: params,
3
+ # target: params[:kono_utils][:modal_upgraded_target_container],
4
+ html_manipulation_method: 'replaceWith',
5
+ inject_show_modal: true,
6
+ context: {current_user: current_user, base_class: @object.class}) -%>
@@ -0,0 +1,30 @@
1
+ Kaminari::Helpers::Tag.class_eval do
2
+ def to_s(locals = {}) #:nodoc:
3
+ @template.render(
4
+ :partial => "../views/kaminari/#{@theme}#{self.class.name.demodulize.underscore}",
5
+ :formats => [:html],
6
+ :locals => @options.merge(locals)
7
+ )
8
+ end
9
+ end
10
+
11
+ # override per motivi inspiegabili
12
+ Kaminari::Helpers::Paginator.class_eval do
13
+ def render(&block)
14
+ @output_buffer<< instance_eval(&block).html_safe if @options[:total_pages] > 1
15
+ @output_buffer
16
+ end
17
+ end
18
+
19
+ # frozen_string_literal: true
20
+ Kaminari.configure do |config|
21
+ # config.default_per_page = 25
22
+ # config.max_per_page = nil
23
+ # config.window = 4
24
+ # config.outer_window = 0
25
+ # config.left = 0
26
+ # config.right = 0
27
+ # config.page_method_name = :page
28
+ # config.param_name = :page
29
+ # config.params_on_first_page = false
30
+ end
@@ -0,0 +1,179 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # Uncomment this and change the path if necessary to include your own
4
+ # components.
5
+ # See https://github.com/plataformatec/simple_form#custom-components to know
6
+ # more about custom components.
7
+ # Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f }
8
+ #
9
+ # Use this setup block to configure all options available in SimpleForm.
10
+ SimpleForm.setup do |config|
11
+ # Wrappers are used by the form builder to generate a
12
+ # complete input. You can remove any component from the
13
+ # wrapper, change the order or even add your own to the
14
+ # stack. The options given below are used to wrap the
15
+ # whole input.
16
+ config.wrappers :default, class: :input,
17
+ hint_class: :field_with_hint, error_class: :field_with_errors, valid_class: :field_without_errors do |b|
18
+ ## Extensions enabled by default
19
+ # Any of these extensions can be disabled for a
20
+ # given input by passing: `f.input EXTENSION_NAME => false`.
21
+ # You can make any of these extensions optional by
22
+ # renaming `b.use` to `b.optional`.
23
+
24
+ # Determines whether to use HTML5 (:email, :url, ...)
25
+ # and required attributes
26
+ b.use :html5
27
+
28
+ # Calculates placeholders automatically from I18n
29
+ # You can also pass a string as f.input placeholder: "Placeholder"
30
+ b.use :placeholder
31
+
32
+ ## Optional extensions
33
+ # They are disabled unless you pass `f.input EXTENSION_NAME => true`
34
+ # to the input. If so, they will retrieve the values from the model
35
+ # if any exists. If you want to enable any of those
36
+ # extensions by default, you can change `b.optional` to `b.use`.
37
+
38
+ # Calculates maxlength from length validations for string inputs
39
+ # and/or database column lengths
40
+ b.optional :maxlength
41
+
42
+ # Calculate minlength from length validations for string inputs
43
+ b.optional :minlength
44
+
45
+ # Calculates pattern from format validations for string inputs
46
+ b.optional :pattern
47
+
48
+ # Calculates min and max from length validations for numeric inputs
49
+ b.optional :min_max
50
+
51
+ # Calculates readonly automatically from readonly attributes
52
+ b.optional :readonly
53
+
54
+ ## Inputs
55
+ # b.use :input, class: 'input', error_class: 'is-invalid', valid_class: 'is-valid'
56
+ b.use :label_input
57
+ b.use :hint, wrap_with: { tag: :span, class: :hint }
58
+ b.use :error, wrap_with: { tag: :span, class: :error }
59
+
60
+ ## full_messages_for
61
+ # If you want to display the full error message for the attribute, you can
62
+ # use the component :full_error, like:
63
+ #
64
+ # b.use :full_error, wrap_with: { tag: :span, class: :error }
65
+ end
66
+
67
+ # The default wrapper to be used by the FormBuilder.
68
+ config.default_wrapper = :default
69
+
70
+ # Define the way to render check boxes / radio buttons with labels.
71
+ # Defaults to :nested for bootstrap config.
72
+ # inline: input + label
73
+ # nested: label > input
74
+ config.boolean_style = :nested
75
+
76
+ # Default class for buttons
77
+ config.button_class = 'btn'
78
+
79
+ # Method used to tidy up errors. Specify any Rails Array method.
80
+ # :first lists the first message for each field.
81
+ # Use :to_sentence to list all errors for each field.
82
+ # config.error_method = :first
83
+
84
+ # Default tag used for error notification helper.
85
+ config.error_notification_tag = :div
86
+
87
+ # CSS class to add for error notification helper.
88
+ config.error_notification_class = 'error_notification'
89
+
90
+ # Series of attempts to detect a default label method for collection.
91
+ # config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
92
+
93
+ # Series of attempts to detect a default value method for collection.
94
+ # config.collection_value_methods = [ :id, :to_s ]
95
+
96
+ # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
97
+ # config.collection_wrapper_tag = nil
98
+
99
+ # You can define the class to use on all collection wrappers. Defaulting to none.
100
+ # config.collection_wrapper_class = nil
101
+
102
+ # You can wrap each item in a collection of radio/check boxes with a tag,
103
+ # defaulting to :span.
104
+ # config.item_wrapper_tag = :span
105
+
106
+ # You can define a class to use in all item wrappers. Defaulting to none.
107
+ # config.item_wrapper_class = nil
108
+
109
+ # How the label text should be generated altogether with the required text.
110
+ # config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" }
111
+
112
+ # You can define the class to use on all labels. Default is nil.
113
+ # config.label_class = nil
114
+
115
+ # You can define the default class to be used on forms. Can be overriden
116
+ # with `html: { :class }`. Defaulting to none.
117
+ # config.default_form_class = nil
118
+
119
+ # You can define which elements should obtain additional classes
120
+ # config.generate_additional_classes_for = [:wrapper, :label, :input]
121
+
122
+ # Whether attributes are required by default (or not). Default is true.
123
+ # config.required_by_default = true
124
+
125
+ # Tell browsers whether to use the native HTML5 validations (novalidate form option).
126
+ # These validations are enabled in SimpleForm's internal config but disabled by default
127
+ # in this configuration, which is recommended due to some quirks from different browsers.
128
+ # To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,
129
+ # change this configuration to true.
130
+ config.browser_validations = false
131
+
132
+ # Collection of methods to detect if a file type was given.
133
+ # config.file_methods = [ :mounted_as, :file?, :public_filename, :attached? ]
134
+
135
+ # Custom mappings for input types. This should be a hash containing a regexp
136
+ # to match as key, and the input type that will be used when the field name
137
+ # matches the regexp as value.
138
+ # config.input_mappings = { /count/ => :integer }
139
+
140
+ # Custom wrappers for input types. This should be a hash containing an input
141
+ # type as key and the wrapper that will be used for all inputs with specified type.
142
+ # config.wrapper_mappings = { string: :prepend }
143
+
144
+ # Namespaces where SimpleForm should look for custom input classes that
145
+ # override default inputs.
146
+ # config.custom_inputs_namespaces << "CustomInputs"
147
+
148
+ # Default priority for time_zone inputs.
149
+ # config.time_zone_priority = nil
150
+
151
+ # Default priority for country inputs.
152
+ # config.country_priority = nil
153
+
154
+ # When false, do not use translations for labels.
155
+ # config.translate_labels = true
156
+
157
+ # Automatically discover new inputs in Rails' autoload path.
158
+ # config.inputs_discovery = true
159
+
160
+ # Cache SimpleForm inputs discovery
161
+ # config.cache_discovery = !Rails.env.development?
162
+
163
+ # Default class for inputs
164
+ # config.input_class = nil
165
+
166
+ # Define the default class of the input wrapper of the boolean input.
167
+ config.boolean_label_class = 'checkbox'
168
+
169
+ # Defines if the default input wrapper class should be included in radio
170
+ # collection wrappers.
171
+ # config.include_default_input_wrapper_class = true
172
+
173
+ # Defines which i18n scope will be used in Simple Form.
174
+ # config.i18n_scope = 'simple_form'
175
+
176
+ # Defines validation classes to the input_field. By default it's nil.
177
+ # config.input_field_valid_class = 'is-valid'
178
+ # config.input_field_error_class = 'is-invalid'
179
+ end