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
@@ -0,0 +1,33 @@
|
|
1
|
+
module KepplerPoll
|
2
|
+
module Concerns
|
3
|
+
# Concern con la configuracion de parametros de los formulario
|
4
|
+
module DestroyMultiple
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
included do
|
8
|
+
before_action :can_multiple_destroy, only: [:destroy_multiple]
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def model
|
14
|
+
model_name = "#{module_name}::#{controller_name.classify}"
|
15
|
+
model_name.constantize
|
16
|
+
end
|
17
|
+
|
18
|
+
def redefine_ids(ids)
|
19
|
+
ids.delete('[]').split(',').select do |id|
|
20
|
+
id if model.exists? id
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# Check whether the user has permission to delete
|
25
|
+
# each of the selected objects
|
26
|
+
def can_multiple_destroy
|
27
|
+
redefine_ids(params[:multiple_ids]).each do |id|
|
28
|
+
authorize model
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module KepplerPoll
|
2
|
+
module Concerns
|
3
|
+
# Concern con la configuracion de parametros de los formulario
|
4
|
+
module History
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
included do
|
8
|
+
before_action :show_history, only: [:index]
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def show_history
|
14
|
+
get_history(Room)
|
15
|
+
end
|
16
|
+
|
17
|
+
def get_history(model)
|
18
|
+
@activities = PublicActivity::Activity.where(
|
19
|
+
trackable_type: model.to_s
|
20
|
+
).order('created_at desc').limit(50)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,104 @@
|
|
1
|
+
en:
|
2
|
+
keppler:
|
3
|
+
sidebar-menu:
|
4
|
+
keppler-checkin: Reservaciones
|
5
|
+
keppler-checkin-submenu:
|
6
|
+
models:
|
7
|
+
singularize:
|
8
|
+
pluralize:
|
9
|
+
modules:
|
10
|
+
actions:
|
11
|
+
created: Created
|
12
|
+
updated: Updated
|
13
|
+
create: Create
|
14
|
+
update: Update
|
15
|
+
deleted: Deleted
|
16
|
+
new: New
|
17
|
+
show: Show
|
18
|
+
edit: Edit
|
19
|
+
clone: Clone
|
20
|
+
delete: Delete
|
21
|
+
index: List
|
22
|
+
change_rol: Change role
|
23
|
+
select_all: Select all
|
24
|
+
refresh: Refresh
|
25
|
+
search: Search
|
26
|
+
go_to_web: Go to web
|
27
|
+
edit_profile: Edit profile
|
28
|
+
sign_out: Sign out
|
29
|
+
back: Back
|
30
|
+
cancel: Cancel
|
31
|
+
assing_rol: Assign rol
|
32
|
+
select_rol: Select rol
|
33
|
+
save: Save
|
34
|
+
save_and_add_another: Save and add another
|
35
|
+
back_history: "Back to history"
|
36
|
+
appearance_defaut: Set default
|
37
|
+
apply: Apply
|
38
|
+
activerecord:
|
39
|
+
attributes:
|
40
|
+
id: Id
|
41
|
+
title: Title
|
42
|
+
subtitle: Subtitle
|
43
|
+
tags: Etiquetas
|
44
|
+
name: Name
|
45
|
+
first_name: 'First Name'
|
46
|
+
last_name: 'Last Name'
|
47
|
+
full_name: 'Full Name'
|
48
|
+
email: Email
|
49
|
+
role: Role
|
50
|
+
phone: Phone
|
51
|
+
phone_number: 'Phone Number'
|
52
|
+
phone_code: 'Phone Code'
|
53
|
+
area_code: 'Phone Code'
|
54
|
+
phone_one: 'Phone One'
|
55
|
+
phone_two: 'Phone Two'
|
56
|
+
age: Age
|
57
|
+
image: Image
|
58
|
+
photo: Photo
|
59
|
+
attachment: Attachment
|
60
|
+
pdf: PDF
|
61
|
+
avatar: Avatar
|
62
|
+
icon: Icon
|
63
|
+
image_background: 'Background Image'
|
64
|
+
brand: Brand
|
65
|
+
country: Country
|
66
|
+
state: State
|
67
|
+
city: City
|
68
|
+
company: Company
|
69
|
+
product: Product
|
70
|
+
client: Client
|
71
|
+
partner: Partner
|
72
|
+
code: Code
|
73
|
+
alliance: Alliance
|
74
|
+
ally: Ally
|
75
|
+
category: Category
|
76
|
+
service: Service
|
77
|
+
project: Project
|
78
|
+
type: Type
|
79
|
+
address: Address
|
80
|
+
size: Size
|
81
|
+
distance: Distance
|
82
|
+
description: Description
|
83
|
+
short_description: 'Short Description'
|
84
|
+
long_description: 'Long Description'
|
85
|
+
details: Details
|
86
|
+
message: Message
|
87
|
+
content: Content
|
88
|
+
date: Date
|
89
|
+
date_begin: 'Date Begin'
|
90
|
+
date_end: 'Date End'
|
91
|
+
begin: Begin
|
92
|
+
end: End
|
93
|
+
check_in: 'Check In'
|
94
|
+
check_out: 'Check Out'
|
95
|
+
price_local: Local Price
|
96
|
+
price_dollar: Dollar Price
|
97
|
+
errors:
|
98
|
+
messages:
|
99
|
+
record_invalid: "Validation failed: %{errors}"
|
100
|
+
restrict_destroy: "Cannot delete record"
|
101
|
+
restrict_dependent_destroy:
|
102
|
+
has_one: "Cannot delete record because a dependent %{record} exists"
|
103
|
+
has_many: "Cannot delete record because dependent %{record} exist"
|
104
|
+
|
@@ -0,0 +1,139 @@
|
|
1
|
+
es:
|
2
|
+
keppler:
|
3
|
+
sidebar-menu:
|
4
|
+
keppler-checkin: Reservaciones
|
5
|
+
keppler-checkin-submenu:
|
6
|
+
models:
|
7
|
+
singularize:
|
8
|
+
pluralize:
|
9
|
+
modules:
|
10
|
+
settings:
|
11
|
+
actions:
|
12
|
+
created: Creado
|
13
|
+
updated: Actualizado
|
14
|
+
new: Nuevo
|
15
|
+
show: Ver
|
16
|
+
edit: Editar
|
17
|
+
clone: Clonar
|
18
|
+
delete: Eliminar
|
19
|
+
deleted: Eliminado
|
20
|
+
index: Listado
|
21
|
+
change_rol: Cambiar rol
|
22
|
+
select_all: Seleccionar todo
|
23
|
+
refresh: Refrescar
|
24
|
+
search: Buscar
|
25
|
+
go_to_web: Ir a la web
|
26
|
+
edit_profile: Editar perfil
|
27
|
+
sign_out: Sign out
|
28
|
+
back: Volver
|
29
|
+
cancel: Cancelar
|
30
|
+
assing_rol: Asignar rol
|
31
|
+
select_rol: Seleccionar rol
|
32
|
+
save: Guardar
|
33
|
+
save_and_add_another: Guardar y añadir otro
|
34
|
+
back_history: "Volver al historial"
|
35
|
+
appearance_defaut: Por defecto
|
36
|
+
apply: Aplicar
|
37
|
+
download_records: Descargar registros
|
38
|
+
upload_records: Cargar registros
|
39
|
+
reserve: Reservar
|
40
|
+
activerecord:
|
41
|
+
attributes:
|
42
|
+
id: Identificador
|
43
|
+
title: Título
|
44
|
+
subtitle: Subtítulo
|
45
|
+
tags: Etiquetas
|
46
|
+
name: Nombre
|
47
|
+
quantity: Cantidad
|
48
|
+
first_name: 'Nombre'
|
49
|
+
last_name: 'Apellido'
|
50
|
+
full_name: 'Nombre Completo'
|
51
|
+
email: Correo
|
52
|
+
role: Rol
|
53
|
+
phone: Teléfono
|
54
|
+
phone_number: 'Número de Teléfono'
|
55
|
+
phone_number: 'Código de Area'
|
56
|
+
area_number: 'Código de Area'
|
57
|
+
phone_one: 'Teléfono #1'
|
58
|
+
phone_two: 'Teléfono #2'
|
59
|
+
approved: Aprobado
|
60
|
+
age: Edad
|
61
|
+
adults: Adultos
|
62
|
+
childs: Niños
|
63
|
+
little_childs: Bebés
|
64
|
+
motive: Motivo
|
65
|
+
procedence: Procedencia
|
66
|
+
payment_method: Método de pago
|
67
|
+
observations: Observaciones
|
68
|
+
image: Imagen
|
69
|
+
photo: Foto
|
70
|
+
attachment: Adjunto
|
71
|
+
file: Archivo
|
72
|
+
pdf: PDF
|
73
|
+
avatar: Avatar
|
74
|
+
brand: Logo
|
75
|
+
logo: Logo
|
76
|
+
favicon: Favicon
|
77
|
+
icon: Icono
|
78
|
+
image_background: 'Imagen de fondo'
|
79
|
+
country: País
|
80
|
+
state: Estado
|
81
|
+
city: Ciudad
|
82
|
+
company: Empresa
|
83
|
+
product: Producto
|
84
|
+
client: Cliente
|
85
|
+
partner: Socio
|
86
|
+
code: Código
|
87
|
+
alliance: Alianza
|
88
|
+
ally: Aliado
|
89
|
+
author: Autor
|
90
|
+
category: Categoría
|
91
|
+
subcategory: Subcategoría
|
92
|
+
service: Servicio
|
93
|
+
project: Proyecto
|
94
|
+
type: Tipo
|
95
|
+
address: Dirección
|
96
|
+
size: Tamaño
|
97
|
+
distance: Distancia
|
98
|
+
description: Descripción
|
99
|
+
short_description: 'Descripción Corta'
|
100
|
+
long_description: 'Descripción Larga'
|
101
|
+
details: Detalles
|
102
|
+
message: Mensaje
|
103
|
+
content: Contenido
|
104
|
+
date: Fecha
|
105
|
+
date_begin: 'Fecha Inicial'
|
106
|
+
date_end: 'Fecha Final'
|
107
|
+
begin: Inicio
|
108
|
+
end: Fin
|
109
|
+
check_in: Entrada
|
110
|
+
check_out: Salida
|
111
|
+
permalink: Permalink
|
112
|
+
sign_in_count: Veces logeado
|
113
|
+
created_at: Fecha de creación
|
114
|
+
updated_at: Ultima actualización
|
115
|
+
password: Contraseña
|
116
|
+
password_confirmation: Confirmar contraseña
|
117
|
+
address: Dirección del servidor
|
118
|
+
port: Puerto
|
119
|
+
domain_name: Dominio
|
120
|
+
url: Url
|
121
|
+
meta_tags: 'Meta Tags'
|
122
|
+
script: 'Script'
|
123
|
+
campaign_name: Campaña
|
124
|
+
script: Script
|
125
|
+
mailer_from: 'Enviar desde'
|
126
|
+
mailer_to: 'Hacia'
|
127
|
+
ga_account_id: Identificador de la cuenta
|
128
|
+
ga_tracking: Identificador de segumiento
|
129
|
+
ga_status: Habilitar Google Analytics
|
130
|
+
price_local: Precio en moneda local
|
131
|
+
price_dollar: Precio en dólares
|
132
|
+
errors:
|
133
|
+
messages:
|
134
|
+
record_invalid: "Validación fallida: %{errors}"
|
135
|
+
restrict_destroy: "No se puede borrar el registro"
|
136
|
+
restrict_dependent_destroy:
|
137
|
+
has_one: "No se puede borrar el registro porque un registro dependiente %{record} existe"
|
138
|
+
has_many: "No se puede borrar el registro porque registros dependientes %{record} existen"
|
139
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
modules:
|
@@ -0,0 +1,203 @@
|
|
1
|
+
require 'rails/generators/rails/resource/resource_generator'
|
2
|
+
require 'rails/generators/resource_helpers'
|
3
|
+
module Rails
|
4
|
+
module Generators
|
5
|
+
# KepplerScaffold
|
6
|
+
class KepplerScaffoldGenerator < ResourceGenerator
|
7
|
+
remove_hook_for :resource_controller
|
8
|
+
remove_class_option :actions
|
9
|
+
|
10
|
+
class_option :stylesheets, type: :boolean, desc: 'Generate Stylesheets'
|
11
|
+
class_option :stylesheet_engine, desc: 'Engine for Stylesheets'
|
12
|
+
remove_class_option :resource_route, type: :boolean
|
13
|
+
|
14
|
+
source_root File.expand_path('../templates', __FILE__)
|
15
|
+
|
16
|
+
check_class_collision suffix: 'Controller'
|
17
|
+
|
18
|
+
class_option(
|
19
|
+
:orm,
|
20
|
+
banner: 'NAME',
|
21
|
+
type: :string,
|
22
|
+
required: true,
|
23
|
+
desc: 'ORM to generate the controller for'
|
24
|
+
)
|
25
|
+
|
26
|
+
argument(
|
27
|
+
:attributes,
|
28
|
+
type: :array,
|
29
|
+
default: [],
|
30
|
+
banner: 'field:type field:type'
|
31
|
+
)
|
32
|
+
|
33
|
+
def add_route
|
34
|
+
eturn if options[:skip_routes]
|
35
|
+
inject_into_file(
|
36
|
+
'config/routes.rb',
|
37
|
+
"\n #{indent(str_route)}",
|
38
|
+
after: 'scope :checkin, as: :checkin do'
|
39
|
+
)
|
40
|
+
end
|
41
|
+
|
42
|
+
#def add_option_menu
|
43
|
+
# inject_into_file(
|
44
|
+
# 'config/menu.yml',
|
45
|
+
# str_menu,
|
46
|
+
# before: ' user:'
|
47
|
+
# )
|
48
|
+
#end
|
49
|
+
|
50
|
+
#def add_access_ability
|
51
|
+
# inject_into_file(
|
52
|
+
# 'app/models/ability.rb',
|
53
|
+
# str_ability,
|
54
|
+
# after: ' if user.has_role? :admin'
|
55
|
+
# )
|
56
|
+
#end
|
57
|
+
|
58
|
+
#def add_locales
|
59
|
+
# %w(en es).each do |locale|
|
60
|
+
# add_str_locales(locale, 'singularize')
|
61
|
+
# add_str_locales(locale, 'pluralize')
|
62
|
+
# add_str_locales(locale, 'modules')
|
63
|
+
# add_str_locales(locale, 'sidebar-menu')
|
64
|
+
# end
|
65
|
+
#end
|
66
|
+
|
67
|
+
def add_option_permissions
|
68
|
+
inject_into_file(
|
69
|
+
'config/permissions.yml',
|
70
|
+
str_permissions,
|
71
|
+
after: 'modules:'
|
72
|
+
)
|
73
|
+
end
|
74
|
+
|
75
|
+
def create_controller_files
|
76
|
+
template(
|
77
|
+
'controllers/controller.rb',
|
78
|
+
File.join(
|
79
|
+
'app/controllers/',
|
80
|
+
controller_class_path, "/admin/#{controller_file_name}_controller.rb"
|
81
|
+
)
|
82
|
+
)
|
83
|
+
end
|
84
|
+
|
85
|
+
def create_model_files
|
86
|
+
attachments
|
87
|
+
template(
|
88
|
+
'models/model.rb',
|
89
|
+
File.join(
|
90
|
+
'app/models',
|
91
|
+
controller_class_path,
|
92
|
+
"#{controller_file_name.singularize}.rb"
|
93
|
+
)
|
94
|
+
)
|
95
|
+
end
|
96
|
+
|
97
|
+
def create_policies_files
|
98
|
+
template(
|
99
|
+
'policies/policy.rb',
|
100
|
+
File.join(
|
101
|
+
'app/policies',
|
102
|
+
controller_class_path, "#{controller_file_name.singularize}_policy.rb"
|
103
|
+
)
|
104
|
+
)
|
105
|
+
end
|
106
|
+
|
107
|
+
def create_views_files
|
108
|
+
attachments
|
109
|
+
template_keppler_views('_description.html.haml')
|
110
|
+
template_keppler_views('_index_show.html.haml')
|
111
|
+
template_keppler_views('_listing.html.haml')
|
112
|
+
template_keppler_views('_form.html.haml')
|
113
|
+
template_keppler_views('show.js.haml')
|
114
|
+
template_keppler_views('edit.html.haml')
|
115
|
+
template_keppler_views('new.html.haml')
|
116
|
+
template_keppler_views('show.html.haml')
|
117
|
+
template_keppler_views('index.html.haml')
|
118
|
+
template_keppler_views('reload.js.haml')
|
119
|
+
end
|
120
|
+
|
121
|
+
hook_for :test_framework, as: :scaffold
|
122
|
+
|
123
|
+
# Invoke the helper using the controller name (pluralized)
|
124
|
+
hook_for :helper, as: :scaffold do |invoked|
|
125
|
+
invoke invoked, [controller_name]
|
126
|
+
end
|
127
|
+
|
128
|
+
private
|
129
|
+
|
130
|
+
#def add_str_locales(locale, switch)
|
131
|
+
# inject_into_file(
|
132
|
+
# "config/locales/#{locale}.yml",
|
133
|
+
# str_locales(switch),
|
134
|
+
# after: "#{switch}:"
|
135
|
+
# )
|
136
|
+
#end
|
137
|
+
|
138
|
+
def names
|
139
|
+
@names = ['name', 'title', 'first_name', 'full_name']
|
140
|
+
end
|
141
|
+
|
142
|
+
def attachments
|
143
|
+
@attachments = ['logo', 'brand', 'photo', 'avatar', 'cover', 'image', 'picture', 'banner', 'attachment', 'pic', 'file']
|
144
|
+
end
|
145
|
+
|
146
|
+
def str_route
|
147
|
+
" resources :#{controller_file_name} do\n get '(page/:page)', action: :index, on: :collection, as: ''\n get '/clone', action: 'clone'\n post '/sort', action: :sort, on: :collection\n post '/upload', action: 'upload', as: 'upload'\n get '/download', action: 'download', as: 'download'\n get(\n '/reload',\n action: :reload,\n on: :collection,\n )\n delete(\n '/destroy_multiple',\n action: :destroy_multiple,\n on: :collection,\n as: :destroy_multiple\n )\n end\n"
|
148
|
+
end
|
149
|
+
|
150
|
+
def str_menu
|
151
|
+
" #{controller_file_name.singularize}:\n name: #{controller_file_name.humanize.downcase}\n url_path: /admin/#{controller_file_name}\n icon: insert_chart\n current: ['admin/#{controller_file_name}']\n model: #{controller_file_name.singularize.camelize}\n"
|
152
|
+
end
|
153
|
+
|
154
|
+
def str_ability
|
155
|
+
"\n\n # - #{controller_file_name.singularize.camelcase} authorize -\n can :manage, #{controller_file_name.singularize.camelcase}"
|
156
|
+
end
|
157
|
+
|
158
|
+
def str_permissions
|
159
|
+
"\n #{controller_file_name.pluralize}:\n name: #{controller_file_name.singularize.camelize}\n actions: [\n 'index', 'create', 'update',\n 'destroy', 'download', 'upload',\n 'clone'\n ]\n "
|
160
|
+
end
|
161
|
+
|
162
|
+
def str_locales(switch)
|
163
|
+
case switch
|
164
|
+
when 'singularize'
|
165
|
+
"\n #{controller_file_name.singularize}: #{controller_file_name.singularize.humanize.downcase}"
|
166
|
+
when 'pluralize'
|
167
|
+
"\n #{controller_file_name}: #{controller_file_name.humanize.downcase}"
|
168
|
+
when 'modules'
|
169
|
+
"\n admin/#{controller_file_name}: #{controller_file_name.humanize}"
|
170
|
+
when 'sidebar-menu'
|
171
|
+
"\n #{controller_file_name}: #{controller_file_name.humanize}"
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
def template_keppler_views(name_file)
|
176
|
+
template(
|
177
|
+
"views/#{name_file}",
|
178
|
+
File.join("app/views/#{controller_class_path.first}/admin/#{controller_file_name}", name_file)
|
179
|
+
)
|
180
|
+
end
|
181
|
+
|
182
|
+
def arr_exist(path, search)
|
183
|
+
object = []
|
184
|
+
open(path).each do |line|
|
185
|
+
object << line if line.to_s.include? search
|
186
|
+
end
|
187
|
+
object
|
188
|
+
end
|
189
|
+
|
190
|
+
def destination_path(path)
|
191
|
+
File.join(destination_root, path)
|
192
|
+
end
|
193
|
+
|
194
|
+
def gsub_file(relative_destination, regexp, *args, &block)
|
195
|
+
path = destination_path(relative_destination)
|
196
|
+
content = File.read(path).gsub(regexp, *args, &block)
|
197
|
+
File.open(path, 'wb') do |file|
|
198
|
+
file.write(content)
|
199
|
+
end
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|
203
|
+
end
|