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
@@ -35,7 +35,7 @@ module KepplerFrontend
35
35
  end
36
36
 
37
37
  def rocket(name, model)
38
- name = name.singularize.downcase.camelize
38
+ name = name.downcase.camelize
39
39
  model = model.singularize.downcase.camelize
40
40
  "Keppler#{name}::#{model}".constantize
41
41
  end
@@ -2,7 +2,7 @@ module KepplerFrontend
2
2
  module App::FrontendHelper
3
3
  # begin devise_login
4
4
  def devise_login(hash = {})
5
- render 'keppler_frontend/app/partials/devise_login', hash: hash
5
+ render 'keppler_frontend/app/partials/devise_login', params: params
6
6
  end
7
7
  # end devise_login
8
8
  end
@@ -15,8 +15,8 @@ module KepplerFrontend
15
15
  head_idx = index_html.find_index(i) if i.include?(" module App::FrontendHelper")
16
16
  end
17
17
  index_html.insert(head_idx.to_i + 1, " # begin #{name}\n")
18
- index_html.insert(head_idx.to_i + 2, " def #{name}(hash = {})\n")
19
- index_html.insert(head_idx.to_i + 3, " render 'keppler_frontend/app/partials/#{name}', hash: hash\n")
18
+ index_html.insert(head_idx.to_i + 2, " def #{name}(params = {})\n")
19
+ index_html.insert(head_idx.to_i + 3, " render 'keppler_frontend/app/partials/#{name}', params: params\n")
20
20
  index_html.insert(head_idx.to_i + 4, " end\n")
21
21
  index_html.insert(head_idx.to_i + 5, " # end #{name}\n")
22
22
  index_html = index_html.join('')
@@ -51,8 +51,8 @@ module KepplerFrontend
51
51
  end
52
52
  return if begin_idx==0
53
53
  index_html[begin_idx] = " # begin #{helper[:name]}\n"
54
- index_html[begin_idx+1] = " def #{helper[:name]}(hash = {})\n"
55
- index_html[begin_idx+2] = " render 'keppler_frontend/app/partials/#{helper[:name]}', hash: hash\n"
54
+ index_html[begin_idx+1] = " def #{helper[:name]}(params = {})\n"
55
+ index_html[begin_idx+2] = " render 'keppler_frontend/app/partials/#{helper[:name]}', params: params\n"
56
56
  index_html[begin_idx+4] = " # end #{helper[:name]}\n"
57
57
  index_html = index_html.join('')
58
58
  File.write(file, index_html)
@@ -7,19 +7,16 @@ module KepplerFrontend
7
7
  module HtmlFile
8
8
  extend ActiveSupport::Concern
9
9
  def html_code
10
- # html = File.readlines("#{url_front}/app/views/keppler_frontend/app/partials/#{underscore_name}.html.erb")
11
- # html.join
12
-
13
10
  file = "#{url_front}/app/views/keppler_frontend/app/partials/#{underscore_name}.html.erb"
14
11
  index_html = File.readlines(file)
15
12
  begin_idx = 0
16
13
  end_idx = 0
17
14
  index_html.each do |idx|
18
- begin_idx = index_html.find_index(idx) if idx.include?("<!-- begin #{name} -->\n")
19
- end_idx = index_html.find_index(idx) if idx.include?("<!-- end #{name} -->\n")
15
+ begin_idx = index_html.find_index(idx) if idx.include?("<keppler-partial id='#{name}'>\n")
16
+ end_idx = index_html.find_index(idx) if idx.include?("</keppler-partial>\n")
20
17
  end
21
18
  # return if begin_idx==0
22
- index_html = index_html[begin_idx+2..end_idx-2]
19
+ index_html = index_html[begin_idx+1..end_idx-1]
23
20
  index_html = index_html.map { |line| line[0, line.length] }
24
21
  index_html.join('')
25
22
  end
