knitkit 3.0.0 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (203) hide show
  1. checksums.yaml +4 -4
  2. data/{public → app/assets}/images/check.png +0 -0
  3. data/{public → app/assets}/images/credit_card.png +0 -0
  4. data/{public → app/assets}/images/inline_edit/close.png +0 -0
  5. data/{public → app/assets}/images/knitkit/icons/document.png +0 -0
  6. data/{public → app/assets}/images/knitkit/icons/multi_doc.png +0 -0
  7. data/{public → app/assets}/images/knitkit/logo.png +0 -0
  8. data/{public → app/assets}/images/knitkit/splash/images/add-site.png +0 -0
  9. data/app/assets/images/knitkit/splash/images/add_website_105x105-active.png +0 -0
  10. data/app/assets/images/knitkit/splash/images/add_website_105x105.png +0 -0
  11. data/{public → app/assets}/images/knitkit/splash/images/adjust-site.png +0 -0
  12. data/{public → app/assets}/images/knitkit/splash/images/browse-site.png +0 -0
  13. data/app/assets/images/knitkit/splash/images/browse_db_105x105-active.png +0 -0
  14. data/app/assets/images/knitkit/splash/images/browse_db_105x105.png +0 -0
  15. data/app/assets/images/knitkit/splash/images/console_105x105-active.png +0 -0
  16. data/app/assets/images/knitkit/splash/images/console_105x105.png +0 -0
  17. data/{public → app/assets}/images/knitkit/splash/images/find-themes.png +0 -0
  18. data/app/assets/images/knitkit/splash/images/find_themes_105x105-active.png +0 -0
  19. data/app/assets/images/knitkit/splash/images/find_themes_105x105.png +0 -0
  20. data/app/assets/images/knitkit/splash/images/learn_more_105x105-active.png +0 -0
  21. data/app/assets/images/knitkit/splash/images/learn_more_105x105.png +0 -0
  22. data/{public → app/assets}/images/knitkit/splash/images/settings.png +0 -0
  23. data/{public → app/assets}/images/knitkit/splash/images/tutorials.png +0 -0
  24. data/app/assets/images/knitkit/splash/splash.png +0 -0
  25. data/app/assets/images/widgets/manage_profile/contact_information.png +0 -0
  26. data/app/assets/images/widgets/manage_profile/password.png +0 -0
  27. data/app/assets/images/widgets/manage_profile/user_information.png +0 -0
  28. data/app/assets/javascripts/erp_app/desktop/applications/knitkit/app.js +24 -0
  29. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/articles_grid_panel.js +15 -12
  30. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/center_region.js +69 -48
  31. data/app/assets/javascripts/erp_app/desktop/applications/knitkit/comments_grid_panel.js +214 -0
  32. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/east_region.js +0 -0
  33. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/file_assets_panel.js +17 -19
  34. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/image_assets_data_view.js +13 -3
  35. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/image_assets_panel.js +59 -48
  36. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/widgets_panel.js +0 -0
  37. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/inquiries_grid_panel.js +2 -2
  38. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/module.js +2 -2
  39. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/publish_window.js +0 -0
  40. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/published_grid_panel.js +1 -1
  41. data/app/assets/javascripts/erp_app/desktop/applications/knitkit/splash_screen.js +268 -0
  42. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/top_menu/main_menu.js +85 -33
  43. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/top_menu/websites_combo.js +0 -0
  44. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/versions_grid_panel.js +5 -28
  45. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/article.js +22 -8
  46. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/document.js +143 -25
  47. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/host.js +5 -1
  48. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/menu.js +2 -0
  49. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/section.js +181 -65
  50. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/website_nav_items.js +0 -0
  51. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/hosts_tree_panel.js +0 -0
  52. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/menu_tree_panel.js +0 -0
  53. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/site_contents_tree_panel.js +121 -116
  54. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/themes_tree_panel.js +101 -10
  55. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/west_region.js +9 -5
  56. data/app/assets/javascripts/knitkit-web.js +22 -0
  57. data/app/assets/javascripts/knitkit/additional-methods.min.js +4 -0
  58. data/app/assets/javascripts/knitkit/bootstrap.min.js +7 -0
  59. data/app/assets/javascripts/knitkit/captcha.js +154 -0
  60. data/{public → app/assets}/javascripts/knitkit/confirm-bootstrap.js +1 -1
  61. data/{public → app/assets}/javascripts/knitkit/inline_editing.js +1 -1
  62. data/{public → app/assets}/javascripts/knitkit/jquery.maskedinput.min.js +0 -0
  63. data/app/assets/javascripts/knitkit/jquery.validate.min.js +4 -0
  64. data/app/assets/javascripts/knitkit/js.cookie.js +145 -0
  65. data/{public → app/assets}/javascripts/knitkit/theme.js +0 -0
  66. data/app/assets/stylesheets/erp_app/desktop/applications/knitkit/app.css +12 -0
  67. data/{public → app/assets}/stylesheets/erp_app/desktop/applications/knitkit/knitkit.css +23 -33
  68. data/app/assets/stylesheets/erp_app/shared/knitkit_shared.css +21 -0
  69. data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.eot +0 -0
  70. data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.svg +288 -0
  71. data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.ttf +0 -0
  72. data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.woff +0 -0
  73. data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.woff2 +0 -0
  74. data/app/assets/stylesheets/knitkit-web.css +16 -0
  75. data/app/assets/stylesheets/knitkit/bootstrap.min.css +5 -0
  76. data/app/assets/stylesheets/knitkit/captcha.css +59 -0
  77. data/app/assets/stylesheets/knitkit/custom.css +144 -0
  78. data/{public → app/assets}/stylesheets/knitkit/inline_editing.css +0 -0
  79. data/app/assets/stylesheets/knitkit/submenu.css +93 -0
  80. data/app/controllers/api/v1/websites_controller.rb +14 -0
  81. data/app/controllers/captcha_controller.rb +53 -0
  82. data/app/controllers/knitkit/base_controller.rb +1 -5
  83. data/app/controllers/knitkit/erp_app/desktop/app_controller.rb +2 -9
  84. data/app/controllers/knitkit/erp_app/desktop/articles_controller.rb +20 -7
  85. data/app/controllers/knitkit/erp_app/desktop/file_assets_controller.rb +38 -28
  86. data/app/controllers/knitkit/erp_app/desktop/image_assets_controller.rb +16 -9
  87. data/app/controllers/knitkit/erp_app/desktop/online_document_sections_controller.rb +69 -15
  88. data/app/controllers/knitkit/erp_app/desktop/position_controller.rb +45 -58
  89. data/app/controllers/knitkit/erp_app/desktop/theme_controller.rb +64 -29
  90. data/app/controllers/knitkit/erp_app/desktop/website_controller.rb +36 -13
  91. data/app/controllers/knitkit/erp_app/desktop/website_host_controller.rb +12 -0
  92. data/app/controllers/knitkit/erp_app/desktop/website_nav_controller.rb +4 -11
  93. data/app/controllers/knitkit/erp_app/desktop/website_nav_item_controller.rb +2 -9
  94. data/app/controllers/knitkit/erp_app/desktop/website_section_controller.rb +56 -20
  95. data/app/controllers/knitkit/online_document_sections_controller.rb +9 -3
  96. data/app/mailers/website_inquiry_mailer.rb +11 -3
  97. data/app/models/content.rb +16 -6
  98. data/app/models/documented_item.rb +12 -1
  99. data/app/models/online_document_section.rb +54 -20
  100. data/app/models/published_website.rb +16 -0
  101. data/app/models/theme.rb +53 -47
  102. data/app/models/website.rb +172 -191
  103. data/app/models/website_section.rb +64 -30
  104. data/app/views/knitkit/blogs/show.html.erb +5 -2
  105. data/app/views/layouts/knitkit/base.html.erb +54 -51
  106. data/app/views/menus/knitkit/_default_menu.html.erb +11 -11
  107. data/app/views/menus/knitkit/_default_section_menu.html.erb +2 -2
  108. data/app/views/menus/knitkit/_default_sub_menu.erb +27 -0
  109. data/app/views/menus/knitkit/_default_sub_section_menu.html.erb +30 -0
  110. data/app/views/website_inquiry_mailer/inquiry.html.erb +266 -0
  111. data/app/widgets/contact_us/base.rb +26 -16
  112. data/app/widgets/contact_us/javascript/contact_us.js +1 -1
  113. data/app/widgets/contact_us/views/error.html.erb +7 -3
  114. data/app/widgets/contact_us/views/index.html.erb +36 -28
  115. data/app/widgets/google_map/javascript/google_map.js +1 -1
  116. data/app/widgets/google_map/views/index.html.erb +1 -1
  117. data/app/widgets/login/javascript/login.js +1 -1
  118. data/app/widgets/login/views/index.html.erb +1 -1
  119. data/app/widgets/manage_profile/base.rb +141 -112
  120. data/app/widgets/manage_profile/javascript/manage_profile.js +2 -2
  121. data/app/widgets/manage_profile/views/_password_form.html.erb +1 -1
  122. data/app/widgets/manage_profile/views/_user_information_form.html.erb +1 -30
  123. data/app/widgets/manage_profile/views/index.html.erb +42 -40
  124. data/app/widgets/reset_password/base.rb +39 -8
  125. data/app/widgets/reset_password/javascript/reset_password.js +1 -1
  126. data/app/widgets/reset_password/views/index.html.erb +3 -3
  127. data/app/widgets/reset_password/views/invalid_reset_token.html.erb +7 -0
  128. data/app/widgets/reset_password/views/layouts/base.html.erb +1 -1
  129. data/app/widgets/reset_password/views/reset_password.html.erb +39 -0
  130. data/app/widgets/reset_password/views/reset_success.html.erb +5 -0
  131. data/app/widgets/search/base.rb +5 -5
  132. data/app/widgets/search/javascript/search.js +6 -6
  133. data/app/widgets/search/views/_inline_search_form.html.erb +23 -12
  134. data/app/widgets/search/views/_search_form.html.erb +34 -30
  135. data/app/widgets/search/views/layouts/base.html.erb +6 -1
  136. data/app/widgets/signup/base.rb +73 -30
  137. data/app/widgets/signup/javascript/signup.js +1 -1
  138. data/app/widgets/signup/views/_signup_form.html.erb +2 -1
  139. data/app/widgets/signup/views/layouts/base.html.erb +1 -1
  140. data/app/widgets/signup/views/success.html.erb +2 -3
  141. data/config/routes.rb +25 -4
  142. data/db/data_migrations/20110509223702_add_publisher_role.rb +0 -2
  143. data/db/data_migrations/20110816153456_add_knitkit_application.rb +7 -15
  144. data/db/data_migrations/20120127150505_create_website_default_configuration.rb +63 -3
  145. data/db/data_migrations/20150118180450_add_website_member_roles.rb +12 -0
  146. data/db/data_migrations/20150414150359_nest_knitkit_security_roles.rb +35 -0
  147. data/db/data_migrations/20150414173437_move_website_roles_under_website_builder.rb +19 -0
  148. data/db/migrate/20110211002317_setup_knitkit.rb +86 -39
  149. data/lib/knitkit.rb +8 -2
  150. data/lib/knitkit/config.rb +2 -3
  151. data/lib/knitkit/engine.rb +35 -4
  152. data/lib/knitkit/extensions.rb +2 -1
  153. data/lib/knitkit/extensions/action_controller/theme_support/acts_as_themed_controller.rb +1 -1
  154. data/lib/knitkit/extensions/action_mailer/theme_support/acts_as_themed_mailer.rb +1 -1
  155. data/lib/knitkit/extensions/compass_ae/mailers/user_mailer.rb +31 -0
  156. data/lib/knitkit/extensions/compass_ae/widgets/base.rb +1 -1
  157. data/lib/knitkit/extensions/railties/action_controller/captcha_helper.rb +43 -0
  158. data/lib/knitkit/extensions/railties/action_view/helpers/content_helper.rb +1 -1
  159. data/lib/knitkit/extensions/railties/action_view/helpers/menu_helper.rb +11 -1
  160. data/lib/knitkit/extensions/railties/theme_support/asset_tag_helper.rb +83 -0
  161. data/lib/knitkit/routing_filter/section_router.rb +24 -14
  162. data/lib/knitkit/version.rb +1 -1
  163. data/lib/tasks/knitkit_tasks.rake +89 -4
  164. data/lib/tasks/theme_parser.rake +85 -0
  165. data/public/fonts/glyphicons-halflings-regular.eot +0 -0
  166. data/public/fonts/glyphicons-halflings-regular.svg +288 -0
  167. data/public/fonts/glyphicons-halflings-regular.ttf +0 -0
  168. data/public/fonts/glyphicons-halflings-regular.woff +0 -0
  169. data/public/fonts/glyphicons-halflings-regular.woff2 +0 -0
  170. data/public/paypal-button.min.js +7 -0
  171. metadata +161 -82
  172. data/app/assets/javascripts/knitkit/application.js +0 -9
  173. data/app/assets/stylesheets/knitkit/application.css +0 -7
  174. data/app/mailers/document_mailer.rb +0 -10
  175. data/app/views/document_mailer/email_document.html.erb +0 -12
  176. data/app/views/knitkit/mobile/index.html.erb +0 -162
  177. data/app/views/knitkit/online_document_sections/index.html.erb +0 -279
  178. data/app/views/layouts/knitkit/online_document_sections.html.erb +0 -80
  179. data/app/views/website_inquiry_mailer/inquiry.erb +0 -24
  180. data/db/data_migrations/20120127150506_add_primary_host_to_website_configuration.rb +0 -33
  181. data/db/data_migrations/20120316150424_add_is_template_to_default_website_config.rb +0 -16
  182. data/db/data_migrations/20120809020508_update_website_and_configuration.rb +0 -82
  183. data/db/data_migrations/20121129185611_upgrade_website_role_iid.rb +0 -20
  184. data/db/migrate/20130405184234_add_use_markdown_to_section.rb +0 -19
  185. data/db/migrate/20131112013052_add_knitkit_missing_indexes.rb +0 -33
  186. data/db/migrate/20140622212723_update_website_inquiries.rb +0 -22
  187. data/db/migrate/20140911185022_add_publishing_to_website.rb +0 -5
  188. data/db/migrate/20141013073349_add_custom_fields_to_documents.rb +0 -12
  189. data/db/migrate/20141016101936_upgrade_remove_dynamic_attributes.rb +0 -13
  190. data/lib/knitkit/extensions/railties/theme_support/theme_file_resolver.rb +0 -49
  191. data/public/images/knitkit/close_window.png +0 -0
  192. data/public/images/knitkit/splash/splash.png +0 -0
  193. data/public/javascripts/erp_app/desktop/applications/knitkit/comments_grid_panel.js +0 -215
  194. data/public/javascripts/erp_app/desktop/applications/knitkit/select_roles_window.js +0 -108
  195. data/public/javascripts/erp_app/desktop/applications/knitkit/splash_screen.js +0 -170
  196. data/public/javascripts/knitkit/bootstrap-datepicker.js +0 -474
  197. data/public/javascripts/knitkit/bootstrap.min.js +0 -7
  198. data/public/javascripts/knitkit/mobile/app/view/Main.js +0 -108
  199. data/public/javascripts/knitkit/mobile/ux/slidenavigation/View.js +0 -734
  200. data/public/stylesheets/knitkit/bootstrap-responsive.min.css +0 -10
  201. data/public/stylesheets/knitkit/bootstrap.min.css +0 -7
  202. data/public/stylesheets/knitkit/custom.css +0 -122
  203. data/public/stylesheets/knitkit/datepicker.css +0 -182
