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.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +21 -0
- data/Rakefile +32 -0
- data/app/assets/config/kono_utils_bootstrap_view4_manifest.js +0 -0
- data/app/assets/javascripts/kono_utils_bootstrap_view4/application.js.erb +12 -0
- data/app/assets/javascripts/kono_utils_bootstrap_view4/kono_utils_bootstrap_view4.js +36 -0
- data/app/assets/stylesheets/kono_utils_bootstrap_view4/application.css.scss.erb +12 -0
- data/app/concepts/kono_utils/object/cell/base.rb +123 -0
- data/app/concepts/kono_utils/object/cell/buttons/base.rb +57 -0
- data/app/concepts/kono_utils/object/cell/buttons/collapse_search.rb +31 -0
- data/app/concepts/kono_utils/object/cell/buttons/create.rb +22 -0
- data/app/concepts/kono_utils/object/cell/buttons/delete.rb +32 -0
- data/app/concepts/kono_utils/object/cell/buttons/download.rb +23 -0
- data/app/concepts/kono_utils/object/cell/buttons/edit.rb +18 -0
- data/app/concepts/kono_utils/object/cell/buttons/list.rb +17 -0
- data/app/concepts/kono_utils/object/cell/buttons/reset_search.rb +21 -0
- data/app/concepts/kono_utils/object/cell/create/base.rb +8 -0
- data/app/concepts/kono_utils/object/cell/create/page_title.rb +10 -0
- data/app/concepts/kono_utils/object/cell/create/side_title.rb +5 -0
- data/app/concepts/kono_utils/object/cell/edits/base.rb +8 -0
- data/app/concepts/kono_utils/object/cell/edits/page_title.rb +10 -0
- data/app/concepts/kono_utils/object/cell/edits/side_title.rb +5 -0
- data/app/concepts/kono_utils/object/cell/form.rb +51 -0
- data/app/concepts/kono_utils/object/cell/forms/base.rb +13 -0
- data/app/concepts/kono_utils/object/cell/forms/container.rb +25 -0
- data/app/concepts/kono_utils/object/cell/forms/containers/layout.rb +16 -0
- data/app/concepts/kono_utils/object/cell/forms/containers/modal_layout.rb +7 -0
- data/app/concepts/kono_utils/object/cell/forms/containers/search_layout.rb +7 -0
- data/app/concepts/kono_utils/object/cell/forms/containers/table_layout.rb +8 -0
- data/app/concepts/kono_utils/object/cell/forms/field_selector.rb +77 -0
- data/app/concepts/kono_utils/object/cell/forms/field_selectors/layout.rb +7 -0
- data/app/concepts/kono_utils/object/cell/forms/field_selectors/modal_layout.rb +7 -0
- data/app/concepts/kono_utils/object/cell/forms/field_selectors/table_layout.rb +8 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/association.rb +7 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/base.rb +25 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/bases/layout.rb +24 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/bases/modal_layout.rb +7 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/bases/table_layout.rb +11 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/check_box.rb +10 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/collection.rb +17 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/date_field.rb +15 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/date_time_field.rb +51 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/enum.rb +20 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/file_field.rb +31 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_modal_wrapper.rb +6 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_modal_wrappers/forms_container.rb +9 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_modal_wrappers/show.rb +14 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrapper.rb +63 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/form.rb +38 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms/layout.rb +13 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms/modal_layout.rb +7 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms/table_layout.rb +7 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms_container.rb +45 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms_containers/layout.rb +15 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms_containers/modal_layout.rb +9 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms_containers/table_layout.rb +16 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/header.rb +31 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/remove_button.rb +44 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/remove_buttons/layout.rb +10 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/remove_buttons/modal_layout.rb +7 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/remove_buttons/table_layout.rb +7 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/read_only.rb +15 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/time_field.rb +11 -0
- data/app/concepts/kono_utils/object/cell/forms/layout.rb +7 -0
- data/app/concepts/kono_utils/object/cell/forms/submit.rb +22 -0
- data/app/concepts/kono_utils/object/cell/index/base.rb +12 -0
- data/app/concepts/kono_utils/object/cell/index/page_title.rb +10 -0
- data/app/concepts/kono_utils/object/cell/index/row.rb +40 -0
- data/app/concepts/kono_utils/object/cell/index/row_buttons.rb +7 -0
- data/app/concepts/kono_utils/object/cell/index/row_footer.rb +6 -0
- data/app/concepts/kono_utils/object/cell/index/row_header.rb +11 -0
- data/app/concepts/kono_utils/object/cell/index/side_title.rb +5 -0
- data/app/concepts/kono_utils/object/cell/index/table.rb +15 -0
- data/app/concepts/kono_utils/object/cell/inject.rb +122 -0
- data/app/concepts/kono_utils/object/cell/modals/base.rb +6 -0
- data/app/concepts/kono_utils/object/cell/modals/bodies/layout.rb +7 -0
- data/app/concepts/kono_utils/object/cell/modals/body.rb +6 -0
- data/app/concepts/kono_utils/object/cell/modals/container.rb +24 -0
- data/app/concepts/kono_utils/object/cell/modals/containers/layout.rb +10 -0
- data/app/concepts/kono_utils/object/cell/modals/footer.rb +6 -0
- data/app/concepts/kono_utils/object/cell/modals/footers/layout.rb +7 -0
- data/app/concepts/kono_utils/object/cell/modals/header.rb +6 -0
- data/app/concepts/kono_utils/object/cell/modals/headers/layout.rb +7 -0
- data/app/concepts/kono_utils/object/cell/search.rb +27 -0
- data/app/concepts/kono_utils/object/cell/searches/form.rb +14 -0
- data/app/concepts/kono_utils/object/cell/show.rb +26 -0
- data/app/concepts/kono_utils/object/cell/shows/base.rb +8 -0
- data/app/concepts/kono_utils/object/cell/shows/page_title.rb +10 -0
- data/app/concepts/kono_utils/object/cell/shows/side_title.rb +5 -0
- data/app/concepts/kono_utils/object/view/create/side_title.erb +1 -0
- data/app/concepts/kono_utils/object/view/edits/side_title.erb +1 -0
- data/app/concepts/kono_utils/object/view/form.erb +9 -0
- data/app/concepts/kono_utils/object/view/forms/container.erb +5 -0
- data/app/concepts/kono_utils/object/view/forms/containers/layout.erb +3 -0
- data/app/concepts/kono_utils/object/view/forms/containers/modal_layout.erb +5 -0
- data/app/concepts/kono_utils/object/view/forms/containers/search_layout.erb +1 -0
- data/app/concepts/kono_utils/object/view/forms/containers/table_layout.erb +1 -0
- data/app/concepts/kono_utils/object/view/forms/field_selector.erb +1 -0
- data/app/concepts/kono_utils/object/view/forms/field_selectors/layout.erb +1 -0
- data/app/concepts/kono_utils/object/view/forms/field_selectors/modal_layout.erb +1 -0
- data/app/concepts/kono_utils/object/view/forms/field_selectors/table_layout.erb +1 -0
- data/app/concepts/kono_utils/object/view/forms/fields/association.erb +1 -0
- data/app/concepts/kono_utils/object/view/forms/fields/base.erb +1 -0
- data/app/concepts/kono_utils/object/view/forms/fields/bases/layout.erb +3 -0
- data/app/concepts/kono_utils/object/view/forms/fields/bases/layout.scss +25 -0
- data/app/concepts/kono_utils/object/view/forms/fields/bases/modal_layout.erb +3 -0
- data/app/concepts/kono_utils/object/view/forms/fields/bases/table_layout.erb +3 -0
- data/app/concepts/kono_utils/object/view/forms/fields/check_box.erb +1 -0
- data/app/concepts/kono_utils/object/view/forms/fields/collection.erb +1 -0
- data/app/concepts/kono_utils/object/view/forms/fields/nested_modal_wrapper.erb +23 -0
- data/app/concepts/kono_utils/object/view/forms/fields/nested_modal_wrappers/forms_container.erb +12 -0
- data/app/concepts/kono_utils/object/view/forms/fields/nested_modal_wrappers/show.erb +28 -0
- data/app/concepts/kono_utils/object/view/forms/fields/nested_wrapper.erb +18 -0
- data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/form.erb +17 -0
- data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/forms/layout.erb +18 -0
- data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/forms/modal_layout.erb +4 -0
- data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/forms/table_layout.erb +4 -0
- data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/forms_container.erb +11 -0
- data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/forms_containers/layout.erb +3 -0
- data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/forms_containers/modal_layout.erb +3 -0
- data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/forms_containers/table_layout.erb +14 -0
- data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/header.erb +27 -0
- data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/remove_button.erb +28 -0
- data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/remove_buttons/layout.erb +1 -0
- data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/remove_buttons/modal_layout.erb +1 -0
- data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/remove_buttons/table_layout.erb +3 -0
- data/app/concepts/kono_utils/object/view/forms/layout.erb +1 -0
- data/app/concepts/kono_utils/object/view/index/row.erb +10 -0
- data/app/concepts/kono_utils/object/view/index/row_buttons.erb +2 -0
- data/app/concepts/kono_utils/object/view/index/row_footer.erb +0 -0
- data/app/concepts/kono_utils/object/view/index/row_header.erb +8 -0
- data/app/concepts/kono_utils/object/view/index/side_title.erb +1 -0
- data/app/concepts/kono_utils/object/view/index/table.erb +9 -0
- data/app/concepts/kono_utils/object/view/inject.erb +8 -0
- data/app/concepts/kono_utils/object/view/modals/bodies/layout.erb +3 -0
- data/app/concepts/kono_utils/object/view/modals/body.erb +1 -0
- data/app/concepts/kono_utils/object/view/modals/container.erb +13 -0
- data/app/concepts/kono_utils/object/view/modals/containers/layout.erb +7 -0
- data/app/concepts/kono_utils/object/view/modals/footer.erb +1 -0
- data/app/concepts/kono_utils/object/view/modals/footers/layout.erb +3 -0
- data/app/concepts/kono_utils/object/view/modals/header.erb +1 -0
- data/app/concepts/kono_utils/object/view/modals/headers/layout.erb +3 -0
- data/app/concepts/kono_utils/object/view/search.erb +40 -0
- data/app/concepts/kono_utils/object/view/searches/form.erb +16 -0
- data/app/concepts/kono_utils/object/view/show.erb +6 -0
- data/app/concepts/kono_utils/object/view/shows/side_title.erb +1 -0
- data/app/inputs/file_input_download_input.rb +22 -0
- data/app/inputs/tempus_dominus_input.rb +38 -0
- data/app/views/kaminari/_first_page.html.erb +3 -0
- data/app/views/kaminari/_gap.html.erb +3 -0
- data/app/views/kaminari/_last_page.html.erb +3 -0
- data/app/views/kaminari/_next_page.html.erb +3 -0
- data/app/views/kaminari/_page.html.erb +9 -0
- data/app/views/kaminari/_paginator.html.erb +17 -0
- data/app/views/kaminari/_prev_page.html.erb +3 -0
- data/app/views/kono_utils/base_editing/edit.html.erb +8 -0
- data/app/views/kono_utils/base_editing/edit.inject.erb +2 -0
- data/app/views/kono_utils/base_editing/index.html.erb +10 -0
- data/app/views/kono_utils/base_editing/new.html.erb +9 -0
- data/app/views/kono_utils/base_editing/new.inject.erb +2 -0
- data/app/views/kono_utils/base_editing/show.html.erb +8 -0
- data/app/views/kono_utils/base_editing/success_create_show.inject.erb +6 -0
- data/app/views/kono_utils/base_editing/success_update_show.inject.erb +6 -0
- data/config/initializers/kaminari_config.rb +30 -0
- data/config/initializers/simple_form.rb +179 -0
- data/config/initializers/simple_form_bootstrap.rb +439 -0
- data/config/locales/kono_utils_bootstrap4.en.yml +15 -0
- data/config/locales/kono_utils_bootstrap4.it.yml +15 -0
- data/config/locales/simple_form.en.yml +31 -0
- data/config/routes.rb +2 -0
- data/lib/generators/kono_utils_bootstrap_view4/concept/concept_generator.rb +79 -0
- data/lib/generators/kono_utils_bootstrap_view4/concept/templates/form.template +8 -0
- data/lib/generators/kono_utils_bootstrap_view4/concept/templates/forms/field_selector.template +13 -0
- data/lib/generators/kono_utils_bootstrap_view4/install/install_generator.rb +76 -0
- data/lib/generators/kono_utils_bootstrap_view4/install/templates/kono_utils_bootstrap_view4.js.erb.template +20 -0
- data/lib/generators/kono_utils_bootstrap_view4/install/templates/kono_utils_bootstrap_view4.template +5 -0
- data/lib/kono_utils_bootstrap_view4.rb +26 -0
- data/lib/kono_utils_bootstrap_view4/application_icon_helper.rb +31 -0
- data/lib/kono_utils_bootstrap_view4/base_class_concept_ns.rb +47 -0
- data/lib/kono_utils_bootstrap_view4/base_search.rb +5 -0
- data/lib/kono_utils_bootstrap_view4/configuration.rb +20 -0
- data/lib/kono_utils_bootstrap_view4/editable_field.rb +63 -0
- data/lib/kono_utils_bootstrap_view4/engine.rb +59 -0
- data/lib/kono_utils_bootstrap_view4/paginate_proxer.rb +11 -0
- data/lib/kono_utils_bootstrap_view4/search_form_builder.rb +14 -0
- data/lib/kono_utils_bootstrap_view4/version.rb +3 -0
- data/lib/tasks/kono_utils_bootstrap_view4_tasks.rake +4 -0
- data/lib/templates/erb/scaffold/_form.html.erb +15 -0
- metadata +391 -0
@@ -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 @@
|
|
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 @@
|
|
1
|
+
<%= model.to_footer %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= model.to_header %>
|
@@ -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 @@
|
|
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,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,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,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,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
|