keppler 2.1.11 → 2.1.12

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.
Files changed (186) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/LICENSE +674 -0
  4. data/installer/core/Gemfile.lock +0 -0
  5. data/installer/core/LICENSE +674 -0
  6. data/installer/core/app/assets/javascripts/admin/main.coffee +1 -1
  7. data/installer/core/app/controllers/admin/settings_controller.rb +4 -0
  8. data/installer/core/app/controllers/application_controller.rb +1 -0
  9. data/installer/core/app/views/admin/layouts/_navigation.html.haml +1 -1
  10. data/installer/core/app/views/admin/layouts/_sidebar.html.haml +1 -1
  11. data/installer/core/app/views/admin/scripts/index.html.haml +1 -1
  12. data/installer/core/app/views/app/layouts/_google_analytics.html.haml +5 -6
  13. data/installer/core/config/circleci/db_config.yml +2 -2
  14. data/installer/core/config/locales/en.yml +3 -0
  15. data/installer/core/config/routes.rb +0 -8
  16. data/installer/core/config/settings.yml +2 -2
  17. data/installer/core/db/seeds.rb +6 -9
  18. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/conf +0 -0
  19. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/conf +0 -0
  20. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/conf +0 -0
  21. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/slick/conf +0 -0
  22. data/installer/core/rockets/keppler_frontend/app/assets/javascripts/keppler_frontend/app/grapes/grapes-editor.js +1174 -0
  23. data/installer/core/rockets/keppler_frontend/app/controllers/keppler_frontend/app/app_controller.rb +1 -1
  24. data/installer/core/rockets/keppler_frontend/app/controllers/keppler_frontend/concerns/services.rb +0 -0
  25. data/installer/core/rockets/keppler_frontend/app/helpers/keppler_frontend/app/frontend_helper.rb +1 -1
  26. data/installer/core/rockets/keppler_frontend/app/models/keppler_frontend/concerns/partials/helper_file.rb +4 -4
  27. data/installer/core/rockets/keppler_frontend/app/models/keppler_frontend/concerns/partials/html_file.rb +14 -20
  28. data/installer/core/rockets/keppler_frontend/app/models/keppler_frontend/concerns/partials/scss_file.rb +1 -1
  29. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/editor/file_format.rb +0 -0
  30. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/editor/resources.rb +0 -0
  31. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/editor/resources_format.rb +0 -0
  32. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/urls/assets.rb +0 -0
  33. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/urls/config.rb +0 -0
  34. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/urls/front.rb +0 -0
  35. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/urls/roots.rb +0 -0
  36. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/utils/code_search.rb +0 -0
  37. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/utils/file_format.rb +0 -0
  38. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/utils/yml_handler.rb +0 -0
  39. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/views/actions_handler.rb +0 -0
  40. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/views/css_handler.rb +0 -0
  41. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/views/html_handler.rb +0 -0
  42. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/views/install.rb +0 -0
  43. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/views/js_handler.rb +0 -0
  44. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/views/remote_js_handler.rb +0 -0
  45. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/views/routes_handler.rb +0 -0
  46. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/views/uninstall.rb +0 -0
  47. data/installer/core/rockets/keppler_frontend/app/views/keppler_frontend/admin/views/_editor_assets.html.haml +25 -23
  48. data/installer/core/rockets/keppler_frontend/app/views/keppler_frontend/admin/views/_editor_themes.html.haml +25 -23
  49. data/installer/core/rockets/keppler_frontend/app/views/keppler_frontend/admin/views/_editor_views.html.haml +23 -21
  50. data/installer/core/rockets/keppler_frontend/app/views/keppler_frontend/admin/views/index.html.haml +11 -10
  51. data/installer/core/rockets/keppler_frontend/app/views/keppler_frontend/app/partials/_devise_login.html.erb +34 -34
  52. data/installer/core/rockets/keppler_frontend/app/views/layouts/keppler_frontend/app/layouts/application.html.erb +0 -1
  53. data/installer/core/rockets/keppler_frontend/app/views/layouts/themes/keppler_default/application.html.erb +0 -1
  54. data/installer/core/rockets/keppler_ga_dashboard/app/controllers/keppler_ga_dashboard/admin/dashboard_controller.rb +64 -0
  55. data/installer/core/rockets/keppler_ga_dashboard/app/helpers/keppler_ga_dashboard/admin/dashboard_helper.rb +16 -0
  56. data/installer/core/rockets/keppler_ga_dashboard/app/helpers/keppler_ga_dashboard/application_helper.rb +4 -1
  57. data/installer/core/rockets/keppler_ga_dashboard/app/views/keppler_ga_dashboard/{dashboard → admin/dashboard}/analytics.html.haml +0 -0
  58. data/installer/core/rockets/keppler_ga_dashboard/config/routes.rb +1 -1
  59. data/installer/core/spec/controllers/keppler_frontend/admin/views_controller/create_view_spec.rb +0 -0
  60. data/installer/core/spec/controllers/keppler_frontend/admin/views_controller/editor_spec.rb +0 -0
  61. data/installer/core/spec/controllers/keppler_frontend/admin/views_controller/live_editor_save_spec.rb +0 -0
  62. data/installer/core/spec/fixtures/keppler_frontend/editor/test.html +0 -0
  63. data/installer/core/spec/fixtures/keppler_frontend/editor/test.png +0 -0
  64. data/installer/core/spec/fixtures/keppler_frontend/live_editor/test_index_1.html +0 -0
  65. data/installer/core/spec/fixtures/keppler_frontend/live_editor/test_index_2.html +0 -0
  66. data/installer/core/spec/models/keppler_frontend/view/live_editor_spec.rb +1 -0
  67. data/installer/core/spec/models/keppler_frontend/view/model_spec.rb +0 -0
  68. data/installer/core/spec/models/keppler_frontend/view/view_files_handler_spec.rb +0 -0
  69. data/installer/core/spec/models/user_spec.rb +0 -2
  70. data/installer/core/spec/routing/keppler_frontend/views_spec.rb +1 -0
  71. data/installer/core/spec/services/keppler_frontend/editor/file_format_spec.rb +0 -0
  72. data/installer/core/spec/services/keppler_frontend/editor/resources_format_spec.rb +0 -0
  73. data/installer/core/spec/services/keppler_frontend/editor/resources_spec.rb +0 -0
  74. data/installer/core/spec/services/keppler_frontend/urls/assets_spec.rb +0 -0
  75. data/installer/core/spec/services/keppler_frontend/urls/config_spec.rb +0 -0
  76. data/installer/core/spec/services/keppler_frontend/urls/front_spec.rb +0 -0
  77. data/installer/core/spec/services/keppler_frontend/urls/roots_spec.rb +0 -0
  78. data/installer/core/spec/services/keppler_frontend/utils/code_search_spec.rb +0 -0
  79. data/installer/core/spec/services/keppler_frontend/utils/file_format_spec.rb +0 -0
  80. data/installer/core/spec/services/keppler_frontend/utils/yml_handle_spec.rb +2 -0
  81. data/installer/core/spec/services/keppler_frontend/views/actions_handler_spec.rb +0 -0
  82. data/installer/core/spec/services/keppler_frontend/views/css_handler_spec.rb +0 -0
  83. data/installer/core/spec/services/keppler_frontend/views/format_html_spec.rb +0 -0
  84. data/installer/core/spec/services/keppler_frontend/views/format_remote_js_spec.rb +0 -0
  85. data/installer/core/spec/services/keppler_frontend/views/fromat_only_action_spec.rb +0 -0
  86. data/installer/core/spec/services/keppler_frontend/views/html_handler_spec.rb +0 -0
  87. data/installer/core/spec/services/keppler_frontend/views/js_handler_spec.rb +0 -0
  88. data/installer/core/spec/services/keppler_frontend/views/remote_js_handler_spec.rb +0 -0
  89. data/installer/core/spec/services/keppler_frontend/views/routes_handler_spec.rb +0 -0
  90. data/installer/core/vendor/cache/autoprefixer-rails-9.3.1.gem +0 -0
  91. data/installer/core/vendor/cache/bootsnap-1.3.2.gem +0 -0
  92. data/installer/core/vendor/cache/factory_bot-4.11.1.gem +0 -0
  93. data/installer/core/vendor/cache/factory_bot_rails-4.11.1.gem +0 -0
  94. data/installer/core/vendor/cache/faraday-0.15.3.gem +0 -0
  95. data/installer/core/vendor/cache/ffi-1.9.25.gem +0 -0
  96. data/installer/core/vendor/cache/i18n-1.1.1.gem +0 -0
  97. data/installer/core/vendor/cache/image_optimizer-1.8.0.gem +0 -0
  98. data/installer/core/vendor/cache/loofah-2.2.3.gem +0 -0
  99. data/installer/core/vendor/cache/mail-2.7.1.gem +0 -0
  100. data/installer/core/vendor/cache/marcel-0.3.3.gem +0 -0
  101. data/installer/core/vendor/cache/mime-types-3.2.2.gem +0 -0
  102. data/installer/core/vendor/cache/mime-types-data-3.2018.0812.gem +0 -0
  103. data/installer/core/vendor/cache/mini_mime-1.0.1.gem +0 -0
  104. data/installer/core/vendor/cache/money-6.13.1.gem +0 -0
  105. data/installer/core/vendor/cache/nokogiri-1.8.5.gem +0 -0
  106. data/installer/core/vendor/cache/parser-2.5.3.0.gem +0 -0
  107. data/installer/core/vendor/cache/powerpack-0.1.2.gem +0 -0
  108. data/installer/core/vendor/cache/public_suffix-3.0.3.gem +0 -0
  109. data/installer/core/vendor/cache/puma-3.12.0.gem +0 -0
  110. data/installer/core/vendor/cache/rack-test-1.1.0.gem +0 -0
  111. data/installer/core/vendor/cache/rails-assets-animate-css-3.7.0.gem +0 -0
  112. data/installer/core/vendor/cache/retriable-3.1.2.gem +0 -0
  113. data/installer/core/vendor/cache/rspec-expectations-3.8.2.gem +0 -0
  114. data/installer/core/vendor/cache/rspec-rails-3.8.1.gem +0 -0
  115. data/installer/core/vendor/cache/ruby-progressbar-1.10.0.gem +0 -0
  116. data/installer/core/vendor/cache/sass-3.6.0.gem +0 -0
  117. data/installer/core/vendor/cache/scss_lint-0.57.1.gem +0 -0
  118. data/installer/core/vendor/cache/signet-0.11.0.gem +0 -0
  119. data/installer/core/vendor/cache/spreadsheet-1.1.8.gem +0 -0
  120. data/installer/core/vendor/cache/sprockets-3.7.2.gem +0 -0
  121. data/installer/core/vendor/cache/turbolinks-source-5.2.0.gem +0 -0
  122. data/installer/core/vendor/cache/unicode-display_width-1.4.0.gem +0 -0
  123. data/installer/core/vendor/cache/web-console-3.7.0.gem +0 -0
  124. data/lib/keppler/cli.rb +1 -1
  125. data/lib/keppler/version.rb +1 -1
  126. metadata +11 -2993
  127. data/LICENSE.txt +0 -21
  128. data/installer/core/app/controllers/admin/customizes_controller.rb +0 -110
  129. data/installer/core/app/helpers/customizes_helper.rb +0 -5
  130. data/installer/core/app/models/customize.rb +0 -30
  131. data/installer/core/app/policies/customize_policy.rb +0 -11
  132. data/installer/core/app/services/admin/template_service.rb +0 -129
  133. data/installer/core/app/views/admin/customizes/_description.html.haml +0 -13
  134. data/installer/core/app/views/admin/customizes/_form.html.haml +0 -33
  135. data/installer/core/app/views/admin/customizes/_listing.html.haml +0 -15
  136. data/installer/core/app/views/admin/customizes/_switch_default_template.html.haml +0 -11
  137. data/installer/core/app/views/admin/customizes/_switch_template.html.haml +0 -19
  138. data/installer/core/app/views/admin/customizes/index.html.haml +0 -38
  139. data/installer/core/app/views/admin/customizes/new.html.haml +0 -4
  140. data/installer/core/db/migrate/20170603145521_create_customizes.rb +0 -10
  141. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-accordion.html +0 -56
  142. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-alert.html +0 -18
  143. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-button-group.html +0 -15
  144. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-button.html +0 -15
  145. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-checks.html +0 -23
  146. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-collapse.html +0 -23
  147. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-columns-12.html +0 -59
  148. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-columns-2.html +0 -29
  149. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-columns-3.html +0 -32
  150. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-columns-4.html +0 -35
  151. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-columns-6.html +0 -41
  152. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-container.html +0 -15
  153. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-dropdown-btn.html +0 -22
  154. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-form.html +0 -33
  155. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-jumbotron.html +0 -25
  156. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-label.html +0 -13
  157. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-list-group.html +0 -22
  158. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-modal.html +0 -32
  159. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-navbar.html +0 -71
  160. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-pagination.html +0 -31
  161. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-panel-table.html +0 -48
  162. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-panel.html +0 -19
  163. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-progress-bar.html +0 -17
  164. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-radio.html +0 -23
  165. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-table.html +0 -42
  166. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-tabs.html +0 -34
  167. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-textarea.html +0 -13
  168. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-thumbnail.html +0 -23
  169. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-well.html +0 -13
  170. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/btsp-input.html +0 -13
  171. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-banner-blur-parallax.html +0 -59
  172. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-banner-blur.html +0 -58
  173. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-banner-parallax.html +0 -49
  174. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-banner-static.html +0 -48
  175. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-banner-video.html +0 -54
  176. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-block.html +0 -15
  177. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-h1.html +0 -13
  178. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-h2.html +0 -13
  179. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-h3.html +0 -13
  180. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-h4.html +0 -13
  181. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-small.html +0 -13
  182. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/slick/slick-basic.html +0 -43
  183. data/installer/core/rockets/keppler_ga_dashboard/app/controllers/keppler_ga_dashboard/dashboard_controller.rb +0 -64
  184. data/installer/core/rockets/keppler_ga_dashboard/app/helpers/keppler_ga_dashboard/dashboard_helper.rb +0 -14
  185. data/installer/core/spec/factories/customize.rb +0 -6
  186. data/installer/core/spec/models/customize_spec.rb +0 -23
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2018 Luis Perez
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
@@ -1,110 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Admin
4
- # CustomizesController
5
- class CustomizesController < AdminController
6
- before_action :set_customize, only: %i[show edit update
7
- destroy authorization]
8
- before_action :set_customizes, only: %i[update install_default]
9
- before_action :show_history, only: %i[index]
10
- before_action :authorization, except: %i[reload install_default]
11
-
12
- # GET /customizes
13
- def index
14
- @q = Customize.ransack(params[:q])
15
- customizes = @q.result(distinct: true)
16
- @objects = customizes.page(@current_page)
17
- @total = customizes.size
18
- return unless !@objects.first_page? && @objects.blank?
19
- redirect_to customizes_path(
20
- page: @current_page.to_i.pred, search: @query
21
- )
22
- end
23
-
24
- # GET /customizes/new
25
- def new
26
- @customize = Customize.new
27
- end
28
-
29
- # POST /customizes
30
- def create
31
- @customize = Customize.new(customize_params)
32
- @customize.installed = false
33
-
34
- if @customize.save
35
- redirect_to admin_customizes_path
36
- else
37
- render :new
38
- end
39
- end
40
-
41
- # PATCH/PUT /customizes/1
42
- def update
43
- @customizes.each { |customize| customize.update(installed: false) }
44
- if @customize.update(customize_params)
45
- @customize.installed? ? @customize.install : @customize.uninstall
46
- redirect_to admin_customizes_path
47
- else
48
- render :edit
49
- end
50
- end
51
-
52
- def install_default
53
- @customize = Customize.find(params[:customize_id])
54
- if @customize.installed?
55
- redirect_to admin_customizes_path
56
- else
57
- install_keppler_template(@customizes, @customize)
58
- end
59
- end
60
-
61
- # DELETE /customizes/1
62
- def destroy
63
- @customize.install if @customize.installed?
64
- @customize.destroy
65
- redirect_to admin_customizes_path, notice: actions_messages(@customize)
66
- end
67
-
68
- def destroy_multiple
69
- Customize.destroy redefine_ids(params[:multiple_ids])
70
- redirect_to(
71
- admin_customizes_path(page: @current_page, search: @query),
72
- notice: actions_messages(@customize)
73
- )
74
- end
75
-
76
- private
77
-
78
- def install_keppler_template(customizes, customize)
79
- customizes.each { |c| c.update(installed: false) }
80
- if customize.update(customize_params)
81
- customize.set_defaut
82
- redirect_to admin_customizes_path
83
- else
84
- render :edit
85
- end
86
- end
87
-
88
- # Use callbacks to share common setup or constraints between actions.
89
- def set_customize
90
- @customize = Customize.find(params[:id])
91
- end
92
-
93
- def set_customizes
94
- @customizes = Customize.all
95
- end
96
-
97
- def authorization
98
- authorize Customize
99
- end
100
-
101
- # Only allow a trusted parameter "white list" through.
102
- def customize_params
103
- params.require(:customize).permit(:file, :installed)
104
- end
105
-
106
- def show_history
107
- get_history(Customize)
108
- end
109
- end
110
- end
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # CustomizesHelper -> Helpers base
4
- module CustomizesHelper
5
- end
@@ -1,30 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Customize Model
4
- class Customize < ApplicationRecord
5
- include ActivityHistory
6
- include CloneRecord
7
- mount_uploader :file, TemplateUploader
8
- delegate :install, :uninstall, :set_defaut,
9
- to: :template
10
-
11
- # validates :file, uniqueness: true
12
- # Fields for the search form in the navbar
13
- def self.search_field
14
- :file_cont
15
- end
16
-
17
- def name
18
- if file?
19
- template.name(file)
20
- else
21
- 'Keppler Default'
22
- end
23
- end
24
-
25
- private
26
-
27
- def template
28
- Admin::TemplateService.new(file)
29
- end
30
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Policy for customize model
4
- class CustomizePolicy < ControllerPolicy
5
- attr_reader :user, :objects
6
-
7
- def initialize(user, objects)
8
- @user = user
9
- @objects = objects
10
- end
11
- end
@@ -1,129 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Admin
4
- # TemplateService
5
- class TemplateService
6
-
7
-
8
- def initialize(file)
9
- @file = file
10
- end
11
-
12
- def name(file)
13
- "#{file.to_s.split('/').last.split('.').first.capitalize} Template"
14
- end
15
-
16
- def install
17
- clear_template
18
- unzip_template
19
- install_template_html
20
- [:css, :img, :js, :fonts].each do |stack|
21
- install_template(stack)
22
- end
23
- end
24
-
25
- def uninstall
26
- clear_template
27
- end
28
-
29
- def set_defaut
30
- clear_template
31
- end
32
-
33
- private
34
-
35
- def dir
36
- {
37
- template: 'public/templates',
38
- css: 'app/assets/stylesheets/css',
39
- img: 'app/assets/images/img',
40
- fonts: 'app/assets/images/fonts',
41
- js: 'app/assets/javascripts/js'
42
- }
43
- end
44
-
45
- def clear_template
46
- file_name = Dir[File.join("#{Rails.root}/#{dir[:template]}", '**', '*')].first
47
- template_name = file_name.split('/').last if file_name
48
- names = build_array_html_files_names(template_name, 'html')
49
- system "rails d keppler_front front #{names.join(' ')}"
50
- system "rm -rf #{Rails.root}/app/views/app/front/"
51
- [:template, :css, :img, :fonts, :js].each do |stack|
52
- clear_assets("#{Rails.root}/#{dir[stack]}")
53
- end
54
- system "rails g keppler_front front index --skip-migration -f"
55
- system "rm -rf #{Rails.root}/app/model/front.rb"
56
- end
57
-
58
- def unzip_template
59
- system "unzip #{Rails.root}/public/#{@file} -d #{Rails.root}/public/templates"
60
- end
61
-
62
- def build_array_html_files_names(template_name, extention)
63
- names = []
64
- Dir[File.join("#{Rails.root}/public/templates/#{template_name}", '**', '*')].each do |file|
65
- if File.file?(file)
66
- name = file.to_s.split("/").last.split(".").first
67
- extentions = file.to_s.split("/").last.split(".").second
68
- if extentions.eql?(extention)
69
- names << name
70
- end
71
- end
72
- end
73
- return names
74
- end
75
-
76
- def build_array_assets_files_names(template_name, extention)
77
- names = []
78
- Dir[File.join("#{Rails.root}/public/templates/#{template_name}/assets/#{extention}", '**', '*')].each do |file|
79
- if File.file?(file)
80
- name = file.to_s.split("/").last
81
- names << name
82
- end
83
- end
84
- return names
85
- end
86
-
87
- def install_template_html
88
- system "rails d keppler_front front index"
89
- folder = "#{Rails.root}/app/views/app/front"
90
- template_name = Dir[File.join("#{Rails.root}/public/templates", '**', '*')].first.split("/").last
91
- names = build_array_html_files_names(template_name, "html")
92
- system "rails g keppler_front front #{names.join(' ')} --skip-migration -f"
93
- system "rm -rf #{Rails.root}/app/model/front.rb"
94
- names.each do |name|
95
- system "rm -rf #{folder}/#{name}.html.haml"
96
- system "cp #{Rails.root}/public/templates/#{template_name}/#{name}.html #{folder}/#{name}.html"
97
- system "html2haml #{folder}/#{name}.html #{folder}/#{name}.html.haml"
98
- system "rm -rf #{folder}/#{name}.html"
99
- add_assets_keppler(folder, name)
100
- end
101
- end
102
-
103
- def clear_assets(folder)
104
- system "rm -rf #{folder}"
105
- system "mkdir #{folder}"
106
- end
107
-
108
- def install_template(stack)
109
- folder = "#{Rails.root}/#{dir[stack]}"
110
- clear_assets(folder)
111
- template_name = Dir[File.join("#{Rails.root}/public/templates", '**', '*')].first.split("/").last
112
- names = build_array_assets_files_names(template_name, "#{stack}")
113
- names.each do |name|
114
- system "cp #{Rails.root}/public/templates/#{template_name}/assets/#{stack}/#{name} #{folder}/#{name}"
115
- end
116
- end
117
-
118
- def add_assets_keppler(folder, name)
119
- index_html = File.readlines("#{folder}/#{name}.html.haml")
120
- head_idx = 0
121
- index_html.each do |i|
122
- head_idx = index_html.find_index(i) if i.include?('%html')
123
- end
124
- index_html.insert(head_idx.to_i + 2, " = render 'app/layouts/head'\n")
125
- index_html = index_html.join('')
126
- File.write("#{folder}/#{name}.html.haml", index_html)
127
- end
128
- end
129
- end
@@ -1,13 +0,0 @@
1
- %aside.control-sidebar.control-sidebar-light
2
- .tab-content
3
- %p.control-sidebar-heading
4
- = activities.empty? ? t('keppler.messages.no_events') : t('keppler.titles.history')
5
- %ul.timeline
6
- - activities.each do |activity|
7
- - if activity.trackable_type.eql? 'Session'
8
- %li
9
- = render partial: "public_activity/session/#{activity.key.split('.').second}", locals: { activity: activity, method: 'name' }
10
- - else
11
- %li
12
- = render partial: "public_activity/layout/#{activity.key.split('.').second}", locals: { activity: activity, method: 'name' }
13
- .control-sidebar-bg
@@ -1,33 +0,0 @@
1
- = simple_form_for [:admin, @customize] do |f|
2
- .container
3
- .row
4
- .col-lg-2
5
- = link_to admin_customizes_path, 'data-position' => 'bottom', 'data-tooltip' => t('keppler.actions.back') do
6
- .arrow-back.btn.btn-default
7
- %i.icon-arrow-left
8
- = t('keppler.actions.back')
9
-
10
- .row
11
- .col-lg-12
12
- .box.slice-box
13
- .box-header.with-border
14
- %h3.box-title Template
15
-
16
- .box-body
17
- %table.table.table-bordered
18
- %tbody
19
- .form-padding
20
- .row
21
- .col-lg-12
22
- .container
23
- .row
24
- .col-md-12
25
- .form-group.files
26
- %input{ type: 'hidden', name: 'customize[file]' }
27
- = f.input :file, label: false
28
-
29
- .row
30
- .col-lg-12
31
- .pull-right
32
- = f.button :submit, t('keppler.actions.save'), name: '_save', class: 'btn-primary'
33
- = f.button :submit, t('keppler.actions.save_and_add_another'), name: '_add_other'
@@ -1,15 +0,0 @@
1
- %tr{ id: "row-#{customize.id}" }
2
- %td.item-check{ style: 'width: 5%' }
3
- - if can?(Customize).destroy?
4
- - if !customize.id.eql?(1) && !customize.installed
5
- = link_to admin_customize_path(customize), method: :delete do
6
- %i.icon-trash.icon-delete{ onclick: "$('.spinner').css('display', 'block')" }
7
- %td
8
- %span.pull-left
9
- = customize.name
10
- %td.center
11
- %span
12
- - if customize.file?
13
- = render 'admin/customizes/switch_template', customize: customize
14
- - else
15
- = render 'admin/customizes/switch_default_template', customize: customize
@@ -1,11 +0,0 @@
1
- = simple_form_for customize, url: admin_customize_install_default_path(customize), method: :post do
2
- - if customize.installed == false
3
- %label.switch.pull-right
4
- %input{ name: 'customize[installed]', type: 'hidden', value: 'true' }
5
- %input#default_switch_on{ name: 'customize[installed]', type: 'checkbox', value: 'true' }
6
- %span.slider.round{ onclick: "$('#edit_customize_#{customize.id}').submit(); $('.spinner').css('display', 'block')" }
7
- - else
8
- %label.switch.pull-right
9
- %input{ name: 'customize[installed]', type: 'hidden', value: 'false' }
10
- %input.active#default_switch_off{ name: 'customize[installed]', type: 'checkbox', value: 'false', checked: 'checked' }
11
- %span.slider.round{ onclick: "$('#edit_customize_#{customize.id}').submit(); $('.spinner').css('display', 'block')" }
@@ -1,19 +0,0 @@
1
- .pull-right
2
- = simple_form_for [:admin, customize] do
3
- %label
4
- - if customize.installed == false
5
- %label.switch.pull-right
6
- %input{ name: 'customize[installed]', type: 'hidden', value: 'true' }
7
- %input#default_switch_on{ name: 'customize[installed]', type: 'checkbox', value: 'true' }
8
- %span.slider.round{ onclick: "installTemplate(#{customize.id})" }
9
- - else
10
- %label.switch.pull-right
11
- %input{ name: 'customize[installed]', type: 'hidden', value: 'false' }
12
- %input.active#default_switch_off{ name: 'customize[installed]', type: 'checkbox', value: 'false', checked: 'checked' }
13
- %span.slider.round{ onclick: "installTemplate(#{customize.id})" }
14
-
15
- :javascript
16
- function installTemplate(customize_id) {
17
- $('.spinner').css('display', 'block')
18
- $('#edit_customize_'+customize_id).submit()
19
- }
@@ -1,38 +0,0 @@
1
- .row.customize-index#index-container
2
- .col-md-6.col-lg-6
3
- .box.slice-box
4
- .box-header.with-border
5
- %h3.box-title Preview
6
- .box-tools.pull-right#tools
7
- %i.icon-screen-smartphone#xs{ onclick: "$('.iframe-body').animate({ 'width': '35%' }, 300)" }
8
- %i.icon-screen-tablet#md{ onclick: "$('.iframe-body').animate({ 'width': '70%' }, 300)" }
9
- %i.icon-screen-desktop#lg{ onclick: "$('.iframe-body').animate({ 'width': '100%' }, 300)" }
10
- -# %span.separator-line
11
- %i.icon-reload#reload{ onclick: "$('iframe').attr('src', '/')" }
12
- = link_to root_path, target: '_blank' do
13
- %i.icon-size-fullscreen
14
-
15
- .box-body.box-body-no-padding.hidden-xs.iframe-body
16
- %iframe{ src: root_path, frameborder: '0' }
17
- .col-md-6.col-lg-6
18
- .box.slice-box
19
- .box-header.with-border
20
- %h3.box-title Frontend Theme
21
- .box-body.no-padding
22
- %table.table
23
- %tbody
24
- - @objects.each do |customize|
25
- = render 'listing', customize: customize
26
- - if @objects.size.zero?
27
- %tr
28
- %td{ colspan: 4 }
29
- %center
30
- = t('keppler.messages.not_found_records', model: t('keppler.models.pluralize.customizes'))
31
- %center.paginator-module
32
- = paginate @objects, window: 1
33
- .listing-show.col.l3.m12.hidden-xs.hidden-sm.hide-on-med-and-down
34
- = render 'description', activities: @activities
35
- - if can?(Customize).create?
36
- .mixed-btn
37
- = link_to new_admin_customize_path, class: 'btn-float' do
38
- +