keppler 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.gitignore +8 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile.lock +26 -0
- data/LICENSE.txt +21 -0
- data/README.md +93 -22
- data/Rakefile +6 -0
- data/bin/keppler +6 -2
- data/bin/setup +2 -1
- data/exe/keppler +6 -0
- data/installer/core/.gitignore +87 -0
- data/installer/core/.ruby-version +1 -0
- data/installer/core/Gemfile +6 -4
- data/installer/core/README.md +86 -50
- data/installer/core/app/assets/images/.keep +0 -0
- data/installer/core/app/assets/images/admin/astronauta_keppler.svg +123 -0
- data/installer/core/app/assets/images/admin/avatar_keppler.svg +100 -0
- data/installer/core/app/assets/images/admin/image_default.png +0 -0
- data/installer/core/app/assets/images/app/fondo.svg +19 -0
- data/installer/core/app/assets/javascripts/admin/file_upload.coffee +11 -0
- data/installer/core/app/assets/javascripts/admin/main.coffee +23 -12
- data/installer/core/app/assets/javascripts/admin/preview_template.js +2 -2
- data/installer/core/app/assets/javascripts/admin/sidebar.js +8 -7
- data/installer/core/app/assets/javascripts/admin/swal.js +37 -0
- data/installer/core/app/assets/javascripts/admin/switch.js +6 -0
- data/installer/core/app/assets/javascripts/admin/tooltips.coffee +3 -0
- data/installer/core/app/assets/javascripts/errors/application.js.coffee +1 -0
- data/installer/core/app/assets/javascripts/errors/errors.js +113 -0
- data/installer/core/app/assets/javascripts/keppler_ga_dashboard/view-selector2.js +1 -1
- data/installer/core/app/assets/javascripts/vue_admin/index.js +34 -9
- data/installer/core/app/assets/stylesheets/admin/application.scss +4 -14
- data/installer/core/app/assets/stylesheets/admin/components/navigation/_navbar.scss +4 -5
- data/installer/core/app/assets/stylesheets/admin/components/navigation/_sidebar.scss +26 -17
- data/installer/core/app/assets/stylesheets/admin/pages/_appearance.scss +5 -0
- data/installer/core/app/assets/stylesheets/admin/pages/_customize.scss +21 -0
- data/installer/core/app/assets/stylesheets/admin/pages/_datepicker.scss +1088 -0
- data/installer/core/app/assets/stylesheets/admin/pages/_files.scss +26 -9
- data/installer/core/app/assets/stylesheets/admin/pages/_form.scss +19 -6
- data/installer/core/app/assets/stylesheets/admin/pages/_index.scss +4 -8
- data/installer/core/app/assets/stylesheets/admin/pages/_listing.scss +5 -0
- data/installer/core/app/assets/stylesheets/admin/pages/_navbar.scss +9 -2
- data/installer/core/app/assets/stylesheets/admin/pages/_roles.scss +6 -0
- data/installer/core/app/assets/stylesheets/admin/pages/_search.scss +24 -28
- data/installer/core/app/assets/stylesheets/admin/pages/_sidebar.scss +1 -1
- data/installer/core/app/assets/stylesheets/admin/pages/_switchs.scss +135 -39
- data/installer/core/app/assets/stylesheets/admin/pages/_timepicker.scss +16 -0
- data/installer/core/app/assets/stylesheets/admin/pages/_user.scss +6 -0
- data/installer/core/app/assets/stylesheets/admin/utils/_base.scss +6 -1
- data/installer/core/app/assets/stylesheets/admin/utils/_theme.scss +24 -11
- data/installer/core/app/assets/stylesheets/admin/utils/_variables.scss +1 -1
- data/installer/core/app/assets/stylesheets/app/pages/_front.sass +70 -56
- data/installer/core/app/assets/stylesheets/errors/errors.scss +161 -120
- data/installer/core/app/assets/stylesheets/vendor/admin-lte/_skin-blue.scss +1 -1
- data/installer/core/app/controllers/admin/admin_controller.rb +1 -1
- data/installer/core/app/controllers/admin/customizes_controller.rb +6 -8
- data/installer/core/app/controllers/admin/meta_tags_controller.rb +14 -18
- data/installer/core/app/controllers/admin/roles_controller.rb +176 -0
- data/installer/core/app/controllers/admin/scripts_controller.rb +14 -33
- data/installer/core/app/controllers/admin/settings_controller.rb +26 -27
- data/installer/core/app/controllers/admin/users_controller.rb +35 -29
- data/installer/core/app/controllers/app/app_controller.rb +27 -4
- data/installer/core/app/controllers/application_controller.rb +39 -1
- data/installer/core/app/controllers/concerns/.keep +0 -0
- data/installer/core/app/helpers/admin_helper.rb +5 -0
- data/installer/core/app/helpers/application_helper.rb +9 -0
- data/installer/core/app/helpers/roles_helper.rb +2 -0
- data/installer/core/app/inputs/file_material_input.rb +4 -2
- data/installer/core/app/inputs/keppler_boolean_input.rb +74 -0
- data/installer/core/app/inputs/keppler_file_input.rb +70 -0
- data/installer/core/app/mailers/.keep +0 -0
- data/installer/core/app/mailers/application_mailer.rb +13 -13
- data/installer/core/app/models/.keep +0 -0
- data/installer/core/app/models/appearance.rb +2 -0
- data/installer/core/app/models/application_record.rb +3 -0
- data/installer/core/app/models/concerns/.keep +0 -0
- data/installer/core/app/models/concerns/downloadable.rb +13 -0
- data/installer/core/app/models/concerns/sortable.rb +9 -0
- data/installer/core/app/models/concerns/uploadable.rb +10 -0
- data/installer/core/app/models/customize.rb +8 -6
- data/installer/core/app/models/front.rb +3 -0
- data/installer/core/app/models/google_analytics_setting.rb +2 -0
- data/installer/core/app/models/meta_tag.rb +27 -14
- data/installer/core/app/models/permission.rb +3 -0
- data/installer/core/app/models/role.rb +62 -5
- data/installer/core/app/models/script.rb +6 -15
- data/installer/core/app/models/setting.rb +2 -0
- data/installer/core/app/models/smtp_setting.rb +2 -0
- data/installer/core/app/models/social_account.rb +2 -0
- data/installer/core/app/models/user.rb +17 -1
- data/installer/core/app/policies/application_policy.rb +4 -4
- data/installer/core/app/policies/controller_policy.rb +15 -11
- data/installer/core/app/policies/role_policy.rb +25 -0
- data/installer/core/app/policies/user_policy.rb +1 -1
- data/installer/core/app/uploaders/attachment_uploader.rb +18 -1
- data/installer/core/app/views/admin/customizes/_description.html.haml +4 -4
- data/installer/core/app/views/admin/customizes/_form.html.haml +4 -4
- data/installer/core/app/views/admin/customizes/_listing.html.haml +1 -1
- data/installer/core/app/views/admin/customizes/_switch_default_template.html.haml +8 -13
- data/installer/core/app/views/admin/customizes/_switch_template.html.haml +8 -11
- data/installer/core/app/views/admin/customizes/index.html.haml +9 -9
- data/installer/core/app/views/admin/layouts/_head.html.haml +3 -3
- data/installer/core/app/views/admin/layouts/_keppler_boolean_script.haml +12 -0
- data/installer/core/app/views/admin/layouts/_navigation.html.haml +17 -16
- data/installer/core/app/views/admin/layouts/_sidebar.html.haml +27 -36
- data/installer/core/app/views/admin/layouts/application.html.haml +1 -0
- data/installer/core/app/views/admin/layouts/index/remote_messages.js.haml +6 -6
- data/installer/core/app/views/admin/meta_tags/_index_show.html.haml +2 -2
- data/installer/core/app/views/admin/meta_tags/_listing.html.haml +6 -6
- data/installer/core/app/views/admin/meta_tags/index.html.haml +15 -29
- data/installer/core/app/views/admin/meta_tags/show.html.haml +7 -8
- data/installer/core/app/views/admin/roles/_description.html.haml +13 -0
- data/installer/core/app/views/admin/roles/_form.html.haml +27 -0
- data/installer/core/app/views/admin/roles/_index_show.html.haml +24 -0
- data/installer/core/app/views/admin/roles/_listing.html.haml +46 -0
- data/installer/core/app/views/admin/roles/_switch.html.haml +20 -0
- data/installer/core/app/views/admin/roles/add_permissions.html.haml +60 -0
- data/installer/core/app/views/admin/roles/create_permissions.html.haml +0 -0
- data/installer/core/app/views/admin/roles/create_permissions.js.erb +1 -0
- data/installer/core/app/views/admin/roles/edit.html.haml +1 -0
- data/installer/core/app/views/admin/roles/index.html.haml +80 -0
- data/installer/core/app/views/admin/roles/new.html.haml +1 -0
- data/installer/core/app/views/admin/roles/reload.js.haml +5 -0
- data/installer/core/app/views/admin/roles/show.html.haml +32 -0
- data/installer/core/app/views/admin/roles/show.js.haml +4 -0
- data/installer/core/app/views/admin/roles/show_description.js.erb +2 -0
- data/installer/core/app/views/admin/scripts/_index_show.html.haml +2 -2
- data/installer/core/app/views/admin/scripts/_listing.html.haml +13 -13
- data/installer/core/app/views/admin/scripts/index.html.haml +12 -26
- data/installer/core/app/views/admin/scripts/show.html.haml +4 -4
- data/installer/core/app/views/admin/settings/components/_preview.html.haml +1 -1
- data/installer/core/app/views/admin/settings/fields/_appearance.html.haml +25 -17
- data/installer/core/app/views/admin/settings/fields/_basic_information.html.haml +13 -7
- data/installer/core/app/views/admin/settings/fields/_email_setting.html.haml +16 -16
- data/installer/core/app/views/admin/settings/fields/_google_analytics_setting.html.haml +1 -1
- data/installer/core/app/views/admin/settings/fields/_social_accounts.html.haml +39 -39
- data/installer/core/app/views/admin/users/_form.html.haml +18 -25
- data/installer/core/app/views/admin/users/_index_show.html.haml +2 -2
- data/installer/core/app/views/admin/users/_listing.html.haml +6 -6
- data/installer/core/app/views/admin/users/delete_avatar.js.haml +3 -0
- data/installer/core/app/views/admin/users/filter_by_role.js.erb +9 -0
- data/installer/core/app/views/admin/users/index.html.haml +22 -22
- data/installer/core/app/views/admin/users/show.html.haml +10 -12
- data/installer/core/app/views/app/front/index.html.haml +137 -87
- data/installer/core/app/views/app/layouts/_footer.html.haml +2 -2
- data/installer/core/app/views/app/layouts/_head.html.haml +4 -12
- data/installer/core/app/views/app/layouts/_meta_tags.html.haml +38 -6
- data/installer/core/app/views/app/layouts/application.html.haml +8 -8
- data/installer/core/app/views/devise/sessions/new.html.haml +32 -28
- data/installer/core/app/views/errors/internal_server_error.html.haml +50 -7
- data/installer/core/app/views/errors/not_authorized.html.haml +75 -6
- data/installer/core/app/views/errors/not_found.html.haml +101 -7
- data/installer/core/app/views/errors/unprocessable.html.haml +50 -7
- data/installer/core/bin/update +31 -0
- data/installer/core/bin/yarn +11 -0
- data/installer/core/config/application.rb +1 -1
- data/installer/core/config/environments/production.rb +1 -1
- data/installer/core/config/initializers/carrierwave.rb +12 -0
- data/installer/core/config/initializers/mime_types.rb +2 -2
- data/installer/core/config/initializers/simple_form_bootstrap.rb +20 -1
- data/installer/core/config/initializers/simple_form_components.rb +61 -0
- data/installer/core/config/locales/en.yml +29 -6
- data/installer/core/config/locales/es.yml +32 -5
- data/installer/core/config/locales/simple_form.en.yml +1 -0
- data/installer/core/config/locales/simple_form.es.yml +3 -2
- data/installer/core/config/menu.yml +34 -8
- data/installer/core/config/permissions.yml +21 -0
- data/installer/core/config/routes.rb +56 -14
- data/installer/core/db/migrate/20140812210925_rolify_create_roles.rb +2 -0
- data/installer/core/db/migrate/20160128131802_create_scripts.rb +1 -0
- data/installer/core/db/migrate/20180503174351_create_permissions.rb +11 -0
- data/installer/core/db/seeds.rb +12 -6
- data/installer/core/lib/generators/keppler_front/templates/views/template.html.haml +222 -177
- data/installer/core/lib/generators/keppler_relation/keppler_relation_generator.rb +1 -1
- data/installer/core/lib/generators/keppler_scaffold/keppler_scaffold_generator.rb +57 -40
- data/installer/core/lib/generators/keppler_scaffold/templates/controllers/controller.rb +29 -30
- data/installer/core/lib/generators/keppler_scaffold/templates/models/model.rb +14 -20
- data/installer/core/lib/generators/keppler_scaffold/templates/views/_form.html.haml +24 -35
- data/installer/core/lib/generators/keppler_scaffold/templates/views/_index_show.html.haml +12 -11
- data/installer/core/lib/generators/keppler_scaffold/templates/views/_listing.html.haml +7 -7
- data/installer/core/lib/generators/keppler_scaffold/templates/views/index.html.haml +17 -33
- data/installer/core/lib/generators/keppler_scaffold/templates/views/show.html.haml +23 -24
- data/installer/core/plugins/keppler_ga_dashboard/app/assets/images/keppler_ga_dashboard/.keep +0 -0
- data/installer/core/plugins/keppler_ga_dashboard/config/permissions.yml +4 -0
- data/installer/core/plugins/keppler_ga_dashboard/keppler_ga_dashboard.gemspec +1 -1
- data/installer/core/test/controllers/.keep +0 -0
- data/installer/core/test/controllers/roles_controller_test.rb +48 -0
- data/installer/core/test/fixtures/.keep +0 -0
- data/installer/core/test/fixtures/permissions.yml +9 -0
- data/installer/core/test/helpers/.keep +0 -0
- data/installer/core/test/integration/.keep +0 -0
- data/installer/core/test/mailers/.keep +0 -0
- data/installer/core/test/models/.keep +0 -0
- data/installer/core/test/models/permission_test.rb +7 -0
- data/installer/core/test/system/roles_test.rb +43 -0
- data/installer/core/vendor/assets/javascripts/.keep +0 -0
- data/installer/core/vendor/assets/stylesheets/.keep +0 -0
- data/installer/plugins/concerns/commons.rb +47 -0
- data/installer/plugins/concerns/destroy_multiple.rb +33 -0
- data/installer/plugins/concerns/history.rb +24 -0
- data/installer/plugins/config/locales/en.yml +104 -0
- data/installer/plugins/config/locales/es.yml +139 -0
- data/installer/plugins/config/menu.yml +12 -0
- data/installer/plugins/config/permissions.yml +1 -0
- data/installer/plugins/generators/keppler_scaffold/keppler_scaffold_generator.rb +203 -0
- data/installer/plugins/generators/keppler_scaffold/templates/controllers/controller.rb +171 -0
- data/installer/plugins/generators/keppler_scaffold/templates/models/model.rb +41 -0
- data/installer/plugins/generators/keppler_scaffold/templates/policies/policy.rb +11 -0
- data/installer/plugins/generators/keppler_scaffold/templates/views/_description.html.haml +13 -0
- data/installer/plugins/generators/keppler_scaffold/templates/views/_form.html.haml +49 -0
- data/installer/plugins/generators/keppler_scaffold/templates/views/_index_show.html.haml +26 -0
- data/installer/plugins/generators/keppler_scaffold/templates/views/_listing.html.haml +65 -0
- data/installer/plugins/generators/keppler_scaffold/templates/views/edit.html.haml +1 -0
- data/installer/plugins/generators/keppler_scaffold/templates/views/index.html.haml +97 -0
- data/installer/plugins/generators/keppler_scaffold/templates/views/new.html.haml +1 -0
- data/installer/plugins/generators/keppler_scaffold/templates/views/reload.js.haml +5 -0
- data/installer/plugins/generators/keppler_scaffold/templates/views/show.html.haml +66 -0
- data/installer/plugins/generators/keppler_scaffold/templates/views/show.js.haml +4 -0
- data/installer/plugins/install.rb +156 -0
- data/installer/plugins/layouts/_navigation.html.haml +47 -0
- data/installer/plugins/layouts/application.html.haml +24 -0
- data/keppler.gemspec +35 -0
- data/lib/keppler.rb +0 -1
- data/lib/keppler/add.rb +13 -0
- data/lib/keppler/cli.rb +134 -5
- data/lib/keppler/delete.rb +13 -0
- data/lib/keppler/version.rb +1 -1
- metadata +117 -23
- data/installer/core/app/assets/images/admin/space.png +0 -0
- data/installer/core/app/assets/stylesheets/admin/pages/_header.scss +0 -34
- data/installer/core/app/assets/stylesheets/admin/pages/_pageslide.scss +0 -125
- data/installer/core/db/schema.rb +0 -172
- data/installer/lib/conf.rb +0 -31
- data/installer/lib/scaffold.rb +0 -10
- data/installer/run.sh +0 -17
- data/installer/scripts/bin.sh +0 -61
- data/lib/keppler/cli/generate.rb +0 -19
@@ -1,6 +1,6 @@
|
|
1
1
|
.tab-content
|
2
2
|
%h6.actions
|
3
|
-
- if
|
3
|
+
- if can?(<%= singular_table_name.camelcase %>).update?
|
4
4
|
= link_to edit_admin_<%= singular_table_name %>_path(@<%= singular_table_name %>), title: t("keppler.actions.edit"), class: 'pull-left' do
|
5
5
|
%i.icon-pencil
|
6
6
|
%span= t('keppler.actions.edit')
|
@@ -9,16 +9,17 @@
|
|
9
9
|
%h3.control-sidebar-heading
|
10
10
|
= t("keppler.modules.#{controller_path.underscore}")
|
11
11
|
%ul.timeline
|
12
|
-
- @<%= singular_table_name %>.as_json(
|
13
|
-
|
14
|
-
.
|
15
|
-
|
16
|
-
%
|
17
|
-
%
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
12
|
+
- @<%= singular_table_name %>.as_json(except: %[id position created_at updated_at deleted_at]).each do |attribute, value|
|
13
|
+
-unless attribute.eql?('position') || attribute.eql?('deleted_at')
|
14
|
+
%li.list-row
|
15
|
+
.timeline-item
|
16
|
+
%h6.timeline-header.no-border
|
17
|
+
%small
|
18
|
+
%strong.display-value= t("activerecord.attributes.#{attribute}")
|
19
|
+
- if @attachments.include?(attribute)
|
20
|
+
.display-label= image_tag value.url if value.url
|
21
|
+
- else
|
22
|
+
%p.display-label= value.blank? ? '-----------' : value
|
22
23
|
:coffee
|
23
24
|
$('#close-index-show').click ->
|
24
25
|
$('#index-show').css 'right', -$('#index-show').outerWidth()
|
@@ -1,7 +1,7 @@
|
|
1
1
|
- objects.each do |<%= singular_table_name %>|
|
2
2
|
%tr{ id: "row-#{<%= singular_table_name %>.id}" }
|
3
3
|
%td.item-check{ style: 'width: 10%' }
|
4
|
-
- if
|
4
|
+
- if can?(<%= singular_table_name.camelcase %>).destroy_multiple?
|
5
5
|
.checkbox
|
6
6
|
%label{ for: "checkbox-#{<%= singular_table_name %>.id}" }
|
7
7
|
%input{ type:"checkbox", id: "checkbox-#{<%= singular_table_name %>.id}", 'checklist-model' => 'check', 'checklist-value' => "#{<%= singular_table_name %>.id}", '@click' => "listDelete(#{<%= singular_table_name %>.id})"}
|
@@ -12,12 +12,12 @@
|
|
12
12
|
%td
|
13
13
|
= link_to admin_<%= singular_table_name %>_path(<%= singular_table_name %>, search: @query), remote: true, class: 'show-row' do
|
14
14
|
%span
|
15
|
-
= image_tag <%= singular_table_name %>.<%= attribute.name
|
15
|
+
= image_tag <%= singular_table_name %>.<%= attribute.name %>.url unless <%= singular_table_name %>.<%= attribute.name %>.url.blank?
|
16
16
|
<%- end -%>
|
17
17
|
<%- end -%>
|
18
18
|
<%- attributes.each_with_index do |attribute, index| -%>
|
19
19
|
<%- if index < 6 -%>
|
20
|
-
<%- unless attribute.type.to_s
|
20
|
+
<%- unless attribute.type.to_s.eql?('text') || attribute.name.eql?('position') || attribute.name.eql?('deleted_at') -%>
|
21
21
|
<%- unless @attachments.include?(attribute.name) -%>
|
22
22
|
<%- if index < 2 -%>
|
23
23
|
%td.hidden-xs
|
@@ -38,22 +38,22 @@
|
|
38
38
|
%a.action-btn.pull-right{:id => "menu-#{<%= singular_table_name %>.id}", "aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown"}
|
39
39
|
%i.icon-options-vertical
|
40
40
|
%ul.actions.dropdown-menu{"aria-labelledby" => "menu-#{<%= singular_table_name %>.id}" }
|
41
|
-
- if
|
41
|
+
- if can?(<%= singular_table_name.camelcase %>).index?
|
42
42
|
%li
|
43
43
|
= link_to admin_<%= singular_table_name %>_path(<%= singular_table_name %>), class: 'new-menu', title: t('keppler.actions.show') do
|
44
44
|
%i.icon-eye
|
45
45
|
= t('keppler.actions.show')
|
46
|
-
- if
|
46
|
+
- if can?(<%= singular_table_name.camelcase %>).update?
|
47
47
|
%li
|
48
48
|
= link_to edit_admin_<%= singular_table_name %>_path(<%= singular_table_name %>), class: 'new-menu', title: t('keppler.actions.edit') do
|
49
49
|
%i.icon-pencil
|
50
50
|
= t('keppler.actions.edit')
|
51
|
-
- if
|
51
|
+
- if can?(<%= singular_table_name.camelcase %>).clone?
|
52
52
|
%li
|
53
53
|
= link_to admin_<%= singular_table_name %>_clone_path(<%= singular_table_name %>), class: 'new-menu', title: t('keppler.actions.clone') do
|
54
54
|
%i.icon-docs
|
55
55
|
= t('keppler.actions.clone')
|
56
|
-
- if
|
56
|
+
- if can?(<%= singular_table_name.camelcase %>).destroy?
|
57
57
|
%li
|
58
58
|
= link_to admin_<%= singular_table_name %>_path(<%= singular_table_name %>), class: 'new-menu', title: t('keppler.actions.delete'), method: :delete, data: { confirm: t("keppler.messages.data_confirm") } do
|
59
59
|
%i.icon-trash
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#index-container{ :
|
1
|
+
#index-container{ controller: '<%= plural_table_name %>' }
|
2
2
|
.container
|
3
3
|
.row
|
4
4
|
.listing.col-lg-12.col-xs-12
|
@@ -7,18 +7,18 @@
|
|
7
7
|
= t("keppler.modules.#{controller_path.underscore}")
|
8
8
|
= entries(@total, @objects)
|
9
9
|
.toolbar
|
10
|
-
- if
|
10
|
+
- if can?(<%= singular_table_name.camelcase %>).download?
|
11
11
|
.toolbar-item
|
12
|
-
= link_to admin_<%=
|
12
|
+
= link_to admin_<%= plural_table_name %>_path(format: :csv), class: 'tool-btn', title: t('keppler.actions.download_records') do
|
13
13
|
%i.icon-cloud-download
|
14
|
-
- if
|
14
|
+
- if can?(<%= singular_table_name.camelcase %>).upload?
|
15
15
|
.toolbar-item
|
16
|
-
= link_to
|
16
|
+
= link_to '#', id: 'upload', class: 'tool-btn', title: t('keppler.actions.upload_records') do
|
17
17
|
%i.icon-cloud-upload
|
18
18
|
.toolbar-item
|
19
|
-
= link_to reload_admin_<%= plural_table_name %>_path, class:
|
19
|
+
= link_to reload_admin_<%= plural_table_name %>_path, class: 'tool-btn', remote: true do
|
20
20
|
%i.icon-reload
|
21
|
-
- if
|
21
|
+
- if can?(<%= singular_table_name.camelcase %>).destroy_multiple?
|
22
22
|
.toolbar-item
|
23
23
|
.checkbox
|
24
24
|
%label{ for: 'checkbox-all' }
|
@@ -26,26 +26,24 @@
|
|
26
26
|
%span.cr
|
27
27
|
%i.cr-icon.glyphicon.glyphicon-ok
|
28
28
|
.toolbar-item
|
29
|
-
%a.tool-btn{
|
29
|
+
%a.tool-btn{'data-confirm' => '¿Estás seguro?', 'data-method' => 'delete', 'v-bind:href' => 'link', rel: 'nofollow', ':class' => '{disabled: !checks}' }
|
30
30
|
%i.icon-trash
|
31
31
|
.hide
|
32
|
-
= form_tag admin_<%= singular_table_name %>
|
33
|
-
= file_field_tag :file, id:
|
32
|
+
= form_tag admin_<%= singular_table_name %>_upload_path(@objects), id: 'upload_form', multipart: true, method: :post do
|
33
|
+
= file_field_tag :file, id: 'upload_file'
|
34
34
|
%ol.breadcrumb
|
35
35
|
%li
|
36
36
|
%a{ href: '#' }
|
37
37
|
%i.icon-directions
|
38
38
|
= t("keppler.modules.#{action_name.underscore}")
|
39
|
-
|
40
39
|
.box.slice-box
|
41
40
|
.box-body.no-padding
|
42
|
-
|
43
41
|
%table.table
|
44
42
|
%thead
|
45
43
|
- if @objects.size.zero?
|
46
44
|
%tr
|
47
45
|
%th{style: 'text-align: center;'}
|
48
|
-
%h6= t('keppler.messages.not_found_records', model: t(
|
46
|
+
%h6= t('keppler.messages.not_found_records', model: t('keppler.models.pluralize.<%= plural_table_name %>'))
|
49
47
|
- else
|
50
48
|
%tr
|
51
49
|
%th
|
@@ -56,7 +54,7 @@
|
|
56
54
|
<%- end -%>
|
57
55
|
<%- attributes.each_with_index do |attribute, index| -%>
|
58
56
|
<%- if index < 6 -%>
|
59
|
-
<%- unless attribute.type.to_s == 'text' -%>
|
57
|
+
<%- unless attribute.type.to_s == 'text' || attribute.name.eql?('position') || attribute.name.eql?('deleted_at') -%>
|
60
58
|
<%- unless @attachments.include?(attribute.name) -%>
|
61
59
|
<%- if index < 2 -%>
|
62
60
|
%th.hidden-xs= t('activerecord.attributes.<%= attribute.name %>')
|
@@ -69,29 +67,15 @@
|
|
69
67
|
<%- end -%>
|
70
68
|
%th.center Menu
|
71
69
|
%th
|
72
|
-
%tbody#objects-container{
|
70
|
+
%tbody#objects-container{ 'data-update-url' => "#{sort_admin_<%= plural_table_name %>_path}" }
|
73
71
|
= render 'admin/layouts/listing_preloader'
|
74
|
-
= render 'listing', objects:
|
72
|
+
= render 'listing', objects: @objects
|
75
73
|
%center#paginator-module
|
76
74
|
= paginate @objects, window: 1
|
77
75
|
%aside.control-sidebar
|
78
|
-
= render
|
76
|
+
= render 'description'
|
79
77
|
%aside#index-show.control-sidebar
|
80
78
|
|
81
79
|
.mixed-btn
|
82
|
-
- if
|
83
|
-
= link_to new_admin_<%= singular_table_name %>_path, class:
|
84
|
-
+
|
85
|
-
|
86
|
-
:javascript
|
87
|
-
$(document).ready(function(){
|
88
|
-
$('#<%= singular_table_name %>').click(function() {
|
89
|
-
$('#import_file_<%= singular_table_name %>').click()
|
90
|
-
$('#import_file_<%= singular_table_name %>').change(function() {
|
91
|
-
$('.waiting').css('display', 'block')
|
92
|
-
$('#import_form_<%= singular_table_name %>').submit()
|
93
|
-
})
|
94
|
-
});
|
95
|
-
|
96
|
-
renderImg();
|
97
|
-
});
|
80
|
+
- if can?(<%= singular_table_name.camelcase %>).create?
|
81
|
+
= link_to '+', new_admin_<%= singular_table_name %>_path, class: 'btn-float'
|
@@ -1,7 +1,7 @@
|
|
1
1
|
.container
|
2
2
|
.row
|
3
|
-
.col-
|
4
|
-
= link_to admin_<%= plural_table_name %>_path,
|
3
|
+
.col-md-2
|
4
|
+
= link_to admin_<%= plural_table_name %>_path, 'data-position' => 'bottom', 'data-tooltip' => t('keppler.actions.back') do
|
5
5
|
.arrow-back.btn.btn-default
|
6
6
|
%i.fa.fa-angle-left
|
7
7
|
= t('keppler.actions.back')
|
@@ -9,57 +9,56 @@
|
|
9
9
|
.show-section
|
10
10
|
.row
|
11
11
|
<%- if attributes.select{|attribute| @attachments.include?(attribute.name)}.size <= 0 -%>
|
12
|
-
.col-
|
12
|
+
.col-md-12
|
13
13
|
.box.slice-box
|
14
14
|
.box-header.with-border
|
15
|
-
%h3.box-title= t("keppler.modules.#{
|
15
|
+
%h3.box-title= t("keppler.modules.#{controller_name.underscore}")
|
16
16
|
.box-tools.pull-right
|
17
|
-
- if
|
18
|
-
= link_to edit_admin_<%= singular_table_name %>_path(@<%= singular_table_name %>), class:
|
17
|
+
- if can?(<%= singular_table_name.camelcase %>).update?
|
18
|
+
= link_to edit_admin_<%= singular_table_name %>_path(@<%= singular_table_name %>), class: 'btn btn-box-tool', title: t('keppler.actions.edit') do
|
19
19
|
%i.icon-pencil
|
20
|
-
- if
|
21
|
-
= link_to admin_<%= singular_table_name %>_path(@<%= singular_table_name %>), class:
|
20
|
+
- if can?(<%= singular_table_name.camelcase %>).destroy?
|
21
|
+
= link_to admin_<%= singular_table_name %>_path(@<%= singular_table_name %>), class: 'btn btn-box-tool', title: t('keppler.actions.delete'), method: :delete, data: { confirm: t('keppler.messages.data_confirm') } do
|
22
22
|
%i.icon-trash
|
23
23
|
.box-body.box-body-no-padding
|
24
24
|
%table.table.table-striped
|
25
25
|
%tbody
|
26
|
-
- @<%= singular_table_name %>.as_json(
|
26
|
+
- @<%= singular_table_name %>.as_json(except: %i[id position created_at updated_at deleted_at]).each do |attribute, value|
|
27
27
|
%tr.list-row
|
28
28
|
%th.display-label= t("activerecord.attributes.#{attribute}")
|
29
29
|
%td.display-value.fs-body-1.tc-black-2
|
30
30
|
- if @attachments.include?(attribute)
|
31
|
-
= image_tag value
|
31
|
+
= image_tag value.url unless value.url.blank?
|
32
32
|
- else
|
33
|
-
= value
|
33
|
+
= value.blank? ? '-----------' : value
|
34
34
|
<%- else -%>
|
35
|
-
<%- @attr = attributes.
|
36
|
-
.col-
|
37
|
-
- @<%= singular_table_name %>.as_json(only: <%= @attr %>).each do |attribute, value|
|
35
|
+
<%- @attr = attributes.select{|attr| @attachments.include?(attr.name)} %>
|
36
|
+
.col-sm-5
|
37
|
+
- @<%= singular_table_name %>.as_json(only: %w[<%= @attr.map(&:name).join(' ') %>]).each do |attribute, value|
|
38
38
|
.box.slice-box
|
39
39
|
.box-header.with-border
|
40
40
|
%h3.box-title= attribute.capitalize
|
41
41
|
.box-tools.pull-right
|
42
|
-
%a.btn.btn-box-tool{
|
42
|
+
%a.btn.btn-box-tool{ 'data-widget' => 'collapse', type: 'button' }
|
43
43
|
%i.fa.fa-minus
|
44
44
|
.box-body.box-body-no-padding
|
45
|
-
= image_tag value, class: 'img-show'
|
46
|
-
.col-
|
45
|
+
= image_tag value.url, class: 'img-show' unless value.url.blank?
|
46
|
+
.col-sm-7
|
47
47
|
.box.slice-box
|
48
48
|
.box-header.with-border
|
49
|
-
%h3.box-title= t("keppler.modules.#{
|
49
|
+
%h3.box-title= t("keppler.modules.#{controller_name.underscore}")
|
50
50
|
.box-tools.pull-right
|
51
|
-
= link_to edit_admin_<%= singular_table_name %>_path(@<%= singular_table_name %>), class:
|
51
|
+
= link_to edit_admin_<%= singular_table_name %>_path(@<%= singular_table_name %>), class: 'btn btn-box-tool', title: t('keppler.actions.edit') do
|
52
52
|
%i.icon-pencil
|
53
|
-
= link_to admin_<%= singular_table_name %>_path(@<%= singular_table_name %>), class:
|
53
|
+
= link_to admin_<%= singular_table_name %>_path(@<%= singular_table_name %>), class: 'btn btn-box-tool', title: t('keppler.actions.delete'), method: :delete, data: { confirm: t('keppler.messages.data_confirm') } do
|
54
54
|
%i.icon-trash
|
55
|
-
%a.btn.btn-box-tool{
|
55
|
+
%a.btn.btn-box-tool{ 'data-widget' => 'collapse', type: 'button' }
|
56
56
|
%i.fa.fa-minus
|
57
57
|
.box-body.box-body-no-padding
|
58
58
|
%table.table.table-striped
|
59
59
|
%tbody
|
60
|
-
- @<%= singular_table_name %>.as_json(
|
60
|
+
- @<%= singular_table_name %>.as_json(except: %i[id position created_at updated_at deleted_at]).each do |attribute, value|
|
61
61
|
%tr.list-row
|
62
62
|
%th.display-label= t("activerecord.attributes.#{attribute}")
|
63
|
-
%td.display-value.fs-body-1.tc-black-2
|
64
|
-
= value
|
63
|
+
%td.display-value.fs-body-1.tc-black-2.text-overflow= value.blank? ? '-----------' : value
|
65
64
|
<%- end -%>
|
File without changes
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.email = ["contacto@slicegroup.xyz"]
|
12
12
|
s.homepage = "https://www.slicegroup.xyz"
|
13
13
|
s.summary = "Summary of KepplerGaDashboard"
|
14
|
-
s.description = "
|
14
|
+
s.description = ""
|
15
15
|
s.license = "MIT"
|
16
16
|
|
17
17
|
s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]
|
File without changes
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class RolesControllerTest < ActionDispatch::IntegrationTest
|
4
|
+
setup do
|
5
|
+
@role = roles(:one)
|
6
|
+
end
|
7
|
+
|
8
|
+
test "should get index" do
|
9
|
+
get roles_url
|
10
|
+
assert_response :success
|
11
|
+
end
|
12
|
+
|
13
|
+
test "should get new" do
|
14
|
+
get new_role_url
|
15
|
+
assert_response :success
|
16
|
+
end
|
17
|
+
|
18
|
+
test "should create role" do
|
19
|
+
assert_difference('Role.count') do
|
20
|
+
post roles_url, params: { role: { name: @role.name } }
|
21
|
+
end
|
22
|
+
|
23
|
+
assert_redirected_to role_url(Role.last)
|
24
|
+
end
|
25
|
+
|
26
|
+
test "should show role" do
|
27
|
+
get role_url(@role)
|
28
|
+
assert_response :success
|
29
|
+
end
|
30
|
+
|
31
|
+
test "should get edit" do
|
32
|
+
get edit_role_url(@role)
|
33
|
+
assert_response :success
|
34
|
+
end
|
35
|
+
|
36
|
+
test "should update role" do
|
37
|
+
patch role_url(@role), params: { role: { name: @role.name } }
|
38
|
+
assert_redirected_to role_url(@role)
|
39
|
+
end
|
40
|
+
|
41
|
+
test "should destroy role" do
|
42
|
+
assert_difference('Role.count', -1) do
|
43
|
+
delete role_url(@role)
|
44
|
+
end
|
45
|
+
|
46
|
+
assert_redirected_to roles_url
|
47
|
+
end
|
48
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require "application_system_test_case"
|
2
|
+
|
3
|
+
class RolesTest < ApplicationSystemTestCase
|
4
|
+
setup do
|
5
|
+
@role = roles(:one)
|
6
|
+
end
|
7
|
+
|
8
|
+
test "visiting the index" do
|
9
|
+
visit roles_url
|
10
|
+
assert_selector "h1", text: "Roles"
|
11
|
+
end
|
12
|
+
|
13
|
+
test "creating a Role" do
|
14
|
+
visit roles_url
|
15
|
+
click_on "New Role"
|
16
|
+
|
17
|
+
fill_in "Name", with: @role.name
|
18
|
+
click_on "Create Role"
|
19
|
+
|
20
|
+
assert_text "Role was successfully created"
|
21
|
+
click_on "Back"
|
22
|
+
end
|
23
|
+
|
24
|
+
test "updating a Role" do
|
25
|
+
visit roles_url
|
26
|
+
click_on "Edit", match: :first
|
27
|
+
|
28
|
+
fill_in "Name", with: @role.name
|
29
|
+
click_on "Update Role"
|
30
|
+
|
31
|
+
assert_text "Role was successfully updated"
|
32
|
+
click_on "Back"
|
33
|
+
end
|
34
|
+
|
35
|
+
test "destroying a Role" do
|
36
|
+
visit roles_url
|
37
|
+
page.accept_confirm do
|
38
|
+
click_on "Destroy", match: :first
|
39
|
+
end
|
40
|
+
|
41
|
+
assert_text "Role was successfully destroyed"
|
42
|
+
end
|
43
|
+
end
|
File without changes
|
File without changes
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module KepplerPoll
|
2
|
+
module Concerns
|
3
|
+
# Concern con la configuracion de parametros de los formulario
|
4
|
+
module Commons
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
included do
|
8
|
+
before_action :set_attachments
|
9
|
+
before_action :paginator_params
|
10
|
+
before_action :set_setting
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def set_attachments
|
16
|
+
@attachments = %w[logo brand photo avatar cover image
|
17
|
+
picture banner attachment pic file]
|
18
|
+
end
|
19
|
+
|
20
|
+
def paginator_params
|
21
|
+
@search_field = model.search_field if listing?
|
22
|
+
@query = params[:search] unless params[:search].blank?
|
23
|
+
@current_page = params[:page] unless params[:page].blank?
|
24
|
+
end
|
25
|
+
|
26
|
+
def set_setting
|
27
|
+
@setting = Setting.first
|
28
|
+
end
|
29
|
+
|
30
|
+
def module_name
|
31
|
+
self.class.to_s.split('::').first.constantize
|
32
|
+
end
|
33
|
+
|
34
|
+
# Get submit key to redirect, only [:create, :update]
|
35
|
+
def redirect(object, commit)
|
36
|
+
if commit.key?('_save')
|
37
|
+
redirect_to([:admin, :ckn, object], notice: actions_messages(object))
|
38
|
+
elsif commit.key?('_add_other')
|
39
|
+
redirect_to(
|
40
|
+
send("new_admin_#{underscore(object)}_path"),
|
41
|
+
notice: actions_messages(object)
|
42
|
+
)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|