@@ -28,11 +25,9 @@ module KepplerFrontend
28
25
  file = File.open("#{url_front}/app/views/keppler_frontend/app/partials/#{underscore_name}.html.erb", "w")
29
26
  index_html = File.readlines(file)
30
27
  head_idx = 0
31
- index_html.insert(head_idx.to_i + 1, "<!-- begin #{name} -->\n")
32
- index_html.insert(head_idx.to_i + 2, "<div id='#{name}'>\n")
33
- index_html.insert(head_idx.to_i + 3, " <h1> #{name} partial </h1>")
34
- index_html.insert(head_idx.to_i + 4, "\n</div>\n")
35
- index_html.insert(head_idx.to_i + 5, "<!-- end #{name} -->\n")
28
+ index_html.insert(head_idx.to_i + 1, "<keppler-partial id='#{name}'>\n")
29
+ index_html.insert(head_idx.to_i + 2, " <h1> #{name} partial </h1>")
30
+ index_html.insert(head_idx.to_i + 3, "\n</keppler-partial>\n")
36
31
  index_html = index_html.join('')
37
32
  File.write(file, index_html)
38
33
  file.close
@@ -52,13 +47,12 @@ module KepplerFrontend
52
47
  end_idx = 0
53
48
  default_idx = 0
54
49
  index_html.each do |idx|
55
- begin_idx = index_html.find_index(idx) if idx.include?("<!-- begin #{name} -->\n")
56
- end_idx = index_html.find_index(idx) if idx.include?("<!-- end #{name} -->\n")
50
+ begin_idx = index_html.find_index(idx) if idx.include?("<keppler-partial id='#{name}'>\n")
51
+ end_idx = index_html.find_index(idx) if idx.include?("</keppler-partial>\n")
57
52
  default_idx = index_html.find_index(idx) if idx.include?(" <h1> #{name} partial </h1>")
58
53
  end
59
- index_html[begin_idx] = "<!-- begin #{html[:name]} -->\n"
60
- index_html[begin_idx+1] = "<div id='#{html[:name]}'>\n"
61
- index_html[end_idx] = "<!-- end #{html[:name]} -->\n"
54
+ index_html[begin_idx] = "<keppler-partial id='#{html[:name]}'>\n"
55
+ index_html[end_idx] = "</keppler-partial>"
62
56
  index_html[default_idx] = " <h1> #{html[:name]} partial </h1>\n" unless default_idx.eql?(0)
63
57
  index_html = index_html.join('')
64
58
  File.write(file, index_html)
@@ -77,13 +71,13 @@ module KepplerFrontend
77
71
  begin_idx = 0
78
72
  end_idx = 0
79
73
  code_html.each do |i|
80
- begin_idx = code_html.find_index(i) if i.include?("<!-- begin #{name} -->\n")
81
- end_idx = code_html.find_index(i) if i.include?("<!-- end #{name} -->\n")
74
+ begin_idx = code_html.find_index(i) if i.include?("<keppler-partial id='#{name}'>\n")
75
+ end_idx = code_html.find_index(i) if i.include?("</keppler-partial>\n")
82
76
  end
83
77
  # return if begin_idx==0
84
- code_html.slice!(begin_idx+2..end_idx-2)
78
+ code_html.slice!(begin_idx+1..end_idx-1)
85
79
  code.split("\n").each_with_index do |line, i|
86
- code_html.insert(begin_idx+(i+2), " #{line}\n")
80
+ code_html.insert(begin_idx+(i+1), "#{line}\n")
87
81
  end
88
82
  code_html = code_html.join('')
89
83
  File.write(file, code_html)
@@ -78,7 +78,7 @@ module KepplerFrontend
78
78
  # return if begin_idx==0
79
79
  code_css.slice!(begin_idx+2..end_idx-2)
80
80
  code.split("\n").each_with_index do |line, i|
81
- code_css.insert(begin_idx+(i+2), " #{line}\n")
81
+ code_css.insert(begin_idx+(i+2), "#{line}\n")
82
82
  end
