knitkit 3.0.0 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{public → app/assets}/images/check.png +0 -0
- data/{public → app/assets}/images/credit_card.png +0 -0
- data/{public → app/assets}/images/inline_edit/close.png +0 -0
- data/{public → app/assets}/images/knitkit/icons/document.png +0 -0
- data/{public → app/assets}/images/knitkit/icons/multi_doc.png +0 -0
- data/{public → app/assets}/images/knitkit/logo.png +0 -0
- data/{public → app/assets}/images/knitkit/splash/images/add-site.png +0 -0
- data/app/assets/images/knitkit/splash/images/add_website_105x105-active.png +0 -0
- data/app/assets/images/knitkit/splash/images/add_website_105x105.png +0 -0
- data/{public → app/assets}/images/knitkit/splash/images/adjust-site.png +0 -0
- data/{public → app/assets}/images/knitkit/splash/images/browse-site.png +0 -0
- data/app/assets/images/knitkit/splash/images/browse_db_105x105-active.png +0 -0
- data/app/assets/images/knitkit/splash/images/browse_db_105x105.png +0 -0
- data/app/assets/images/knitkit/splash/images/console_105x105-active.png +0 -0
- data/app/assets/images/knitkit/splash/images/console_105x105.png +0 -0
- data/{public → app/assets}/images/knitkit/splash/images/find-themes.png +0 -0
- data/app/assets/images/knitkit/splash/images/find_themes_105x105-active.png +0 -0
- data/app/assets/images/knitkit/splash/images/find_themes_105x105.png +0 -0
- data/app/assets/images/knitkit/splash/images/learn_more_105x105-active.png +0 -0
- data/app/assets/images/knitkit/splash/images/learn_more_105x105.png +0 -0
- data/{public → app/assets}/images/knitkit/splash/images/settings.png +0 -0
- data/{public → app/assets}/images/knitkit/splash/images/tutorials.png +0 -0
- data/app/assets/images/knitkit/splash/splash.png +0 -0
- data/app/assets/images/widgets/manage_profile/contact_information.png +0 -0
- data/app/assets/images/widgets/manage_profile/password.png +0 -0
- data/app/assets/images/widgets/manage_profile/user_information.png +0 -0
- data/app/assets/javascripts/erp_app/desktop/applications/knitkit/app.js +24 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/articles_grid_panel.js +15 -12
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/center_region.js +69 -48
- data/app/assets/javascripts/erp_app/desktop/applications/knitkit/comments_grid_panel.js +214 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/east_region.js +0 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/file_assets_panel.js +17 -19
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/image_assets_data_view.js +13 -3
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/image_assets_panel.js +59 -48
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/widgets_panel.js +0 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/inquiries_grid_panel.js +2 -2
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/module.js +2 -2
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/publish_window.js +0 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/published_grid_panel.js +1 -1
- data/app/assets/javascripts/erp_app/desktop/applications/knitkit/splash_screen.js +268 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/top_menu/main_menu.js +85 -33
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/top_menu/websites_combo.js +0 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/versions_grid_panel.js +5 -28
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/article.js +22 -8
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/document.js +143 -25
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/host.js +5 -1
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/menu.js +2 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/section.js +181 -65
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/website_nav_items.js +0 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/hosts_tree_panel.js +0 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/menu_tree_panel.js +0 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/site_contents_tree_panel.js +121 -116
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/themes_tree_panel.js +101 -10
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/west_region.js +9 -5
- data/app/assets/javascripts/knitkit-web.js +22 -0
- data/app/assets/javascripts/knitkit/additional-methods.min.js +4 -0
- data/app/assets/javascripts/knitkit/bootstrap.min.js +7 -0
- data/app/assets/javascripts/knitkit/captcha.js +154 -0
- data/{public → app/assets}/javascripts/knitkit/confirm-bootstrap.js +1 -1
- data/{public → app/assets}/javascripts/knitkit/inline_editing.js +1 -1
- data/{public → app/assets}/javascripts/knitkit/jquery.maskedinput.min.js +0 -0
- data/app/assets/javascripts/knitkit/jquery.validate.min.js +4 -0
- data/app/assets/javascripts/knitkit/js.cookie.js +145 -0
- data/{public → app/assets}/javascripts/knitkit/theme.js +0 -0
- data/app/assets/stylesheets/erp_app/desktop/applications/knitkit/app.css +12 -0
- data/{public → app/assets}/stylesheets/erp_app/desktop/applications/knitkit/knitkit.css +23 -33
- data/app/assets/stylesheets/erp_app/shared/knitkit_shared.css +21 -0
- data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.svg +288 -0
- data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.woff2 +0 -0
- data/app/assets/stylesheets/knitkit-web.css +16 -0
- data/app/assets/stylesheets/knitkit/bootstrap.min.css +5 -0
- data/app/assets/stylesheets/knitkit/captcha.css +59 -0
- data/app/assets/stylesheets/knitkit/custom.css +144 -0
- data/{public → app/assets}/stylesheets/knitkit/inline_editing.css +0 -0
- data/app/assets/stylesheets/knitkit/submenu.css +93 -0
- data/app/controllers/api/v1/websites_controller.rb +14 -0
- data/app/controllers/captcha_controller.rb +53 -0
- data/app/controllers/knitkit/base_controller.rb +1 -5
- data/app/controllers/knitkit/erp_app/desktop/app_controller.rb +2 -9
- data/app/controllers/knitkit/erp_app/desktop/articles_controller.rb +20 -7
- data/app/controllers/knitkit/erp_app/desktop/file_assets_controller.rb +38 -28
- data/app/controllers/knitkit/erp_app/desktop/image_assets_controller.rb +16 -9
- data/app/controllers/knitkit/erp_app/desktop/online_document_sections_controller.rb +69 -15
- data/app/controllers/knitkit/erp_app/desktop/position_controller.rb +45 -58
- data/app/controllers/knitkit/erp_app/desktop/theme_controller.rb +64 -29
- data/app/controllers/knitkit/erp_app/desktop/website_controller.rb +36 -13
- data/app/controllers/knitkit/erp_app/desktop/website_host_controller.rb +12 -0
- data/app/controllers/knitkit/erp_app/desktop/website_nav_controller.rb +4 -11
- data/app/controllers/knitkit/erp_app/desktop/website_nav_item_controller.rb +2 -9
- data/app/controllers/knitkit/erp_app/desktop/website_section_controller.rb +56 -20
- data/app/controllers/knitkit/online_document_sections_controller.rb +9 -3
- data/app/mailers/website_inquiry_mailer.rb +11 -3
- data/app/models/content.rb +16 -6
- data/app/models/documented_item.rb +12 -1
- data/app/models/online_document_section.rb +54 -20
- data/app/models/published_website.rb +16 -0
- data/app/models/theme.rb +53 -47
- data/app/models/website.rb +172 -191
- data/app/models/website_section.rb +64 -30
- data/app/views/knitkit/blogs/show.html.erb +5 -2
- data/app/views/layouts/knitkit/base.html.erb +54 -51
- data/app/views/menus/knitkit/_default_menu.html.erb +11 -11
- data/app/views/menus/knitkit/_default_section_menu.html.erb +2 -2
- data/app/views/menus/knitkit/_default_sub_menu.erb +27 -0
- data/app/views/menus/knitkit/_default_sub_section_menu.html.erb +30 -0
- data/app/views/website_inquiry_mailer/inquiry.html.erb +266 -0
- data/app/widgets/contact_us/base.rb +26 -16
- data/app/widgets/contact_us/javascript/contact_us.js +1 -1
- data/app/widgets/contact_us/views/error.html.erb +7 -3
- data/app/widgets/contact_us/views/index.html.erb +36 -28
- data/app/widgets/google_map/javascript/google_map.js +1 -1
- data/app/widgets/google_map/views/index.html.erb +1 -1
- data/app/widgets/login/javascript/login.js +1 -1
- data/app/widgets/login/views/index.html.erb +1 -1
- data/app/widgets/manage_profile/base.rb +141 -112
- data/app/widgets/manage_profile/javascript/manage_profile.js +2 -2
- data/app/widgets/manage_profile/views/_password_form.html.erb +1 -1
- data/app/widgets/manage_profile/views/_user_information_form.html.erb +1 -30
- data/app/widgets/manage_profile/views/index.html.erb +42 -40
- data/app/widgets/reset_password/base.rb +39 -8
- data/app/widgets/reset_password/javascript/reset_password.js +1 -1
- data/app/widgets/reset_password/views/index.html.erb +3 -3
- data/app/widgets/reset_password/views/invalid_reset_token.html.erb +7 -0
- data/app/widgets/reset_password/views/layouts/base.html.erb +1 -1
- data/app/widgets/reset_password/views/reset_password.html.erb +39 -0
- data/app/widgets/reset_password/views/reset_success.html.erb +5 -0
- data/app/widgets/search/base.rb +5 -5
- data/app/widgets/search/javascript/search.js +6 -6
- data/app/widgets/search/views/_inline_search_form.html.erb +23 -12
- data/app/widgets/search/views/_search_form.html.erb +34 -30
- data/app/widgets/search/views/layouts/base.html.erb +6 -1
- data/app/widgets/signup/base.rb +73 -30
- data/app/widgets/signup/javascript/signup.js +1 -1
- data/app/widgets/signup/views/_signup_form.html.erb +2 -1
- data/app/widgets/signup/views/layouts/base.html.erb +1 -1
- data/app/widgets/signup/views/success.html.erb +2 -3
- data/config/routes.rb +25 -4
- data/db/data_migrations/20110509223702_add_publisher_role.rb +0 -2
- data/db/data_migrations/20110816153456_add_knitkit_application.rb +7 -15
- data/db/data_migrations/20120127150505_create_website_default_configuration.rb +63 -3
- data/db/data_migrations/20150118180450_add_website_member_roles.rb +12 -0
- data/db/data_migrations/20150414150359_nest_knitkit_security_roles.rb +35 -0
- data/db/data_migrations/20150414173437_move_website_roles_under_website_builder.rb +19 -0
- data/db/migrate/20110211002317_setup_knitkit.rb +86 -39
- data/lib/knitkit.rb +8 -2
- data/lib/knitkit/config.rb +2 -3
- data/lib/knitkit/engine.rb +35 -4
- data/lib/knitkit/extensions.rb +2 -1
- data/lib/knitkit/extensions/action_controller/theme_support/acts_as_themed_controller.rb +1 -1
- data/lib/knitkit/extensions/action_mailer/theme_support/acts_as_themed_mailer.rb +1 -1
- data/lib/knitkit/extensions/compass_ae/mailers/user_mailer.rb +31 -0
- data/lib/knitkit/extensions/compass_ae/widgets/base.rb +1 -1
- data/lib/knitkit/extensions/railties/action_controller/captcha_helper.rb +43 -0
- data/lib/knitkit/extensions/railties/action_view/helpers/content_helper.rb +1 -1
- data/lib/knitkit/extensions/railties/action_view/helpers/menu_helper.rb +11 -1
- data/lib/knitkit/extensions/railties/theme_support/asset_tag_helper.rb +83 -0
- data/lib/knitkit/routing_filter/section_router.rb +24 -14
- data/lib/knitkit/version.rb +1 -1
- data/lib/tasks/knitkit_tasks.rake +89 -4
- data/lib/tasks/theme_parser.rake +85 -0
- data/public/fonts/glyphicons-halflings-regular.eot +0 -0
- data/public/fonts/glyphicons-halflings-regular.svg +288 -0
- data/public/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/public/fonts/glyphicons-halflings-regular.woff +0 -0
- data/public/fonts/glyphicons-halflings-regular.woff2 +0 -0
- data/public/paypal-button.min.js +7 -0
- metadata +161 -82
- data/app/assets/javascripts/knitkit/application.js +0 -9
- data/app/assets/stylesheets/knitkit/application.css +0 -7
- data/app/mailers/document_mailer.rb +0 -10
- data/app/views/document_mailer/email_document.html.erb +0 -12
- data/app/views/knitkit/mobile/index.html.erb +0 -162
- data/app/views/knitkit/online_document_sections/index.html.erb +0 -279
- data/app/views/layouts/knitkit/online_document_sections.html.erb +0 -80
- data/app/views/website_inquiry_mailer/inquiry.erb +0 -24
- data/db/data_migrations/20120127150506_add_primary_host_to_website_configuration.rb +0 -33
- data/db/data_migrations/20120316150424_add_is_template_to_default_website_config.rb +0 -16
- data/db/data_migrations/20120809020508_update_website_and_configuration.rb +0 -82
- data/db/data_migrations/20121129185611_upgrade_website_role_iid.rb +0 -20
- data/db/migrate/20130405184234_add_use_markdown_to_section.rb +0 -19
- data/db/migrate/20131112013052_add_knitkit_missing_indexes.rb +0 -33
- data/db/migrate/20140622212723_update_website_inquiries.rb +0 -22
- data/db/migrate/20140911185022_add_publishing_to_website.rb +0 -5
- data/db/migrate/20141013073349_add_custom_fields_to_documents.rb +0 -12
- data/db/migrate/20141016101936_upgrade_remove_dynamic_attributes.rb +0 -13
- data/lib/knitkit/extensions/railties/theme_support/theme_file_resolver.rb +0 -49
- data/public/images/knitkit/close_window.png +0 -0
- data/public/images/knitkit/splash/splash.png +0 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/comments_grid_panel.js +0 -215
- data/public/javascripts/erp_app/desktop/applications/knitkit/select_roles_window.js +0 -108
- data/public/javascripts/erp_app/desktop/applications/knitkit/splash_screen.js +0 -170
- data/public/javascripts/knitkit/bootstrap-datepicker.js +0 -474
- data/public/javascripts/knitkit/bootstrap.min.js +0 -7
- data/public/javascripts/knitkit/mobile/app/view/Main.js +0 -108
- data/public/javascripts/knitkit/mobile/ux/slidenavigation/View.js +0 -734
- data/public/stylesheets/knitkit/bootstrap-responsive.min.css +0 -10
- data/public/stylesheets/knitkit/bootstrap.min.css +0 -7
- data/public/stylesheets/knitkit/custom.css +0 -122
- data/public/stylesheets/knitkit/datepicker.css +0 -182
File without changes
|
data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/versions_grid_panel.js
RENAMED
@@ -57,7 +57,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.VersionsGridPanel", {
|
|
57
57
|
flex: 0.5,
|
58
58
|
items: [
|
59
59
|
{
|
60
|
-
icon: '/
|
60
|
+
icon: '/assets/icons/eye/eye_16x16.png',
|
61
61
|
tooltip: 'View',
|
62
62
|
getClass: function (v, meta, rec) {
|
63
63
|
return 'x-action-col-icon';
|
@@ -68,7 +68,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.VersionsGridPanel", {
|
|
68
68
|
}
|
69
69
|
},
|
70
70
|
{
|
71
|
-
icon: '/
|
71
|
+
icon: '/assets/icons/document_down/document_down_16x16.png',
|
72
72
|
tooltip: 'Revert',
|
73
73
|
getClass: function (v, meta, rec) {
|
74
74
|
return 'x-action-col-icon';
|
@@ -374,30 +374,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.VersionsBlogGridPanel",
|
|
374
374
|
name: 'publisher'
|
375
375
|
}
|
376
376
|
]
|
377
|
-
})
|
378
|
-
columns: [
|
379
|
-
{
|
380
|
-
menuDisabled: true,
|
381
|
-
resizable: false,
|
382
|
-
xtype: 'actioncolumn',
|
383
|
-
header: 'Action',
|
384
|
-
align: 'center',
|
385
|
-
width: 50,
|
386
|
-
items: [
|
387
|
-
{
|
388
|
-
icon: '/images/icons/document_view/document_view_16x16.png',
|
389
|
-
tooltip: 'View',
|
390
|
-
getClass: function (v, meta, rec) {
|
391
|
-
return 'x-action-col-icon';
|
392
|
-
},
|
393
|
-
handler: function (grid, rowIndex, colIndex) {
|
394
|
-
var rec = grid.getStore().getAt(rowIndex);
|
395
|
-
grid.initialConfig['centerRegion'].viewContent(rec.get('title') + " Excerpt - Revision " + rec.get('version'), rec.get('body_html'));
|
396
|
-
}
|
397
|
-
}
|
398
|
-
]
|
399
|
-
}
|
400
|
-
]
|
377
|
+
})
|
401
378
|
}, config);
|
402
379
|
|
403
380
|
this.callParent([config]);
|
@@ -648,7 +625,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.NonPublishedVersionsGrid
|
|
648
625
|
flex: 0.5,
|
649
626
|
items: [
|
650
627
|
{
|
651
|
-
icon: '/
|
628
|
+
icon: '/assets/icons/eye/eye_16x16.png',
|
652
629
|
tooltip: 'View',
|
653
630
|
getClass: function (v, meta, rec) {
|
654
631
|
return 'x-action-col-icon';
|
@@ -659,7 +636,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.NonPublishedVersionsGrid
|
|
659
636
|
}
|
660
637
|
},
|
661
638
|
{
|
662
|
-
icon: '/
|
639
|
+
icon: '/assets/icons/document_down/document_down_16x16.png',
|
663
640
|
tooltip: 'Revert',
|
664
641
|
getClass: function (v, meta, rec) {
|
665
642
|
return 'x-action-col-icon';
|
@@ -4,7 +4,7 @@ Compass.ErpApp.Desktop.Applications.Knitkit.addArticleOptions = function (self,
|
|
4
4
|
iconCls: 'icon-edit',
|
5
5
|
listeners: {
|
6
6
|
'click': function () {
|
7
|
-
var itemId = 'editArticle-' + record.get('
|
7
|
+
var itemId = 'editArticle-' + record.get('recordId'),
|
8
8
|
editArticleWindow = Ext.ComponentQuery.query('#' + itemId).first();
|
9
9
|
|
10
10
|
if (Compass.ErpApp.Utility.isBlank(editArticleWindow)) {
|
@@ -88,7 +88,7 @@ Compass.ErpApp.Desktop.Applications.Knitkit.addArticleOptions = function (self,
|
|
88
88
|
allowBlank: false,
|
89
89
|
name: 'id',
|
90
90
|
itemId: 'record_id',
|
91
|
-
value: record.
|
91
|
+
value: record.get('recordId')
|
92
92
|
},
|
93
93
|
{
|
94
94
|
xtype: 'hidden',
|
@@ -114,8 +114,10 @@ Compass.ErpApp.Desktop.Applications.Knitkit.addArticleOptions = function (self,
|
|
114
114
|
record.set('text', values.title);
|
115
115
|
record.set('display_title', !Ext.isEmpty(values.display_title));
|
116
116
|
record.set('content_area', values.content_area);
|
117
|
-
|
118
|
-
|
117
|
+
record.set('internal_identifier', values.internal_identifier);
|
118
|
+
|
119
|
+
if (formPanel.getForm().findField('tags')) {
|
120
|
+
var tag_list = formPanel.getForm().findField('tags').getValue();
|
119
121
|
record.set('tag_list', tag_list);
|
120
122
|
}
|
121
123
|
window.close();
|
@@ -154,23 +156,35 @@ Compass.ErpApp.Desktop.Applications.Knitkit.addArticleOptions = function (self,
|
|
154
156
|
var centerRegion = Ext.getCmp('knitkitCenterRegion'),
|
155
157
|
websiteId = compassDesktop.getModule('knitkit-win').currentWebsite.id;
|
156
158
|
|
157
|
-
var url = '/knitkit/erp_app/desktop/articles/show/' + record.
|
159
|
+
var url = '/knitkit/erp_app/desktop/articles/show/' + record.get('recordId');
|
158
160
|
|
159
161
|
Ext.Ajax.request({
|
160
162
|
url: url,
|
161
163
|
method: 'GET',
|
162
164
|
extraParams: {
|
163
|
-
id: record.
|
165
|
+
id: record.get('recordId')
|
164
166
|
},
|
165
167
|
timeout: 90000,
|
166
168
|
success: function (response) {
|
167
169
|
var article = Ext.decode(response.responseText);
|
168
|
-
centerRegion.editExcerpt(article.title + ' - Excerpt', record.
|
170
|
+
centerRegion.editExcerpt(article.title + ' - Excerpt', record.get('recordId'), article.excerpt_html, websiteId);
|
169
171
|
}
|
170
172
|
});
|
171
173
|
}
|
172
174
|
}
|
173
175
|
});
|
176
|
+
|
177
|
+
items.push({
|
178
|
+
text: 'View Comments',
|
179
|
+
iconCls: 'icon-eye',
|
180
|
+
listeners: {
|
181
|
+
'click': function () {
|
182
|
+
var centerRegion = Ext.getCmp('knitkitCenterRegion');
|
183
|
+
|
184
|
+
centerRegion.viewContentComments(record.get('recordId'), record.get('title') + ' - Comments');
|
185
|
+
}
|
186
|
+
}
|
187
|
+
});
|
174
188
|
}
|
175
189
|
|
176
190
|
items.push({
|
@@ -190,7 +204,7 @@ Compass.ErpApp.Desktop.Applications.Knitkit.addArticleOptions = function (self,
|
|
190
204
|
method: 'POST',
|
191
205
|
params: {
|
192
206
|
id: record.data.parentItemId,
|
193
|
-
article_id: record.
|
207
|
+
article_id: record.get('recordId')
|
194
208
|
},
|
195
209
|
success: function (response) {
|
196
210
|
var obj = Ext.decode(response.responseText);
|
@@ -1,6 +1,8 @@
|
|
1
1
|
Compass.ErpApp.Desktop.Applications.Knitkit.addDocumentOptions = function (self, items, record) {
|
2
|
-
var sectionId = record.
|
2
|
+
var sectionId = record.get('recordId');
|
3
|
+
var websiteId = compassDesktop.getModule('knitkit-win').currentWebsite.id;
|
3
4
|
|
5
|
+
// Update security
|
4
6
|
if (currentUser.hasCapability('unsecure', 'WebsiteSection') || currentUser.hasCapability('secure', 'WebsiteSection')) {
|
5
7
|
items.push({
|
6
8
|
text: 'Security',
|
@@ -8,12 +10,13 @@ Compass.ErpApp.Desktop.Applications.Knitkit.addDocumentOptions = function (self,
|
|
8
10
|
listeners: {
|
9
11
|
'click': function () {
|
10
12
|
var westRegion = Ext.getCmp('knitkitWestRegion');
|
11
|
-
westRegion.changeSecurity(record, '/knitkit/erp_app/desktop/section/update_security', record.
|
13
|
+
westRegion.changeSecurity(record, '/knitkit/erp_app/desktop/section/update_security', record.get('recordId'));
|
12
14
|
}
|
13
15
|
}
|
14
16
|
});
|
15
17
|
}
|
16
18
|
|
19
|
+
// Create Document Section
|
17
20
|
if (currentUser.hasCapability('create', 'WebsiteSection')) {
|
18
21
|
items.push({
|
19
22
|
text: 'Add Document',
|
@@ -26,11 +29,12 @@ Compass.ErpApp.Desktop.Applications.Knitkit.addDocumentOptions = function (self,
|
|
26
29
|
title: 'New Document Section',
|
27
30
|
plain: true,
|
28
31
|
buttonAlign: 'center',
|
29
|
-
items:
|
32
|
+
items: {
|
33
|
+
xtype: 'form',
|
30
34
|
labelWidth: 110,
|
31
35
|
frame: false,
|
32
36
|
bodyStyle: 'padding:5px 5px 0',
|
33
|
-
url: '/knitkit/erp_app/desktop/online_document_sections
|
37
|
+
url: '/knitkit/erp_app/desktop/online_document_sections',
|
34
38
|
defaults: {
|
35
39
|
width: 225
|
36
40
|
},
|
@@ -59,18 +63,6 @@ Compass.ErpApp.Desktop.Applications.Knitkit.addDocumentOptions = function (self,
|
|
59
63
|
allowBlank: false,
|
60
64
|
triggerAction: 'all'
|
61
65
|
},
|
62
|
-
{
|
63
|
-
xtype: 'combo',
|
64
|
-
forceSelection: true,
|
65
|
-
store: [
|
66
|
-
['Content', 'Content']
|
67
|
-
],
|
68
|
-
value: 'Content',
|
69
|
-
fieldLabel: 'Document Type',
|
70
|
-
name: 'documenttype',
|
71
|
-
allowBlank: false,
|
72
|
-
triggerAction: 'all'
|
73
|
-
},
|
74
66
|
{
|
75
67
|
xtype: 'radiogroup',
|
76
68
|
fieldLabel: 'Display in menu?',
|
@@ -94,7 +86,7 @@ Compass.ErpApp.Desktop.Applications.Knitkit.addDocumentOptions = function (self,
|
|
94
86
|
{
|
95
87
|
xtype: 'hidden',
|
96
88
|
name: 'website_section_id',
|
97
|
-
value: record.
|
89
|
+
value: record.get('recordId')
|
98
90
|
},
|
99
91
|
{
|
100
92
|
xtype: 'hidden',
|
@@ -102,15 +94,16 @@ Compass.ErpApp.Desktop.Applications.Knitkit.addDocumentOptions = function (self,
|
|
102
94
|
value: record.data.siteId
|
103
95
|
}
|
104
96
|
]
|
105
|
-
}
|
97
|
+
},
|
106
98
|
buttons: [
|
107
99
|
{
|
108
100
|
text: 'Submit',
|
109
101
|
listeners: {
|
110
102
|
'click': function (button) {
|
111
103
|
var window = button.findParentByType('window');
|
112
|
-
var formPanel = window.
|
104
|
+
var formPanel = window.down('form');
|
113
105
|
formPanel.getForm().submit({
|
106
|
+
method: 'post',
|
114
107
|
reset: true,
|
115
108
|
waitMsg: 'Creating document section...',
|
116
109
|
success: function (form, action) {
|
@@ -118,7 +111,7 @@ Compass.ErpApp.Desktop.Applications.Knitkit.addDocumentOptions = function (self,
|
|
118
111
|
if (obj.success) {
|
119
112
|
record.appendChild(obj.node);
|
120
113
|
|
121
|
-
var centerRegion = Ext.
|
114
|
+
var centerRegion = Ext.getCmp('knitkitCenterRegion');
|
122
115
|
centerRegion.editContent(obj.documented_content.title, obj.documented_content.id, obj.documented_content.body_html, record.data.siteId, 'article');
|
123
116
|
window.close();
|
124
117
|
}
|
@@ -153,6 +146,7 @@ Compass.ErpApp.Desktop.Applications.Knitkit.addDocumentOptions = function (self,
|
|
153
146
|
});
|
154
147
|
}
|
155
148
|
|
149
|
+
// Edit Document Section
|
156
150
|
if (currentUser.hasCapability('edit', 'WebsiteSection')) {
|
157
151
|
var contentInfo = record.data['contentInfo'];
|
158
152
|
|
@@ -234,7 +228,7 @@ Compass.ErpApp.Desktop.Applications.Knitkit.addDocumentOptions = function (self,
|
|
234
228
|
{
|
235
229
|
xtype: 'hidden',
|
236
230
|
name: 'id',
|
237
|
-
value: record.
|
231
|
+
value: record.get('recordId')
|
238
232
|
}
|
239
233
|
]
|
240
234
|
}),
|
@@ -279,13 +273,140 @@ Compass.ErpApp.Desktop.Applications.Knitkit.addDocumentOptions = function (self,
|
|
279
273
|
});
|
280
274
|
}
|
281
275
|
|
276
|
+
// Copy Document Section
|
277
|
+
items.push({
|
278
|
+
text: 'Copy Document',
|
279
|
+
iconCls: 'icon-copy',
|
280
|
+
listeners: {
|
281
|
+
'click': function () {
|
282
|
+
Ext.widget("window", {
|
283
|
+
layout: 'fit',
|
284
|
+
modal: true,
|
285
|
+
title: 'Copy Document',
|
286
|
+
plain: true,
|
287
|
+
buttonAlign: 'center',
|
288
|
+
items: {
|
289
|
+
xtype: 'form',
|
290
|
+
labelWidth: 110,
|
291
|
+
frame: false,
|
292
|
+
bodyStyle: 'padding:5px 5px 0',
|
293
|
+
url: '/knitkit/erp_app/desktop/online_document_sections/copy',
|
294
|
+
defaults: {
|
295
|
+
width: 375
|
296
|
+
},
|
297
|
+
items: [
|
298
|
+
{
|
299
|
+
xtype: 'combo',
|
300
|
+
name: 'parent_section_id',
|
301
|
+
width: 320,
|
302
|
+
loadingText: 'Retrieving Sections...',
|
303
|
+
store: Ext.create("Ext.data.Store", {
|
304
|
+
proxy: {
|
305
|
+
type: 'ajax',
|
306
|
+
url: '/knitkit/erp_app/desktop/online_document_sections/existing_documents',
|
307
|
+
reader: {
|
308
|
+
type: 'json'
|
309
|
+
},
|
310
|
+
extraParams: {
|
311
|
+
website_id: websiteId
|
312
|
+
}
|
313
|
+
},
|
314
|
+
autoLoad: true,
|
315
|
+
fields: [
|
316
|
+
{
|
317
|
+
name: 'id'
|
318
|
+
},
|
319
|
+
{
|
320
|
+
name: 'title_permalink'
|
321
|
+
|
322
|
+
}
|
323
|
+
]
|
324
|
+
}),
|
325
|
+
forceSelection: true,
|
326
|
+
allowBlank: true,
|
327
|
+
fieldLabel: 'Parent Document',
|
328
|
+
mode: 'local',
|
329
|
+
displayField: 'title_permalink',
|
330
|
+
valueField: 'id',
|
331
|
+
triggerAction: 'all'
|
332
|
+
},
|
333
|
+
{
|
334
|
+
xtype: 'textfield',
|
335
|
+
fieldLabel: 'Title',
|
336
|
+
width: 320,
|
337
|
+
value: record.data.text,
|
338
|
+
name: 'title'
|
339
|
+
},
|
340
|
+
{
|
341
|
+
xtype: 'hidden',
|
342
|
+
name: 'id',
|
343
|
+
value: sectionId
|
344
|
+
},
|
345
|
+
{
|
346
|
+
xtype: 'hidden',
|
347
|
+
name: 'website_id',
|
348
|
+
value: websiteId
|
349
|
+
}
|
350
|
+
]
|
351
|
+
},
|
352
|
+
buttons: [
|
353
|
+
{
|
354
|
+
text: 'Submit',
|
355
|
+
listeners: {
|
356
|
+
'click': function (button) {
|
357
|
+
var window = button.findParentByType('window');
|
358
|
+
var formPanel = window.query('.form')[0];
|
359
|
+
|
360
|
+
formPanel.getForm().submit({
|
361
|
+
waitMsg: 'Copying document section...',
|
362
|
+
success: function (form, action) {
|
363
|
+
var obj = Ext.decode(action.response.responseText);
|
364
|
+
var values = formPanel.getValues();
|
365
|
+
var parentNode = record.getOwnerTree().getRootNode();
|
366
|
+
|
367
|
+
if (!Ext.isEmpty(values.parent_section_id)) {
|
368
|
+
parentNode = parentNode.findChildBy(function (node) {
|
369
|
+
if (node.get('recordType') == 'WebsiteSection'
|
370
|
+
&& node.get('recordId') == values.parent_section_id) {
|
371
|
+
return true;
|
372
|
+
}
|
373
|
+
}, this, true);
|
374
|
+
}
|
375
|
+
|
376
|
+
if (parentNode && parentNode != record.getOwnerTree().getRootNode()){
|
377
|
+
record.getOwnerTree().getStore().load({node: parentNode});
|
378
|
+
}
|
379
|
+
|
380
|
+
window.close();
|
381
|
+
},
|
382
|
+
failure: function (form, action) {
|
383
|
+
var obj = Ext.decode(action.response.responseText);
|
384
|
+
Ext.Msg.alert("Error", obj.message);
|
385
|
+
}
|
386
|
+
});
|
387
|
+
}
|
388
|
+
}
|
389
|
+
},
|
390
|
+
{
|
391
|
+
text: 'Close',
|
392
|
+
handler: function (btn) {
|
393
|
+
btn.up('window').close();
|
394
|
+
}
|
395
|
+
}
|
396
|
+
]
|
397
|
+
}).show();
|
398
|
+
}
|
399
|
+
}
|
400
|
+
});
|
401
|
+
|
402
|
+
// Delete Document Section
|
282
403
|
if (currentUser.hasCapability('delete', 'WebsiteSection')) {
|
283
404
|
items.push({
|
284
405
|
text: 'Delete Document Section',
|
285
406
|
iconCls: 'icon-delete',
|
286
407
|
listeners: {
|
287
408
|
'click': function () {
|
288
|
-
Ext.MessageBox.confirm('Confirm', 'Are you sure you want to delete
|
409
|
+
Ext.MessageBox.confirm('Confirm', 'Are you sure you want to delete the document section?<h3>'+record.data["text"]+'</h3>', function (btn) {
|
289
410
|
if (btn == 'no') {
|
290
411
|
return false;
|
291
412
|
}
|
@@ -297,7 +418,6 @@ Compass.ErpApp.Desktop.Applications.Knitkit.addDocumentOptions = function (self,
|
|
297
418
|
id: sectionId
|
298
419
|
},
|
299
420
|
success: function (response) {
|
300
|
-
|
301
421
|
var obj = Ext.decode(response.responseText);
|
302
422
|
if (obj.success) {
|
303
423
|
record.remove();
|
@@ -312,8 +432,6 @@ Compass.ErpApp.Desktop.Applications.Knitkit.addDocumentOptions = function (self,
|
|
312
432
|
});
|
313
433
|
}
|
314
434
|
});
|
315
|
-
|
316
|
-
record.remove();
|
317
435
|
}
|
318
436
|
}
|
319
437
|
});
|
@@ -9,6 +9,7 @@ Compass.ErpApp.Desktop.Applications.Knitkit.addHostOptions = function (self, ite
|
|
9
9
|
title: 'Update Host',
|
10
10
|
modal: true,
|
11
11
|
buttonAlign: 'center',
|
12
|
+
defaultFocus: 'host',
|
12
13
|
items: Ext.create("Ext.form.Panel", {
|
13
14
|
labelWidth: 50,
|
14
15
|
frame: false,
|
@@ -23,6 +24,7 @@ Compass.ErpApp.Desktop.Applications.Knitkit.addHostOptions = function (self, ite
|
|
23
24
|
fieldLabel: 'Host',
|
24
25
|
id: 'knitkitUpdateWebsiteHostHost',
|
25
26
|
name: 'host',
|
27
|
+
itemId: 'host',
|
26
28
|
value: record.data.host,
|
27
29
|
allowBlank: false
|
28
30
|
}
|
@@ -52,7 +54,9 @@ Compass.ErpApp.Desktop.Applications.Knitkit.addHostOptions = function (self, ite
|
|
52
54
|
}
|
53
55
|
},
|
54
56
|
failure: function (form, action) {
|
55
|
-
Ext.
|
57
|
+
var obj = Ext.decode(action.response.responseText);
|
58
|
+
var message = obj.message.indexOf('Host') == 0 ? obj.message : "Error Updating Host"
|
59
|
+
Ext.Msg.alert("Error", message);
|
56
60
|
}
|
57
61
|
});
|
58
62
|
}
|
@@ -12,6 +12,7 @@ Compass.ErpApp.Desktop.Applications.Knitkit.addMenuOptions = function (self, ite
|
|
12
12
|
title: 'New Menu Item',
|
13
13
|
modal: true,
|
14
14
|
buttonAlign: 'center',
|
15
|
+
defaultFocus: 'title',
|
15
16
|
items: Ext.create('Ext.form.Panel', {
|
16
17
|
labelWidth: 50,
|
17
18
|
frame: false,
|
@@ -25,6 +26,7 @@ Compass.ErpApp.Desktop.Applications.Knitkit.addMenuOptions = function (self, ite
|
|
25
26
|
xtype: 'textfield',
|
26
27
|
fieldLabel: 'Title',
|
27
28
|
width: 320,
|
29
|
+
itemId: 'title',
|
28
30
|
allowBlank: false,
|
29
31
|
name: 'title'
|
30
32
|
},
|