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
@@ -114,7 +114,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.InquiriesGridPanel", {
114
114
  flex: 0.5,
115
115
  items: [
116
116
  {
117
- icon: '/images/icons/eye/eye_16x16.png',
117
+ icon: '/assets/icons/eye/eye_16x16.png',
118
118
  tooltip: 'View',
119
119
  getClass: function (v, meta, rec) {
120
120
  return 'x-action-col-icon';
@@ -126,7 +126,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.InquiriesGridPanel", {
126
126
  }
127
127
  },
128
128
  {
129
- icon: '/images/icons/delete/delete_16x16.png',
129
+ icon: '/assets/icons/delete/delete_16x16.png',
130
130
  tooltip: 'Delete',
131
131
  getClass: function (v, meta, rec) {
132
132
  return 'x-action-col-icon';
@@ -12,7 +12,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit", {
12
12
  init: function () {
13
13
 
14
14
  this.launcher = {
15
- text: 'KnitKit',
15
+ text: 'Website Builder',
16
16
  iconCls: 'icon-knitkit',
17
17
  handler: this.createWindow,
18
18
  scope: this
@@ -209,7 +209,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit", {
209
209
 
210
210
  win = desktop.createWindow({
211
211
  id: 'knitkit',
212
- title: 'KnitKit',
212
+ title: 'Website Builder',
213
213
  width: 1200,
214
214
  height: 550,
215
215
  maximized: true,
@@ -197,7 +197,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.PublishedGridPanel", {
197
197
  }
198
198
  },
199
199
  {
200
- icon: '/images/icons/document/document_16x16.png',
200
+ icon: '/assets/icons/document/document_16x16.png',
201
201
  tooltip: 'Comments',
202
202
  handler: function (grid, rowIndex, colIndex) {
203
203
  var rec = grid.getStore().getAt(rowIndex);
@@ -0,0 +1,268 @@
1
+ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.SplashScreen", {
2
+ extend: "Ext.panel.Panel",
3
+ alias: 'widget.knitkit_splash_screen',
4
+ title: 'Startup',
5
+ closable: true,
6
+ items: [
7
+ {
8
+ html: "<div style='margin: 15px 50px 5px 50px;'><h2 style='margin: 3px 0 10px 0; color: #2fb3d4; text-align: center'>Website Builder Home</h2></div>"
9
+ },
10
+
11
+ {
12
+ xtype: 'image',
13
+ style: 'padding-left: 50%; margin-left: -258px;',
14
+ src: '/assets/knitkit/splash/splash.png'
15
+ },
16
+
17
+ {
18
+ html: "<div style='margin: 15px 50px 5px 50px;'><p style='margin: 0; color: #222; text-align: center; font-size: 16px; font-weight: 300;'>Click on the shortcuts below to get started.</p></div>"
19
+ },
20
+
21
+ {
22
+ xtype: 'panel',
23
+ layout: 'column',
24
+ style: 'width: 480px; margin-top: 0px; padding-top: 5px; margin-left: auto; margin-right: auto;',
25
+ items: [
26
+
27
+ {
28
+ xtype: 'panel',
29
+ height: 140,
30
+ width: 150,
31
+ style:{
32
+ margin: '0px 0px 5px 10px;',
33
+ cursor: 'pointer'
34
+ },
35
+ bodyStyle: '',
36
+ border: false,
37
+ bodyBorder: false,
38
+ overCls: 'shortcut-hover',
39
+ items: [
40
+
41
+ {
42
+ xtype: 'image',
43
+ src: '/assets/knitkit/splash/images/add_website_105x105.png',
44
+ height: 115,
45
+ width: 115,
46
+ style: 'background-color: #fff; margin-left: 15px;',
47
+ listeners: {
48
+ render: function (component) {
49
+ component.getEl().on('click', function (e) {
50
+
51
+ Ext.create("Ext.window.Window", {
52
+ modal: true,
53
+ title: 'New Website',
54
+ buttonAlign: 'center',
55
+ width: 360,
56
+ defaultFocus: 'name',
57
+ items: Ext.create('widget.form', {
58
+ labelWidth: 110,
59
+ frame: false,
60
+ bodyStyle: 'padding:5px 5px 0',
61
+ url: '/knitkit/erp_app/desktop/site/new',
62
+ defaults: {
63
+ width: 320
64
+ },
65
+ items: [
66
+ {
67
+ xtype: 'textfield',
68
+ fieldLabel: 'Name *',
69
+ allowBlank: false,
70
+ name: 'name',
71
+ itemId: 'name'
72
+ },
73
+ {
74
+ xtype: 'textfield',
75
+ fieldLabel: 'Host *',
76
+ allowBlank: false,
77
+ name: 'host'
78
+ },
79
+ {
80
+ xtype: 'textfield',
81
+ fieldLabel: 'Title *',
82
+ allowBlank: false,
83
+ name: 'title'
84
+ },
85
+ {
86
+ xtype: 'textfield',
87
+ fieldLabel: 'Sub Title',
88
+ allowBlank: true,
89
+ name: 'subtitle'
90
+ }
91
+ ]
92
+ }),
93
+ buttons: [
94
+ {
95
+ text: 'Submit',
96
+ listeners: {
97
+ 'click': function (button) {
98
+ var knitkitModule = compassDesktop.getModule('knitkit-win'),
99
+ knitkitWindow = compassDesktop.desktop.getWindow('knitkit'),
100
+ window = button.findParentByType('window'),
101
+ formPanel = window.query('.form')[0];
102
+
103
+ formPanel.getForm().submit({
104
+ waitMsg: 'Please wait...',
105
+ success: function (form, action) {
106
+ var obj = Ext.decode(action.response.responseText);
107
+ if (obj.success) {
108
+ var combo = knitkitWindow.down('websitescombo');
109
+ combo.store.load({
110
+ callback: function (records, operation, succes) {
111
+ for (i = 0; i < records.length; i++) {
112
+ if (records[i].data.id == obj.website.id) {
113
+ combo.select(records[i]);
114
+
115
+ knitkitModule.selectWebsite(records[i]);
116
+ window.close();
117
+
118
+ break;
119
+ }
120
+ }
121
+ }
122
+ });
123
+ }
124
+ },
125
+ failure: function (form, action) {
126
+ Ext.Msg.alert("Error", "Error creating website");
127
+ }
128
+ });
129
+ }
130
+ }
131
+ },
132
+ {
133
+ text: 'Close',
134
+ handler: function (btn) {
135
+ btn.up('window').close();
136
+ }
137
+ }
138
+ ]
139
+ }).show();
140
+
141
+
142
+ }, component);
143
+
144
+ component.getEl().on('mouseover', function () {
145
+ component.setSrc('/assets/knitkit/splash/images/add_website_105x105-active.png');
146
+ }
147
+ );
148
+ component.getEl().on('mouseout', function () {
149
+ component.setSrc('/assets/knitkit/splash/images/add_website_105x105.png');
150
+ }
151
+ );
152
+ }
153
+ }
154
+ },
155
+ {
156
+ html: "<p style='background-color: #fff; margin: 0px 0px 0px 0px; text-align: center'>Create a website</p>"
157
+ }
158
+ ]
159
+ },
160
+
161
+ {
162
+ xtype: 'panel',
163
+ height: 140,
164
+ width: 150,
165
+ style:{
166
+ margin: '0px 0px 5px 10px;',
167
+ cursor: 'pointer'
168
+ },
169
+ bodyStyle: '',
170
+ border: false,
171
+ bodyBorder: false,
172
+ overCls: 'shortcut-hover',
173
+ items: [
174
+
175
+ {
176
+ xtype: 'image',
177
+ src: '/assets/knitkit/splash/images/find_themes_105x105.png',
178
+ height: 115,
179
+ width: 115,
180
+ style: 'background-color: #fff; margin-left: 15px;',
181
+ listeners: {
182
+ render: function (component) {
183
+ component.getEl().on('click', function (e) {
184
+
185
+ var cr = this.findParentByType('knitkit_centerregion');
186
+ cr.openIframeInTab('Themes and Widgets', 'https://themes.mycompassagile.com');
187
+
188
+
189
+ }, component);
190
+
191
+ component.getEl().on('mouseover', function () {
192
+ component.setSrc('/assets/knitkit/splash/images/find_themes_105x105-active.png');
193
+ }
194
+ );
195
+ component.getEl().on('mouseout', function () {
196
+ component.setSrc('/assets/knitkit/splash/images/find_themes_105x105.png');
197
+ }
198
+ );
199
+ }
200
+ }
201
+ },
202
+ {
203
+ html: "<p style='background-color: #fff; margin: 0px 0px 0px 0px; text-align: center'>Find themes and assets</p>"
204
+ }
205
+ ]
206
+ },
207
+ {
208
+ xtype: 'panel',
209
+ height: 140,
210
+ width: 150,
211
+ style:{
212
+ margin: '0px 0px 5px 10px;',
213
+ cursor: 'pointer'
214
+ },
215
+ bodyStyle: '',
216
+ border: false,
217
+ bodyBorder: false,
218
+ overCls: 'shortcut-hover',
219
+ items: [
220
+
221
+ {
222
+ xtype: 'image',
223
+ src: '/assets/knitkit/splash/images/learn_more_105x105.png',
224
+ height: 115,
225
+ width: 115,
226
+ style: 'background-color: #fff; margin-left: 15px;',
227
+ listeners: {
228
+ render: function (component) {
229
+ component.getEl().on('click', function (e) {
230
+
231
+ var cr = this.findParentByType('knitkit_centerregion');
232
+ cr.openIframeInTab('Building Websites', 'https://docs.mycompassagile.com');
233
+
234
+ }, component);
235
+
236
+ component.getEl().on('mouseover', function () {
237
+ component.setSrc('/assets/knitkit/splash/images/learn_more_105x105-active.png');
238
+ }
239
+ );
240
+ component.getEl().on('mouseout', function () {
241
+ component.setSrc('/assets/knitkit/splash/images/learn_more_105x105.png');
242
+ }
243
+ );
244
+ }
245
+ }
246
+ },
247
+ {
248
+ html: "<p style='background-color: #fff; margin: 0px 0px 0px 0px; text-align: center'>Learn more</p>"
249
+ }
250
+ ]
251
+ }
252
+
253
+ ]
254
+ }
255
+ ],
256
+ constructor: function (config) {
257
+
258
+ var self = this;
259
+
260
+ config = Ext.apply({
261
+ //placeholder
262
+ }, config);
263
+
264
+ self.callParent(config);
265
+ }
266
+ });
267
+
268
+
@@ -12,6 +12,7 @@ Compass.ErpApp.Desktop.Applications.Knitkit.editWebsiteMenuItem = function (disa
12
12
  title: 'Update Website',
13
13
  plain: true,
14
14
  buttonAlign: 'center',
15
+ defaultFocus: 'name',
15
16
  items: Ext.create("Ext.form.Panel", {
16
17
  labelWidth: 110,
17
18
  frame: false,
@@ -26,6 +27,7 @@ Compass.ErpApp.Desktop.Applications.Knitkit.editWebsiteMenuItem = function (disa
26
27
  fieldLabel: 'Name',
27
28
  allowBlank: false,
28
29
  name: 'name',
30
+ itemId: 'name',
29
31
  value: knitkitModule.currentWebsite.name
30
32
  },
31
33
  {
@@ -226,6 +228,7 @@ Compass.ErpApp.Desktop.Applications.Knitkit.websiteMenu = function () {
226
228
  title: 'New Website',
227
229
  buttonAlign: 'center',
228
230
  width: 360,
231
+ defaultFocus: 'name',
229
232
  items: Ext.create('widget.form', {
230
233
  labelWidth: 110,
231
234
  frame: false,
@@ -240,14 +243,15 @@ Compass.ErpApp.Desktop.Applications.Knitkit.websiteMenu = function () {
240
243
  fieldLabel: 'Name *',
241
244
  allowBlank: false,
242
245
  name: 'name',
243
- plugins: [new helpQtip("This is required and must be unique. Spaces are OK.")]
246
+ itemId: 'name'
247
+ // plugins: [new helpQtip("This is required and must be unique. Spaces are OK.")]
244
248
  },
245
249
  {
246
250
  xtype: 'textfield',
247
251
  fieldLabel: 'Host *',
248
252
  allowBlank: false,
249
253
  name: 'host',
250
- plugins: [new helpQtip("If you are running locally, this will probably be localhost:3000.<br> Otherwise, it is the domain or subdomain for this CompassAE instance")]
254
+ //plugins: [new helpQtip("If you are running locally, this will probably be localhost:3000.<br> Otherwise, it is the domain or subdomain for this CompassAE instance")]
251
255
  },
252
256
  {
253
257
  xtype: 'textfield',
@@ -296,7 +300,9 @@ Compass.ErpApp.Desktop.Applications.Knitkit.websiteMenu = function () {
296
300
  }
297
301
  },
298
302
  failure: function (form, action) {
299
- Ext.Msg.alert("Error", "Error creating website");
303
+ var obj = Ext.decode(action.response.responseText);
304
+ var message = obj.message.indexOf('Host') == 0 ? obj.message : "Error creating website"
305
+ Ext.Msg.alert("Error", message);
300
306
  }
301
307
  });
302
308
  }
@@ -308,7 +314,20 @@ Compass.ErpApp.Desktop.Applications.Knitkit.websiteMenu = function () {
308
314
  btn.up('window').close();
309
315
  }
310
316
  }
311
- ]
317
+ ],
318
+ listeners: {
319
+ 'activate' : function(form){
320
+ Ext.Ajax.request({
321
+ url: '/knitkit/erp_app/desktop/site/get_current_host',
322
+ success: function(response){
323
+ var obj = Ext.decode(response.responseText);
324
+ if (obj.success) {
325
+ form.down('[name=host]').setValue(obj.host);
326
+ }
327
+ }
328
+ });
329
+ }
330
+ }
312
331
  }).show();
313
332
  }
314
333
  },
@@ -324,7 +343,9 @@ Compass.ErpApp.Desktop.Applications.Knitkit.websiteMenu = function () {
324
343
  height: 120,
325
344
  plain: true,
326
345
  buttonAlign: 'center',
327
- items: new Ext.FormPanel({
346
+ items: {
347
+ xtype: 'form',
348
+ timeout: 300,
328
349
  labelWidth: 110,
329
350
  frame: false,
330
351
  fileUpload: true,
@@ -343,7 +364,7 @@ Compass.ErpApp.Desktop.Applications.Knitkit.websiteMenu = function () {
343
364
  name: 'website_data'
344
365
  }
345
366
  ]
346
- }),
367
+ },
347
368
  buttons: [
348
369
  {
349
370
  text: 'Submit',
@@ -356,6 +377,7 @@ Compass.ErpApp.Desktop.Applications.Knitkit.websiteMenu = function () {
356
377
 
357
378
  formPanel.getForm().submit({
358
379
  waitMsg: 'Please wait...',
380
+ timeout: 300000,
359
381
  success: function (form, action) {
360
382
  var obj = Ext.decode(action.response.responseText);
361
383
  if (obj.success) {
@@ -419,15 +441,20 @@ Compass.ErpApp.Desktop.Applications.Knitkit.websiteMenu = function () {
419
441
  handler: function () {
420
442
  var knitkitModule = compassDesktop.getModule('knitkit-win'),
421
443
  knitkitWindow = compassDesktop.desktop.getWindow('knitkit'),
444
+ websiteName = knitkitModule.currentWebsite.name,
422
445
  websiteId = knitkitModule.currentWebsite.id;
423
446
 
424
- Ext.MessageBox.confirm('Confirm', 'Are you sure you want to delete this Website?', function (btn) {
447
+ Ext.MessageBox.confirm('Confirm', 'Are you sure you want to delete the website: ' + websiteName, function (btn) {
425
448
  if (btn == 'no') {
426
449
  return false;
427
450
  }
428
451
  else if (btn == 'yes') {
452
+ var loading = new Ext.LoadMask(knitkitWindow, {msg: 'Please wait...'});
453
+ loading.show();
454
+
429
455
  Ext.Ajax.request({
430
456
  url: '/knitkit/erp_app/desktop/site/delete',
457
+ timeout: 300000,
431
458
  method: 'POST',
432
459
  params: {
433
460
  website_id: websiteId
@@ -435,6 +462,8 @@ Compass.ErpApp.Desktop.Applications.Knitkit.websiteMenu = function () {
435
462
  success: function (response) {
436
463
  var obj = Ext.decode(response.responseText);
437
464
  if (obj.success) {
465
+ loading.hide();
466
+
438
467
  var combo = knitkitWindow.down('websitescombo');
439
468
  combo.store.load({
440
469
  callback: function (records, operation, succes) {
@@ -450,6 +479,8 @@ Compass.ErpApp.Desktop.Applications.Knitkit.websiteMenu = function () {
450
479
  });
451
480
  }
452
481
  else {
482
+ loading.hide();
483
+
453
484
  Ext.Msg.alert('Error', 'Error deleting Website');
454
485
  }
455
486
  },
@@ -504,10 +535,11 @@ Compass.ErpApp.Desktop.Applications.Knitkit.newSectionMenuItem = {
504
535
  websiteId = knitkitWin.currentWebsite.id;
505
536
 
506
537
  Ext.create("Ext.window.Window", {
507
- model: true,
538
+ modal: true,
508
539
  layout: 'fit',
509
540
  title: 'New Section',
510
541
  buttonAlign: 'center',
542
+ defaultFocus: 'title',
511
543
  items: Ext.create("Ext.form.Panel", {
512
544
  labelWidth: 110,
513
545
  frame: false,
@@ -521,7 +553,8 @@ Compass.ErpApp.Desktop.Applications.Knitkit.newSectionMenuItem = {
521
553
  xtype: 'textfield',
522
554
  fieldLabel: 'Title',
523
555
  allowBlank: false,
524
- name: 'title'
556
+ name: 'title',
557
+ itemId: 'title'
525
558
  },
526
559
  {
527
560
  xtype: 'textfield',
@@ -534,8 +567,8 @@ Compass.ErpApp.Desktop.Applications.Knitkit.newSectionMenuItem = {
534
567
  forceSelection: true,
535
568
  store: [
536
569
  ['Page', 'Page'],
537
- ['Blog', 'Blog'],
538
- ['OnlineDocumentSection', 'Online Document Section']
570
+ ['Blog', 'Blog'] //,
571
+ //['OnlineDocumentSection', 'Online Document Section']
539
572
  ],
540
573
  value: 'Page',
541
574
  fieldLabel: 'Type',
@@ -673,6 +706,7 @@ Compass.ErpApp.Desktop.Applications.Knitkit.newThemeMenuItem = {
673
706
  width: 360,
674
707
  plain: true,
675
708
  buttonAlign: 'center',
709
+ defaultFocus: 'name',
676
710
  items: Ext.create('widget.form', {
677
711
  labelWidth: 110,
678
712
  frame: false,
@@ -692,7 +726,8 @@ Compass.ErpApp.Desktop.Applications.Knitkit.newThemeMenuItem = {
692
726
  xtype: 'textfield',
693
727
  fieldLabel: 'Name *',
694
728
  allowBlank: false,
695
- name: 'name'
729
+ name: 'name',
730
+ itemId: 'name'
696
731
  },
697
732
  {
698
733
  xtype: 'textfield',
@@ -739,15 +774,17 @@ Compass.ErpApp.Desktop.Applications.Knitkit.newThemeMenuItem = {
739
774
 
740
775
  formPanel.getForm().submit({
741
776
  reset: true,
777
+ timeout: 300000,
742
778
  success: function (form, action) {
743
779
  loading.hide();
744
780
  window.close();
745
781
 
746
782
  var obj = Ext.decode(action.response.responseText);
747
783
  if (obj.success) {
748
- themesTreePanel.getStore().load({
749
- node: themesTreePanel.getRootNode()
750
- });
784
+ var store = themesTreePanel.getStore(),
785
+ rootNode = store.getRootNode();
786
+
787
+ rootNode.appendChild(obj.node);
751
788
  }
752
789
  },
753
790
  failure: function (form, action) {
@@ -784,7 +821,9 @@ Compass.ErpApp.Desktop.Applications.Knitkit.uploadThemeMenuItem = {
784
821
  modal: true,
785
822
  title: 'New Theme',
786
823
  buttonAlign: 'center',
787
- items: Ext.create('widget.form', {
824
+ items: {
825
+ xtype: 'form',
826
+ timeout: 300,
788
827
  frame: false,
789
828
  bodyStyle: 'padding:5px 5px 0',
790
829
  fileUpload: true,
@@ -797,15 +836,15 @@ Compass.ErpApp.Desktop.Applications.Knitkit.uploadThemeMenuItem = {
797
836
  },
798
837
  {
799
838
  xtype: 'fileuploadfield',
800
- width: '350px',
839
+ width: '350px',
801
840
  fieldLabel: 'Upload Theme',
802
841
  buttonText: 'Upload',
803
842
  buttonOnly: false,
804
- allowBlank: true,
843
+ allowBlank: false,
805
844
  name: 'theme_data'
806
845
  }
807
846
  ]
808
- }),
847
+ },
809
848
  buttons: [
810
849
  {
811
850
  text: 'Submit',
@@ -816,13 +855,16 @@ Compass.ErpApp.Desktop.Applications.Knitkit.uploadThemeMenuItem = {
816
855
 
817
856
  if (form.isValid()) {
818
857
  form.submit({
858
+ timeout: 300000,
819
859
  waitMsg: 'Creating theme...',
820
860
  success: function (form, action) {
821
861
  var obj = Ext.decode(action.response.responseText);
862
+
822
863
  if (obj.success) {
823
- themesTreePanel.getStore().load({
824
- node: themesTreePanel.getRootNode()
825
- });
864
+ var store = themesTreePanel.getStore(),
865
+ rootNode = store.getRootNode();
866
+
867
+ rootNode.appendChild(obj.node);
826
868
  }
827
869
  window.close();
828
870
  },
@@ -831,6 +873,9 @@ Compass.ErpApp.Desktop.Applications.Knitkit.uploadThemeMenuItem = {
831
873
  }
832
874
  });
833
875
  }
876
+ else {
877
+ Ext.Msg.alert("Warning", "Please select a Theme file to upload");
878
+ }
834
879
  }
835
880
  }
836
881
  },
@@ -874,6 +919,7 @@ Compass.ErpApp.Desktop.Applications.Knitkit.newNavigationMenuItem = {
874
919
  modal: true,
875
920
  title: 'New Menu',
876
921
  buttonAlign: 'center',
922
+ defaultFocus: 'name',
877
923
  items: Ext.create("Ext.form.Panel", {
878
924
  labelWidth: 50,
879
925
  frame: false,
@@ -888,7 +934,8 @@ Compass.ErpApp.Desktop.Applications.Knitkit.newNavigationMenuItem = {
888
934
  fieldLabel: 'Menu name: ',
889
935
  width: 320,
890
936
  allowBlank: false,
891
- name: 'name'
937
+ name: 'name',
938
+ itemId: 'name'
892
939
  },
893
940
  {
894
941
  xtype: 'hidden',
@@ -973,6 +1020,7 @@ Compass.ErpApp.Desktop.Applications.Knitkit.newHostMenuItem = {
973
1020
  modal: true,
974
1021
  title: 'Add Host',
975
1022
  buttonAlign: 'center',
1023
+ defaultFocus: 'host',
976
1024
  items: Ext.create("Ext.form.Panel", {
977
1025
  labelWidth: 50,
978
1026
  frame: false,
@@ -986,6 +1034,7 @@ Compass.ErpApp.Desktop.Applications.Knitkit.newHostMenuItem = {
986
1034
  xtype: 'textfield',
987
1035
  fieldLabel: 'Host',
988
1036
  name: 'host',
1037
+ itemId: 'host',
989
1038
  allowBlank: false
990
1039
  },
991
1040
  {
@@ -1016,7 +1065,9 @@ Compass.ErpApp.Desktop.Applications.Knitkit.newHostMenuItem = {
1016
1065
  }
1017
1066
  },
1018
1067
  failure: function (form, action) {
1019
- Ext.Msg.alert("Error", "Error adding Host");
1068
+ var obj = Ext.decode(action.response.responseText);
1069
+ var message = obj.message.indexOf('Host') == 0 ? obj.message : "Error adding Host"
1070
+ Ext.Msg.alert("Error", message);
1020
1071
  }
1021
1072
  });
1022
1073
  }
@@ -1048,7 +1099,7 @@ Compass.ErpApp.Desktop.Applications.Knitkit.HostsMenu = function () {
1048
1099
  }
1049
1100
  };
1050
1101
 
1051
-
1102
+ // Templates
1052
1103
  Compass.ErpApp.Desktop.Applications.Knitkit.TemplateMenu = function () {
1053
1104
  return {
1054
1105
  text: 'Templates',
@@ -1062,18 +1113,19 @@ Compass.ErpApp.Desktop.Applications.Knitkit.TemplateMenu = function () {
1062
1113
  iconCls: 'icon-website-import',
1063
1114
  handler: function (btn) {
1064
1115
  var westRegion = Ext.ComponentQuery.query('#knitkitWestRegion').first(),
1065
- themesTreePanel = westRegion.down('#themesTreePanel'),
1066
- knitkitWin = compassDesktop.getModule('knitkit-win')
1116
+ themesTreePanel = westRegion.down('#themesTreePanel');
1067
1117
 
1068
1118
  Ext.create("Ext.window.Window", {
1069
1119
  modal: true,
1070
1120
  title: 'Import Template',
1071
1121
  buttonAlign: 'center',
1072
- items: Ext.create('widget.form', {
1122
+ items: {
1123
+ xtype: 'form',
1073
1124
  frame: false,
1125
+ timeout: 300,
1074
1126
  bodyStyle: 'padding:5px 5px 0',
1075
1127
  fileUpload: true,
1076
- url: '/knitkit/erp_app/desktop/site/importtemplate',
1128
+ url: '/knitkit/erp_app/desktop/site/import_template',
1077
1129
  items: [
1078
1130
 
1079
1131
  {
@@ -1086,7 +1138,7 @@ Compass.ErpApp.Desktop.Applications.Knitkit.TemplateMenu = function () {
1086
1138
  name: 'website_data'
1087
1139
  }
1088
1140
  ]
1089
- }),
1141
+ },
1090
1142
  buttons: [
1091
1143
  {
1092
1144
  text: 'Submit',
@@ -1154,11 +1206,11 @@ Compass.ErpApp.Desktop.Applications.Knitkit.TemplateMenu = function () {
1154
1206
  iconCls: 'icon-website-export',
1155
1207
  handler: function () {
1156
1208
  var knitkitWin = compassDesktop.getModule('knitkit-win'),
1157
- websiteId = knitkitWin.currentWebsite.id;
1209
+ websiteId = knitkitWin.currentWebsite.id;
1158
1210
  ifrm = document.createElement("IFRAME");
1159
1211
  ifrm.setAttribute("src", '/knitkit/erp_app/desktop/site/exporttemplate?website_id=' + websiteId);
1160
- ifrm.style.width = 0+"px";
1161
- ifrm.style.height = 0+"px";
1212
+ ifrm.style.width = 0 + "px";
1213
+ ifrm.style.height = 0 + "px";
1162
1214
  document.body.appendChild(ifrm);
1163
1215
  }
1164
1216
  }