83
83
  code_css = code_css.join('')
84
84
  File.write(file, code_css)
@@ -101,30 +101,32 @@
101
101
  %i.fa.fa-save
102
102
  .control-sidebar-bg
103
103
  :javascript
104
- $('a[data-toggle="tab"]').on('shown.bs.tab', function (ev) {
105
- var tab = ev.target.innerText;
106
- var id = `#{@view.id}`;
104
+ $(document).on('turbolinks:load', function() {
105
+ $('a[data-toggle="tab"]').on('shown.bs.tab', function (ev) {
106
+ var tab = ev.target.innerText;
107
+ var id = `#{@view.id}`;
107
108
 
108
- if (tab === '') {
109
- tab = `#{@view.name}.html.erb`
110
- }
111
-
112
- $(document).bind('keydown', function(e) {
113
- if(e.ctrlKey && (e.which == 83)) {
114
- e.preventDefault();
115
- save()
109
+ if (tab === '') {
110
+ tab = `#{@view.name}.html.erb`
116
111
  }
117
- });
118
112
 
119
- function save() {
120
- if ( tab === `#{@view.name}.html.erb` ) {
121
- codeHTML.save(id);
122
- } else if (tab === `#{@view.name}.scss` ) {
123
- codeCSS.save(id);
124
- } else if (tab === `#{@view.name}.js` ) {
125
- codeJs.save(id);
126
- } else if (tab === 'Action') {
127
- codeAction.save(id);
113
+ $(document).bind('keydown', function(e) {
114
+ if(e.ctrlKey && (e.which == 83)) {
115
+ e.preventDefault();
116
+ save()
117
+ }
118
+ });
119
+
120
+ function save() {
121
+ if ( tab === `#{@view.name}.html.erb` ) {
122
+ codeHTML.save(id);
123
+ } else if (tab === `#{@view.name}.scss` ) {
124
+ codeCSS.save(id);
125
+ } else if (tab === `#{@view.name}.js` ) {
126
+ codeJs.save(id);
127
+ } else if (tab === 'Action') {
128
+ codeAction.save(id);
129
+ }
128
130
  }
129
- }
130
- })
131
+ })
132
+ });
@@ -31,30 +31,32 @@
31
31
  .control-sidebar-bg
32
32
 
33
33
  :javascript
34
- $('a[data-toggle="tab"]').on('shown.bs.tab', function (ev) {
35
- var tab = ev.target.innerText;
36
- var id = `#{@view.id}`;
34
+ $(document).on('turbolinks:load', function() {
35
+ $('a[data-toggle="tab"]').on('shown.bs.tab', function (ev) {
36
+ var tab = ev.target.innerText;
37
+ var id = `#{@view.id}`;
37
38
 
38
- if (tab === '') {
39
- tab = `#{@view.name}.html.erb`
40
- }
41
-
42
- $(document).bind('keydown', function(e) {
43
- if(e.ctrlKey && (e.which == 83)) {
44
- e.preventDefault();
45
- save()
39
+ if (tab === '') {
40
+ tab = `#{@view.name}.html.erb`
46
41
  }
47
- });
48
42
 
49
- function save() {
50
- if ( tab === `#{@view.name}.html.erb` ) {
51
- codeHTML.save(id);
52
- } else if (tab === `#{@view.name}.scss` ) {
53
- codeCSS.save(id);
54
- } else if (tab === `#{@view.name}.js` ) {
55
- codeJs.save(id);
56
- } else if (tab === 'Action') {
57
- codeAction.save(id);
43
+ $(document).bind('keydown', function(e) {
44
+ if(e.ctrlKey && (e.which == 83)) {
45
+ e.preventDefault();
46
+ save()
47
+ }
48
+ });
49
+
50
+ function save() {
51
+ if ( tab === `#{@view.name}.html.erb` ) {
52
+ codeHTML.save(id);
53
+ } else if (tab === `#{@view.name}.scss` ) {
54
+ codeCSS.save(id);
55
+ } else if (tab === `#{@view.name}.js` ) {
56
+ codeJs.save(id);
57
+ } else if (tab === 'Action') {
58
+ codeAction.save(id);
59
+ }
58
60
  }
59
- }
60
- })
61
+ })
62
+ }
@@ -65,7 +65,7 @@
65
65
  .row
66
66
  .col-lg-6
67
67
  %h4.box-title
68
- = truncate(partial.name, length: 30, omission: '...')
68
+ = truncate(partial.name, length: 15, omission: '...')
69
69
  .col-lg-3
70
70
  %span.box-title
71
71
  %a.btn.btn-default.pull-right{onclick: "copyPartial('#{partial.id}')"}
@@ -78,24 +78,26 @@
78
78
  .control-sidebar-bg
79
79
 
80
80
  :javascript
81
- $('a[data-toggle="tab"]').on('shown.bs.tab', function (ev) {
82
- $(document).bind('keydown',function(e) {
83
- if(e.ctrlKey && (e.which == 83)) {
84
- e.preventDefault();
85
- var tab = e.target.innerText;
86
- if (tab==='') {
87
- var tab = `#{@view.name}.html.erb`;
81
+ $(document).on('turbolinks:load', function() {
82
+ $('a[data-toggle="tab"]').on('shown.bs.tab', function (ev) {
83
+ $(document).bind('keydown',function(e) {
84
+ if(e.ctrlKey && (e.which == 83)) {
85
+ e.preventDefault();
86
+ var tab = e.target.innerText;
87
+ if (tab==='') {
88
+ var tab = `#{@view.name}.html.erb`;
89
+ }
90
+ var id = `#{@view.id}`
91
+ if ( tab === `#{@view.name}.html.erb`) {
92
+ codeHTML.save(id);
93
+ } else if (tab === `#{@view.name}.scss`) {
94
+ codeCSS.save(id);
95
+ } else if (tab === `#{@view.name}.js`) {
96
+ codeJs.save(id);
97
+ } else if (tab === 'Action') {
98
+ codeAction.save(id);
99
+ }
88
100
  }
89
- var id = `#{@view.id}`
90
- if ( tab === `#{@view.name}.html.erb`) {
91
- codeHTML.save(id);
92
- } else if (tab === `#{@view.name}.scss`) {
93
- codeCSS.save(id);
94
- } else if (tab === `#{@view.name}.js`) {
95
- codeJs.save(id);
96
- } else if (tab === 'Action') {
97
- codeAction.save(id);
98
- }
99
- }
100
- });
101
- })
101
+ });
102
+ })
103
+ }
@@ -68,14 +68,15 @@
68
68
  = render "description"
69
69
 
70
70
  :javascript
71
- $(document).ready(function(){
72
- $('#view').click(function() {
73
- $('#upload_file_view').click()
74
- $('#upload_file_view').change(function() {
75
- $('.waiting').css('display', 'block')
76
- $('#upload_form_view').submit()
77
- })
78
- });
71
+ (function() {
72
+ $(document).on('turbolinks:load', function() {});
73
+ $('#view').click(function() {
74
+ $('#upload_file_view').click()
75
+ $('#upload_file_view').change(function() {
76
+ $('.waiting').css('display', 'block')
77
+ $('#upload_form_view').submit()
78
+ })
79
+ });
79
80
 
80
- renderImg();
81
- });
81
+ renderImg();
82
+ }).call(this);
@@ -1,42 +1,42 @@
1
1
  <!-- begin devise_login -->
2
- <div id='devise_login'>
3
- <%- unless current_user %>
4
- <%= form_for(User.new, :as => User.new, :url => session_path(User.new), :html => { :role => 'form'}) do |f| %>
5
- <%= f.text_field :path, type: :hidden, class: "form-control validate", :value => "#{controller_path}##{action_name}" %>
6
- <div class="form-group">
7
- <label for="inputEmail3" class="col-sm-2 control-label">Email</label>
8
- <div class="col-sm-10">
9
- <%= f.email_field :email, :autofocus => true, class: "form-control validate", :placeholder => "Email" %>
10
- </div>
2
+ <keppler-partial id='devise_login'>
3
+ <%- unless current_user %>
4
+ <%= form_for(User.new, :as => User.new, :url => session_path(User.new), :html => { :role => 'form'}) do |f| %>
5
+ <%= f.text_field :path, type: :hidden, class: "form-control validate", :value => "#{controller_path}##{action_name}" %>
6
+ <div class="form-group">
7
+ <label for="inputEmail3" class="col-sm-2 control-label">Email</label>
8
+ <div class="col-sm-10">
9
+ <%= f.email_field :email, :autofocus => true, class: "form-control validate", :placeholder => "Email" %>
11
10
  </div>
12
- <div class="form-group">
13
- <label for="inputPassword3" class="col-sm-2 control-label">Password</label>
14
- <div class="col-sm-10">
15
- <%= f.password_field :password, :autofocus => true, class: "form-control validate #{'invalid' if flash[:alert]}", :placeholder => "Password" %>
16
- </div>
11
+ </div>
12
+ <div class="form-group">
13
+ <label for="inputPassword3" class="col-sm-2 control-label">Password</label>
14
+ <div class="col-sm-10">
15
+ <%= f.password_field :password, :autofocus => true, class: "form-control validate #{'invalid' if flash[:alert]}", :placeholder => "Password" %>
17
16
  </div>
18
- <div class="form-group has-feedback">
19
- <div class="devise-errors center-align">
20
- <%- flash.each do |name, msg| %>
21
- <%= content_tag :div, msg, :id => "flash_#{name}" if msg.is_a?(String) %>
22
- <% end %>
23
- </div>
17
+ </div>
18
+ <div class="form-group has-feedback">
19
+ <div class="devise-errors center-align">
20
+ <%- flash.each do |name, msg| %>
21
+ <%= content_tag :div, msg, :id => "flash_#{name}" if msg.is_a?(String) %>
22
+ <% end %>
24
23
  </div>
25
- <div class="form-group">
26
- <div class="col-sm-offset-2 col-sm-10">
27
- <div class="checkbox">
28
- <label>
29
- <input type="checkbox"> Remember me
30
- </label>
31
- </div>
24
+ </div>
25
+ <div class="form-group">
26
+ <div class="col-sm-offset-2 col-sm-10">
27
+ <div class="checkbox">
28
+ <label>
29
+ <input type="checkbox"> Remember me
30
+ </label>
32
31
  </div>
33
32
  </div>
34
- <div class="form-group">
35
- <div class="col-sm-offset-2 col-sm-10">
36
- <%= f.submit t("devise.sessions.log_in"), class: 'btn btn-primary' %>
37
- </div>
33
+ </div>
34
+ <div class="form-group">
35
+ <div class="col-sm-offset-2 col-sm-10">
36
+ <%= f.submit t("devise.sessions.log_in"), class: 'btn btn-primary' %>
38
37
  </div>
39
- <% end %>
40
- <%- end %>
41
- </div>
38
+ </div>
39
+ <% end %>
40
+ <%- end %>
41
+ </keppler-partial>
42
42
  <!-- end devise_login -->
@@ -12,5 +12,4 @@
12
12
  <!-- Keppler Section -->
13
13
  </keppler-footer>
14
14
  </body>
15
- <!-- <%= keppler_editor %> -->
16
15
  </html>
@@ -14,6 +14,5 @@
14
14
  <!-- Keppler Footer -->
15
15
  </keppler-footer>
16
16
  </body>
17
- <!-- <%= keppler_editor %> -->
18
17
  </html>
19
18