@@ -1,20 +0,0 @@
1
- class UpgradeWebsiteRoleIid
2
-
3
- def self.up
4
- #insert data here
5
- Website.all.each do |w|
6
- old_role_iid = "website_#{w.name.underscore.gsub("'","").gsub(",","")}_access"
7
-
8
- r = SecurityRole.find_by_internal_identifier(old_role_iid)
9
- unless r.nil?
10
- r.internal_identifier = w.website_role_iid
11
- r.save
12
- end
13
- end
14
- end
15
-
16
- def self.down
17
- #remove data here
18
- end
19
-
20
- end
@@ -1,19 +0,0 @@
1
- class AddUseMarkdownToSection < ActiveRecord::Migration
2
- def self.up
3
- unless columns(:website_sections).collect {|c| c.name}.include?('use_markdown')
4
- add_column :website_sections, :use_markdown, :boolean
5
-
6
- WebsiteSection.all.each do |section|
7
- section.use_markdown = false
8
- section.save
9
- end
10
-
11
- end
12
- end
13
-
14
- def self.down
15
- if columns(:website_sections).collect {|c| c.name}.include?('use_markdown')
16
- remove_column :website_sections, :use_markdown
17
- end
18
- end
19
- end
@@ -1,33 +0,0 @@
1
- class AddKnitkitMissingIndexes < ActiveRecord::Migration
2
- def up
3
- if indexes(:websites).select { |index| index.name == 'websites_internal_identifier_idx' }.empty?
4
- add_index :websites, :internal_identifier, :name => 'websites_internal_identifier_idx'
5
- add_index :website_section_versions, :website_id, :name => 'website_section_versions_website_id_idx'
6
- add_index :website_section_versions, :internal_identifier, :name => 'website_section_versions_internal_identifier_idx'
7
- add_index :content_versions, :created_by_id, :name => 'content_versions_created_by_id_idx'
8
- add_index :content_versions, :updated_by_id, :name => 'content_versions_updated_by_id_idx'
9
- add_index :content_versions, :internal_identifier, :name => 'content_versions_internal_identifier_idx'
10
- add_index :themes, :theme_id, :name => 'themes_theme_id_idx'
11
- add_index :documented_items, :documented_content_id, :name => 'documented_items_documented_content_id_idx'
12
- add_index :documented_items, :online_document_section_id, :name => 'documented_items_online_document_section_id_idx'
13
- add_index :documents, :internal_identifier, :name => 'documents_internal_identifier_idx'
14
- add_index :document_types, :internal_identifier, :name => 'document_types_internal_identifier_idx'
15
- end
16
- end
17
-
18
- def down
19
- unless indexes(:websites).select { |index| index.name == 'websites_internal_identifier_idx' }.empty?
20
- remove_index :websites, :internal_identifier
21
- remove_index :website_section_versions, :website_id
22
- remove_index :website_section_versions, :internal_identifier
23
- remove_index :content_versions, :created_by_id
24
- remove_index :content_versions, :updated_by_id
25
- remove_index :content_versions, :internal_identifier
26
- remove_index :themes, :theme_id
27
- remove_index :documented_items, :documented_content_id
28
- remove_index :documented_items, :online_document_section_id
29
- remove_index :documents, :internal_identifier
30
- remove_index :document_types, :internal_identifier
31
- end
32
- end
33
- end
@@ -1,22 +0,0 @@
1
- class UpdateWebsiteInquiries < ActiveRecord::Migration
2
- def up
3
-
4
- add_column :website_inquiries, :first_name, :string
5
- add_column :website_inquiries, :last_name, :string
6
- add_column :website_inquiries, :email, :string
7
- add_column :website_inquiries, :message, :text
8
- add_column :website_inquiries, :created_by_id, :integer
9
-
10
- add_index :website_inquiries, :created_by_id, :name => 'inquiry_created_by_idx'
11
- end
12
-
13
- def down
14
-
15
- remove_column :website_inquiries, :first_name
16
- remove_column :website_inquiries, :last_name
17
- remove_column :website_inquiries, :email
18
- remove_column :website_inquiries, :message
19
- remove_column :website_inquiries, :created_by_id
20
-
21
- end
22
- end
@@ -1,5 +0,0 @@
1
- class AddPublishingToWebsite < ActiveRecord::Migration
2
- def change
3
- add_column :websites, :publishing, :boolean, :default => false
4
- end
5
- end
@@ -1,12 +0,0 @@
1
- class AddCustomFieldsToDocuments < ActiveRecord::Migration
2
- def change
3
- if ::ActiveRecord::Base.connection.instance_values["config"][:adapter] == 'postgresql'
4
- execute('CREATE EXTENSION IF NOT EXISTS hstore;')
5
-
6
- add_column :documents, :custom_fields, :hstore
7
- add_hstore_index :documents, :custom_fields
8
- else
9
- add_column :documents, :custom_fields, :text
10
- end
11
- end
12
- end
@@ -1,13 +0,0 @@
1
- # This migration is for removing dynamic attributes column from documents table.
2
- class UpgradeRemoveDynamicAttributes < ActiveRecord::Migration
3
- def up
4
- if table_exists?(:documents)
5
- if column_exists?(:documents, :dynamic_attributes)
6
- remove_column :documents, :dynamic_attributes
7
- end
8
- end
9
- end
10
-
11
- def down
12
- end
13
- end
@@ -1,49 +0,0 @@
1
- module ActionView
2
- class ThemeFileResolver < OptimizedFileSystemResolver
3
- def cached(key, path_info, details, locals) #:nodoc:
4
- name, prefix, partial = path_info
5
- locals = locals.map { |x| x.to_s }.sort!
6
-
7
- if key && caching?
8
- if @cached[key][name][prefix][partial][locals].nil? or @cached[key][name][prefix][partial][locals].empty?
9
- @cached[key][name][prefix][partial][locals] = decorate(yield, path_info, details, locals)
10
- else
11
- @cached[key][name][prefix][partial][locals].each do |template|
12
- #check if the file still exists
13
- if File.exists? template.identifier
14
- last_update = mtime(template.identifier)
15
- if last_update > template.updated_at
16
- @cached[key][name][prefix][partial][locals].delete_if{|item| item.identifier == template.identifier}
17
- @cached[key][name][prefix][partial][locals] << build_template(template.identifier, template.virtual_path, (details[:formats] || [:html] if template.formats.empty?), template.locals)
18
- end
19
- else
20
- @cached[key][name][prefix][partial][locals].delete_if{|item| item.identifier == template.identifier}
21
- end
22
- end
23
- @cached[key][name][prefix][partial][locals]
24
- end
25
- else
26
- fresh = decorate(yield, path_info, details, locals)
27
- return fresh unless key
28
-
29
- scope = @cached[key][name][prefix][partial]
30
- cache = scope[locals]
31
- mtime = cache && cache.map(&:updated_at).max
32
-
33
- if !mtime || fresh.empty? || fresh.any? { |t| t.updated_at > mtime }
34
- scope[locals] = fresh
35
- else
36
- cache
37
- end
38
- end
39
- end
40
-
41
- protected
42
-
43
- def build_template(p, virtual_path, formats, locals=nil)
44
- handler, format = extract_handler_and_format(p, formats)
45
- contents = File.open(p, "rb") { |io| io.read }
46
- Template.new(contents, p, handler, :virtual_path => virtual_path, :format => format, :updated_at => mtime(p), :locals => locals)
47
- end
48
- end
49
- end
@@ -1,215 +0,0 @@
1
- Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CommentsGridPanel",{
2
- extend:"Ext.grid.Panel",
3
- alias:'widget.knitkit_commentsgridpanel',
4
- approve : function(rec){
5
- var self = this;
6
- self.initialConfig['centerRegion'].setWindowStatus('Approving Comment...');
7
- Ext.Ajax.request({
8
- url: '/knitkit/erp_app/desktop/comments/approve',
9
- method: 'POST',
10
- params:{
11
- id:rec.get("id")
12
- },
13
- success: function(response) {
14
- var obj = Ext.decode(response.responseText);
15
- if(obj.success){
16
- self.initialConfig['centerRegion'].clearWindowStatus();
17
- self.getStore().load();
18
- }
19
- else{
20
- Ext.Msg.alert('Error', 'Error approving comemnt');
21
- self.initialConfig['centerRegion'].clearWindowStatus();
22
- }
23
- },
24
- failure: function(response) {
25
- self.initialConfig['centerRegion'].clearWindowStatus();
26
- Ext.Msg.alert('Error', 'Error approving comemnt');
27
- }
28
- });
29
-
30
-
31
- },
32
-
33
- deleteComment : function(rec){
34
- var self = this;
35
- self.initialConfig['centerRegion'].setWindowStatus('Deleting Comment...');
36
- Ext.Ajax.request({
37
- url: '/knitkit/erp_app/desktop/comments/delete',
38
- method: 'POST',
39
- params:{
40
- id:rec.get("id")
41
- },
42
- success: function(response) {
43
- var obj = Ext.decode(response.responseText);
44
- if(obj.success){
45
- self.initialConfig['centerRegion'].clearWindowStatus();
46
- self.getStore().load();
47
- }
48
- else{
49
- Ext.Msg.alert('Error', 'Error deleting comemnt');
50
- self.initialConfig['centerRegion'].clearWindowStatus();
51
- }
52
- },
53
- failure: function(response) {
54
- self.initialConfig['centerRegion'].clearWindowStatus();
55
- Ext.Msg.alert('Error', 'Error deleting comemnt');
56
- }
57
- });
58
-
59
-
60
- },
61
-
62
- initComponent: function() {
63
- this.callParent(arguments);
64
- this.getStore().load();
65
- },
66
-
67
- constructor : function(config) {
68
- var self = this;
69
-
70
- var store = Ext.create('Ext.data.Store', {
71
- proxy: {
72
- type: 'ajax',
73
- url:'/knitkit/erp_app/desktop/comments/index/' + config['contentId'],
74
- reader: {
75
- type: 'json',
76
- root: 'comments'
77
- }
78
- },
79
- remoteSort: true,
80
- fields:[
81
- {
82
- name:'id'
83
- },
84
- {
85
- name:'commentor_name'
86
- },
87
- {
88
- name:'email'
89
- },
90
- {
91
- name:'created_at'
92
- },
93
- {
94
- name:'approved?'
95
- },
96
- {
97
- name:'comment'
98
- },
99
- {
100
- name:'approved_by_username'
101
- },
102
- {
103
- name:'approved_at'
104
- }
105
- ]
106
- });
107
-
108
- config = Ext.apply({
109
- store:store,
110
- columns:[
111
- {
112
- header:'Commentor',
113
- sortable:true,
114
- width:150,
115
- dataIndex:'commentor_name'
116
- },
117
- {
118
- header:'Email',
119
- sortable:true,
120
- width:150,
121
- dataIndex:'email'
122
- },
123
- {
124
- header:'Commented On',
125
- dataIndex:'created_at',
126
- width:120,
127
- sortable:true,
128
- renderer: Ext.util.Format.dateRenderer('m/d/Y H:i:s')
129
- },
130
- {
131
- menuDisabled:true,
132
- resizable:false,
133
- xtype:'actioncolumn',
134
- header:'View',
135
- align:'center',
136
- width:50,
137
- items:[{
138
- icon:'/images/icons/document_view/document_view_16x16.png',
139
- tooltip:'View',
140
- handler :function(grid, rowIndex, colIndex){
141
- var rec = grid.getStore().getAt(rowIndex);
142
- self.initialConfig['centerRegion'].showComment(rec.get('comment'));
143
- }
144
- }]
145
- },
146
- {
147
- menuDisabled:true,
148
- resizable:false,
149
- xtype:'actioncolumn',
150
- header:'Approval',
151
- align:'center',
152
- width:60,
153
- items:[{
154
- getClass: function(v, meta, rec) { // Or return a class from a function
155
- if (rec.get('approved?')) {
156
- this.items[0].tooltip = 'Approved';
157
- return 'approved-col';
158
- } else {
159
- this.items[0].tooltip = 'Approve';
160
- return 'approve-col';
161
- }
162
- },
163
- handler: function(grid, rowIndex, colIndex) {
164
- var rec = grid.getStore().getAt(rowIndex);
165
- if(rec.get('approved?')){
166
- return false;
167
- }
168
- else{
169
- self.approve(rec)
170
- }
171
- }
172
- }]
173
- },
174
- {
175
- header:'Approved By',
176
- sortable:true,
177
- width:140,
178
- dataIndex:'approved_by_username'
179
- },
180
- {
181
- header:'Approved At',
182
- sortable:true,
183
- width:140,
184
- dataIndex:'approved_at',
185
- renderer: Ext.util.Format.dateRenderer('m/d/Y H:i:s')
186
- },
187
- {
188
- menuDisabled:true,
189
- resizable:false,
190
- xtype:'actioncolumn',
191
- header:'Delete',
192
- align:'center',
193
- width:50,
194
- items:[{
195
- icon:'/images/icons/delete/delete_16x16.png',
196
- tooltip:'Delete',
197
- handler :function(grid, rowIndex, colIndex){
198
- var rec = grid.getStore().getAt(rowIndex);
199
- self.deleteComment(rec);
200
- }
201
- }]
202
- }
203
- ],
204
- bbar: Ext.create("Ext.PagingToolbar",{
205
- pageSize: 10,
206
- store: store,
207
- displayInfo: true,
208
- displayMsg: '{0} - {1} of {2}',
209
- emptyMsg: "Empty"
210
- })
211
- }, config);
212
-
213
- this.callParent([config]);
214
- }
215
- });
@@ -1,108 +0,0 @@
1
- Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.SelectRolesWindow", {
2
- extend: "Ext.window.Window",
3
- alias: 'widget.knikit_selectroleswindow',
4
- initComponent: function () {
5
-
6
- this.addEvents(
7
- /**
8
- * @event success
9
- * Fired after success response is received from server
10
- * @param {Compass.ErpApp.Applications.Desktop.PublishWindow} this Object
11
- * @param {Object} Server Response
12
- */
13
- "success",
14
- /**
15
- * @event failure
16
- * Fired after response is received from server with error
17
- * @param {Compass.ErpApp.Applications.Desktop.PublishWindow} this Object
18
- * @param {Object} Server Response
19
- */
20
- "failure"
21
- );
22
-
23
- this.callParent(arguments);
24
- },
25
-
26
- constructor: function (config) {
27
- var currentRoles = config['currentRoles'],
28
- availableRoles = config['availableRoles'],
29
- checkBoxes = [];
30
-
31
- Ext.each(availableRoles, function (role) {
32
- checkBoxes.push({
33
- name: role['internal_identifier'],
34
- boxLabel: role['description'],
35
- checked: currentRoles.contains(role['internal_identifier'])
36
- })
37
- });
38
-
39
- config = Ext.apply({
40
- layout: 'fit',
41
- modal: true,
42
- title: 'Secure',
43
- iconCls: 'icon-document_lock',
44
- width: 250,
45
- height: 300,
46
- buttonAlign: 'center',
47
- plain: true,
48
- items: Ext.create('widget.form', {
49
- timeout: 130000,
50
- baseParams: config['baseParams'],
51
- autoHeight: true,
52
- labelWidth: 110,
53
- bodyPadding: '5px',
54
- frame: false,
55
- layout: 'fit',
56
- url: config['url'],
57
- defaults: {
58
- width: 225
59
- },
60
- items: [
61
- {
62
- xtype: 'fieldset',
63
- autoScroll: true,
64
- title: 'Select Roles',
65
- defaultType: 'checkbox',
66
- items: checkBoxes
67
- }
68
- ]
69
- }),
70
- buttons: [
71
- {
72
- text: 'Submit',
73
- listeners: {
74
- 'click': function (button) {
75
- var win = button.up('knikit_selectroleswindow');
76
- var formPanel = win.down('form');
77
- formPanel.getForm().submit({
78
- method: 'POST',
79
- waitMsg: 'Updating Security...',
80
- success: function (form, action) {
81
- var response = Ext.decode(action.response.responseText);
82
- win.fireEvent('success', win, response);
83
- win.close();
84
- },
85
- failure: function (form, action) {
86
- var response = Ext.decode(action.response.responseText);
87
- win.fireEvent('failure', win, response);
88
- }
89
- });
90
- }
91
- }
92
- },
93
- {
94
- text: 'Cancel',
95
- listeners: {
96
- 'click': function (button) {
97
- var win = button.up('knikit_selectroleswindow');
98
- win.close();
99
- }
100
- }
101
- }
102
- ]
103
- }, config);
104
-
105
- this.callParent([config]);
106
- }
107
-
108
- });