knitkit 2.1.15 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/app/controllers/knitkit/base_controller.rb +1 -1
- data/app/controllers/knitkit/comments_controller.rb +7 -2
- data/app/controllers/knitkit/erp_app/desktop/app_controller.rb +78 -98
- data/app/controllers/knitkit/erp_app/desktop/articles_controller.rb +65 -45
- data/app/controllers/knitkit/erp_app/desktop/content_controller.rb +22 -12
- data/app/controllers/knitkit/erp_app/desktop/file_assets_controller.rb +1 -1
- data/app/controllers/knitkit/erp_app/desktop/image_assets_controller.rb +28 -16
- data/app/controllers/knitkit/erp_app/desktop/inquiries_controller.rb +15 -49
- data/app/controllers/knitkit/erp_app/desktop/online_document_sections_controller.rb +4 -3
- data/app/controllers/knitkit/erp_app/desktop/position_controller.rb +69 -11
- data/app/controllers/knitkit/erp_app/desktop/theme_controller.rb +63 -60
- data/app/controllers/knitkit/erp_app/desktop/website_controller.rb +98 -82
- data/app/controllers/knitkit/erp_app/desktop/website_host_controller.rb +77 -0
- data/app/controllers/knitkit/erp_app/desktop/website_nav_controller.rb +64 -44
- data/app/controllers/knitkit/erp_app/desktop/website_nav_item_controller.rb +147 -0
- data/app/controllers/knitkit/erp_app/desktop/website_section_controller.rb +81 -45
- data/app/controllers/knitkit/mobile_controller.rb +15 -0
- data/app/controllers/knitkit/online_document_sections_controller.rb +2 -1
- data/app/controllers/knitkit/unauthorized_controller.rb +0 -1
- data/app/controllers/knitkit/website_sections_controller.rb +7 -4
- data/app/mailers/website_inquiry_mailer.rb +8 -7
- data/app/models/content.rb +11 -2
- data/app/models/document.rb +2 -17
- data/app/models/published_website.rb +96 -59
- data/app/models/theme.rb +100 -14
- data/app/models/website.rb +260 -28
- data/app/models/website_inquiry.rb +5 -12
- data/app/models/website_section.rb +9 -1
- data/app/views/knitkit/blogs/_add_comment.html.erb +44 -23
- data/app/views/knitkit/blogs/_comment.html.erb +4 -6
- data/app/views/knitkit/blogs/index.html.erb +63 -49
- data/app/views/knitkit/blogs/show.html.erb +17 -12
- data/app/views/knitkit/mobile/index.html.erb +162 -0
- data/app/views/knitkit/online_document_sections/index.html.erb +7 -5
- data/app/views/knitkit/unauthorized/index.html.erb +8 -4
- data/app/views/knitkit/website_sections/index.html.erb +8 -4
- data/app/views/layouts/knitkit/base.html.erb +79 -63
- data/app/views/layouts/knitkit/online_document_sections.html.erb +74 -52
- data/app/views/menus/knitkit/_default_menu.html.erb +4 -4
- data/app/views/menus/knitkit/_default_section_menu.html.erb +22 -23
- data/app/views/shared/knitkit/_bread_crumb.html.erb +10 -7
- data/app/views/shared/knitkit/_footer.html.erb +2 -2
- data/app/views/website_inquiry_mailer/inquiry.erb +23 -2
- data/app/widgets/contact_us/base.rb +25 -50
- data/app/widgets/contact_us/javascript/contact_us.js +7 -7
- data/app/widgets/contact_us/views/error.html.erb +6 -8
- data/app/widgets/contact_us/views/index.html.erb +28 -1
- data/app/widgets/contact_us/views/layouts/base.html.erb +9 -6
- data/app/widgets/contact_us/views/success.html.erb +3 -3
- data/app/widgets/google_map/views/index.html.erb +36 -36
- data/app/widgets/login/base.rb +1 -0
- data/app/widgets/login/javascript/login.js +3 -3
- data/app/widgets/login/views/index.html.erb +46 -26
- data/app/widgets/login/views/layouts/base.html.erb +15 -13
- data/app/widgets/login/views/login_header.html.erb +7 -9
- data/app/widgets/manage_profile/base.rb +116 -164
- data/app/widgets/manage_profile/views/_address.html.erb +184 -0
- data/app/widgets/manage_profile/views/_contact_information_form.html.erb +23 -192
- data/app/widgets/manage_profile/views/_email_address.html.erb +163 -0
- data/app/widgets/manage_profile/views/_password_form.html.erb +23 -20
- data/app/widgets/manage_profile/views/_phone_number.html.erb +165 -0
- data/app/widgets/manage_profile/views/_user_information_form.html.erb +49 -33
- data/app/widgets/manage_profile/views/error.html.erb +6 -0
- data/app/widgets/manage_profile/views/index.html.erb +44 -46
- data/app/widgets/manage_profile/views/layouts/base.html.erb +3 -1
- data/app/widgets/manage_profile/views/success.html.erb +5 -0
- data/app/widgets/reset_password/views/index.html.erb +33 -28
- data/app/widgets/reset_password/views/layouts/base.html.erb +10 -1
- data/app/widgets/search/base.rb +37 -25
- data/app/widgets/search/views/_inline_search_form.html.erb +12 -0
- data/app/widgets/search/views/_search_form.html.erb +41 -0
- data/app/widgets/search/views/index.html.erb +5 -3
- data/app/widgets/search/views/layouts/base.html.erb +13 -23
- data/app/widgets/search/views/show.html.erb +32 -47
- data/app/widgets/signup/base.rb +1 -1
- data/app/widgets/signup/javascript/signup.js +7 -9
- data/app/widgets/signup/views/_signup_form.html.erb +34 -29
- data/app/widgets/signup/views/error.html.erb +11 -11
- data/app/widgets/signup/views/index.html.erb +3 -2
- data/app/widgets/signup/views/layouts/base.html.erb +8 -5
- data/app/widgets/signup/views/success.html.erb +5 -4
- data/config/routes.rb +39 -28
- data/db/data_migrations/20120809020508_update_website_and_configuration.rb +3 -0
- data/db/migrate/20110211002317_setup_knitkit.rb +0 -1
- data/db/migrate/20131112013052_add_knitkit_missing_indexes.rb +33 -0
- data/db/migrate/20140622212723_update_website_inquiries.rb +22 -0
- data/db/migrate/20140911185022_add_publishing_to_website.rb +5 -0
- data/db/migrate/20141013073349_add_custom_fields_to_documents.rb +12 -0
- data/db/migrate/20141016101936_upgrade_remove_dynamic_attributes.rb +13 -0
- data/lib/knitkit.rb +0 -1
- data/lib/knitkit/engine.rb +1 -0
- data/lib/knitkit/extensions.rb +4 -0
- data/lib/knitkit/extensions/active_record/acts_as_commentable.rb +33 -0
- data/lib/knitkit/extensions/active_record/acts_as_document.rb +0 -12
- data/lib/knitkit/extensions/active_record/acts_as_publishable.rb +7 -10
- data/lib/knitkit/extensions/compass_ae/widgets/base.rb +2 -4
- data/lib/knitkit/extensions/compass_ae/widgets/widget_proxy_controller.rb +4 -1
- data/lib/knitkit/extensions/railties/action_view/helpers/blog_helper.rb +16 -13
- data/lib/knitkit/extensions/railties/action_view/helpers/content_helper.rb +10 -8
- data/lib/knitkit/extensions/railties/theme_support/asset_tag_helper.rb +123 -108
- data/lib/knitkit/extensions/will_paginate/link_renderer.rb +67 -0
- data/lib/knitkit/routing_filter/section_router.rb +10 -8
- data/lib/knitkit/syntax_validator.rb +2 -2
- data/lib/knitkit/version.rb +7 -3
- data/public/images/inline_edit/close.png +0 -0
- data/public/images/knitkit/close_window.png +0 -0
- data/public/images/knitkit/logo.png +0 -0
- data/public/images/knitkit/splash/images/add-site.png +0 -0
- data/public/images/knitkit/splash/images/adjust-site.png +0 -0
- data/public/images/knitkit/splash/images/browse-site.png +0 -0
- data/public/images/knitkit/splash/images/find-themes.png +0 -0
- data/public/images/knitkit/splash/images/settings.png +0 -0
- data/public/images/knitkit/splash/images/tutorials.png +0 -0
- data/public/images/knitkit/splash/splash.png +0 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/articles_grid_panel.js +656 -627
- data/public/javascripts/erp_app/desktop/applications/knitkit/center_region.js +444 -333
- data/public/javascripts/erp_app/desktop/applications/knitkit/{east_region.js → east_region/east_region.js} +33 -33
- data/public/javascripts/erp_app/desktop/applications/knitkit/east_region/file_assets_panel.js +332 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/east_region/image_assets_data_view.js +144 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/east_region/image_assets_panel.js +335 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/{widgets_panel.js → east_region/widgets_panel.js} +55 -55
- data/public/javascripts/erp_app/desktop/applications/knitkit/inquiries_grid_panel.js +150 -37
- data/public/javascripts/erp_app/desktop/applications/knitkit/module.js +228 -96
- data/public/javascripts/erp_app/desktop/applications/knitkit/publish_window.js +89 -85
- data/public/javascripts/erp_app/desktop/applications/knitkit/published_grid_panel.js +238 -217
- data/public/javascripts/erp_app/desktop/applications/knitkit/select_roles_window.js +59 -54
- data/public/javascripts/erp_app/desktop/applications/knitkit/splash_screen.js +170 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/top_menu/main_menu.js +1168 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/top_menu/websites_combo.js +71 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/versions_grid_panel.js +301 -306
- data/public/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/article.js +216 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/document.js +182 -153
- data/public/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/host.js +48 -65
- data/public/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/menu.js +93 -94
- data/public/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/section.js +523 -197
- data/public/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/website_nav_items.js +20 -34
- data/public/javascripts/erp_app/desktop/applications/knitkit/west_region/hosts_tree_panel.js +74 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/west_region/menu_tree_panel.js +245 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/west_region/site_contents_tree_panel.js +360 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/west_region/themes_tree_panel.js +348 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/west_region/west_region.js +106 -1132
- data/public/javascripts/knitkit/bootstrap-datepicker.js +474 -0
- data/public/javascripts/knitkit/bootstrap.min.js +7 -0
- data/public/javascripts/knitkit/confirm-bootstrap.js +110 -0
- data/public/javascripts/knitkit/inline_editing.js +73 -50
- data/public/javascripts/knitkit/jquery.maskedinput.min.js +7 -0
- data/public/javascripts/knitkit/mobile/app/view/Main.js +108 -0
- data/public/javascripts/knitkit/mobile/ux/slidenavigation/View.js +734 -0
- data/public/javascripts/knitkit/theme.js +76 -0
- data/public/stylesheets/erp_app/desktop/applications/knitkit/knitkit.css +95 -35
- data/public/stylesheets/knitkit/bootstrap-responsive.min.css +10 -0
- data/public/stylesheets/knitkit/bootstrap.min.css +7 -0
- data/public/stylesheets/knitkit/custom.css +122 -0
- data/public/stylesheets/knitkit/datepicker.css +182 -0
- data/public/stylesheets/knitkit/inline_editing.css +58 -58
- data/spec/controllers/knitkit/erp_app/desktop/website_section_controller_spec.rb +1 -1
- data/spec/dummy/config/application.rb +1 -1
- data/spec/models/article_spec.rb +3 -3
- data/spec/models/content_spec.rb +9 -9
- data/spec/models/website_spec.rb +1 -1
- metadata +100 -114
- data/app/helpers/application_helper.rb +0 -134
- data/app/views/knitkit/articles/index.html.erb +0 -3
- data/app/views/knitkit/articles/show.html.erb +0 -4
- data/app/views/menus/knitkit/_default_sub_menu.html.erb +0 -43
- data/app/views/menus/knitkit/_default_sub_section_menu.html.erb +0 -47
- data/app/widgets/contact_us/views/_contact_form.html.erb +0 -36
- data/app/widgets/dynamic_forms/base.rb +0 -139
- data/app/widgets/dynamic_forms/javascript/dynamic_forms.js +0 -110
- data/app/widgets/dynamic_forms/views/error.html.erb +0 -5
- data/app/widgets/dynamic_forms/views/index.html.erb +0 -8
- data/app/widgets/dynamic_forms/views/success.html.erb +0 -4
- data/app/widgets/dynamic_grid/base.rb +0 -130
- data/app/widgets/dynamic_grid/helpers/controller/dynamic_grid_controller_helper.rb +0 -3
- data/app/widgets/dynamic_grid/helpers/view/dynamic_grid_view_helper.rb +0 -3
- data/app/widgets/dynamic_grid/javascript/dynamic_grid.js +0 -177
- data/app/widgets/dynamic_grid/views/index.html.erb +0 -14
- data/app/widgets/login/views/reset_password.html.erb +0 -26
- data/app/widgets/manage_profile/views/default_type_error.html.erb +0 -5
- data/app/widgets/scaffold/base.rb +0 -87
- data/app/widgets/scaffold/helpers/controller/scaffold_controller_helper.rb +0 -3
- data/app/widgets/scaffold/helpers/view/scaffold_view_helper.rb +0 -3
- data/app/widgets/scaffold/javascript/scaffold.js +0 -337
- data/app/widgets/scaffold/views/index.html.erb +0 -15
- data/app/widgets/search/views/_search.html.erb +0 -39
- data/public/images/knitkit/bullet.png +0 -0
- data/public/images/knitkit/close.png +0 -0
- data/public/images/knitkit/content.png +0 -0
- data/public/images/knitkit/footer.png +0 -0
- data/public/images/knitkit/graphic.png +0 -0
- data/public/images/knitkit/greyFadeDown.png +0 -0
- data/public/images/knitkit/link.png +0 -0
- data/public/images/knitkit/menu.png +0 -0
- data/public/images/knitkit/menu_select.png +0 -0
- data/public/images/knitkit/search.png +0 -0
- data/public/images/knitkit/tooltip.gif +0 -0
- data/public/javascripts/ajax_pagination.js +0 -33
- data/public/javascripts/datepicker.js +0 -445
- data/public/javascripts/erp_app/desktop/applications/knitkit/file_assets_panel.js +0 -341
- data/public/javascripts/erp_app/desktop/applications/knitkit/image_assets_data_view.js +0 -31
- data/public/javascripts/erp_app/desktop/applications/knitkit/image_assets_panel.js +0 -263
- data/public/javascripts/erp_app/desktop/applications/knitkit/section_articles_grid_panel.js +0 -722
- data/public/javascripts/erp_app/desktop/applications/knitkit/themes_tree_panel.js +0 -585
- data/public/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/website.js +0 -155
- data/public/javascripts/knitkit/helpers.js +0 -26
- data/public/stylesheets/datepicker.css +0 -121
- data/public/stylesheets/extjs/resources/css/knitkit_extjs_4.css +0 -233
- data/public/stylesheets/knitkit/style.css +0 -426
@@ -1,114 +1,246 @@
|
|
1
|
-
Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit",{
|
2
|
-
extend:"Ext.ux.desktop.Module",
|
3
|
-
id:'knitkit-win',
|
4
|
-
|
1
|
+
Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit", {
|
2
|
+
extend: "Ext.ux.desktop.Module",
|
3
|
+
id: 'knitkit-win',
|
4
|
+
alias: 'widget.knitkit_mainui',
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @cfg {Object} currentWebsite
|
8
|
+
* The currently selected website with params {id, name, configurationId}
|
9
|
+
*/
|
10
|
+
currentWebsite: null,
|
11
|
+
|
12
|
+
init: function () {
|
13
|
+
|
5
14
|
this.launcher = {
|
6
15
|
text: 'KnitKit',
|
7
|
-
iconCls:'icon-
|
8
|
-
handler
|
16
|
+
iconCls: 'icon-knitkit',
|
17
|
+
handler: this.createWindow,
|
9
18
|
scope: this
|
10
19
|
}
|
11
20
|
},
|
12
21
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
22
|
+
initComponent: function () {
|
23
|
+
var me = this;
|
24
|
+
|
25
|
+
me.addEvents(
|
26
|
+
/*
|
27
|
+
* @event websiteselected
|
28
|
+
* Fires when a website is selected
|
29
|
+
* @param {Compass.ErpApp.Desktop.Applications.Knitkit} this
|
30
|
+
* @param {Object} currentWebsite
|
31
|
+
*/
|
32
|
+
'websiteselected'
|
33
|
+
);
|
34
|
+
},
|
35
|
+
|
36
|
+
clearWebsite: function(){
|
37
|
+
var self = this,
|
38
|
+
desktop = self.app.getDesktop(),
|
39
|
+
win = desktop.getWindow('knitkit'),
|
40
|
+
menuBar = win.down('toolbar');
|
41
|
+
|
42
|
+
this.currentWebsite = null;
|
43
|
+
|
44
|
+
var eastRegion = Ext.ComponentQuery.query('#knitkitEastRegion').first();
|
45
|
+
eastRegion.fileAssetsPanel.clearWebsite();
|
46
|
+
eastRegion.imageAssetsPanel.clearWebsite();
|
47
|
+
|
48
|
+
var westRegion = Ext.ComponentQuery.query('#knitkitWestRegion').first();
|
49
|
+
westRegion.clearWebsite();
|
50
|
+
|
51
|
+
menuBar.down('#themeMenuItem').disable();
|
52
|
+
menuBar.down('#navigationMenuItem').disable();
|
53
|
+
menuBar.down('#hostsMenuItem').disable();
|
54
|
+
menuBar.down('#sectionsPagesMenuItem').disable();
|
55
|
+
menuBar.down('#deleteWebsiteMenuItem').disable();
|
56
|
+
menuBar.down('#configureWebsiteMenuItem').disable();
|
57
|
+
menuBar.down('#websitePublicationsMenuItem').disable();
|
58
|
+
menuBar.down('#exportWebsiteMenuItem').disable();
|
59
|
+
menuBar.down('#websiteInquiresMenuItem').disable();
|
60
|
+
menuBar.down('#publishWebsiteMenuItem').disable();
|
61
|
+
menuBar.down('#editWebsiteMenuItem').disable();
|
62
|
+
menuBar.down('#exportTemplateMenuItem').disable();
|
63
|
+
|
64
|
+
},
|
65
|
+
|
66
|
+
selectWebsite: function (website) {
|
67
|
+
// get only the data for the website
|
68
|
+
website = website.data;
|
69
|
+
|
70
|
+
|
71
|
+
var self = this,
|
72
|
+
desktop = self.app.getDesktop(),
|
73
|
+
win = desktop.getWindow('knitkit'),
|
74
|
+
menuBar = win.down('toolbar');
|
75
|
+
|
76
|
+
self.fireEvent('websiteselected', self, website);
|
77
|
+
|
78
|
+
this.currentWebsite = website;
|
79
|
+
|
80
|
+
var eastRegion = Ext.getCmp('knitkitEastRegion');
|
81
|
+
eastRegion.fileAssetsPanel.selectWebsite(website);
|
82
|
+
eastRegion.imageAssetsPanel.selectWebsite(website);
|
83
|
+
|
84
|
+
var westRegion = Ext.getCmp('knitkitWestRegion');
|
85
|
+
westRegion.selectWebsite(website);
|
86
|
+
|
87
|
+
Compass.ErpApp.Shared.FileManagerTree.extraPostData = {
|
88
|
+
website_id: website.id
|
89
|
+
};
|
90
|
+
|
91
|
+
Ext.Ajax.request({
|
92
|
+
url: '/knitkit/erp_app/desktop/site/has_active_theme',
|
93
|
+
params: {
|
94
|
+
website_id: website.id
|
95
|
+
},
|
96
|
+
success: function(response){
|
97
|
+
var text = response.responseText;
|
98
|
+
var obj = Ext.decode(text);
|
99
|
+
if (obj.message == 'true') {
|
100
|
+
menuBar.down('#exportTemplateMenuItem').enable();
|
101
|
+
}
|
102
|
+
}
|
103
|
+
});
|
104
|
+
|
105
|
+
menuBar.down('#themeMenuItem').enable();
|
106
|
+
menuBar.down('#navigationMenuItem').enable();
|
107
|
+
menuBar.down('#hostsMenuItem').enable();
|
108
|
+
menuBar.down('#sectionsPagesMenuItem').enable();
|
109
|
+
menuBar.down('#deleteWebsiteMenuItem').enable();
|
110
|
+
menuBar.down('#configureWebsiteMenuItem').enable();
|
111
|
+
menuBar.down('#websitePublicationsMenuItem').enable();
|
112
|
+
menuBar.down('#exportWebsiteMenuItem').enable();
|
113
|
+
menuBar.down('#websiteInquiresMenuItem').enable();
|
114
|
+
menuBar.down('#publishWebsiteMenuItem').enable();
|
115
|
+
menuBar.down('#editWebsiteMenuItem').enable();
|
116
|
+
|
117
|
+
},
|
118
|
+
|
119
|
+
createWindow: function () {
|
18
120
|
var desktop = this.app.getDesktop();
|
19
121
|
var win = desktop.getWindow('knitkit');
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
}
|
43
|
-
},
|
44
|
-
{
|
45
|
-
iconCls:'btn-save-all',
|
46
|
-
text:'Save All',
|
47
|
-
handler:function(btn){
|
48
|
-
centerRegion.saveAll();
|
49
|
-
}
|
50
|
-
},
|
51
|
-
'->',
|
52
|
-
{
|
53
|
-
iconCls:'btn-left-panel',
|
54
|
-
handler:function(btn){
|
55
|
-
var panel = btn.up('window').down('knitkit_westregion');
|
56
|
-
if(panel.collapsed){
|
57
|
-
panel.expand();
|
58
|
-
}
|
59
|
-
else{
|
60
|
-
panel.collapse(Ext.Component.DIRECTION_LEFT);
|
61
|
-
}
|
62
|
-
}
|
63
|
-
},
|
64
|
-
{
|
65
|
-
iconCls:'btn-right-panel',
|
66
|
-
handler:function(btn){
|
67
|
-
var panel = btn.up('window').down('knitkit_eastregion');
|
68
|
-
if(panel.collapsed){
|
69
|
-
panel.expand();
|
70
|
-
}
|
71
|
-
else{
|
72
|
-
panel.collapse(Ext.Component.DIRECTION_RIGHT);
|
73
|
-
}
|
74
|
-
}
|
75
|
-
},
|
76
|
-
{
|
77
|
-
iconCls:'btn-left-right-panel',
|
78
|
-
handler:function(btn){
|
79
|
-
var east = btn.up('window').down('knitkit_eastregion');
|
80
|
-
var west = btn.up('window').down('knitkit_westregion');
|
81
|
-
if(west.collapsed || east.collapsed){
|
82
|
-
west.expand();
|
83
|
-
east.expand();
|
84
|
-
}
|
85
|
-
else
|
86
|
-
if(!west.collapsed && !east.collapsed){
|
87
|
-
var task = new Ext.util.DelayedTask(function(){
|
88
|
-
west.collapse(Ext.Component.DIRECTION_LEFT);
|
89
|
-
});
|
90
|
-
east.collapse(Ext.Component.DIRECTION_RIGHT);
|
91
|
-
task.delay(400);
|
92
|
-
|
93
|
-
}
|
94
|
-
}
|
122
|
+
|
123
|
+
if (!win) {
|
124
|
+
var centerRegion = Ext.create('Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion');
|
125
|
+
this.centerRegion = centerRegion;
|
126
|
+
|
127
|
+
var tbarItems = [];
|
128
|
+
|
129
|
+
if (currentUser.hasCapability('create', 'Website')) {
|
130
|
+
tbarItems.push(
|
131
|
+
{
|
132
|
+
text: 'Main Menu',
|
133
|
+
menu: {
|
134
|
+
xtype: 'menu',
|
135
|
+
items: [
|
136
|
+
Compass.ErpApp.Desktop.Applications.Knitkit.websiteMenu(),
|
137
|
+
Compass.ErpApp.Desktop.Applications.Knitkit.ArticlesMenu(),
|
138
|
+
Compass.ErpApp.Desktop.Applications.Knitkit.SectionsMenu(),
|
139
|
+
Compass.ErpApp.Desktop.Applications.Knitkit.ThemeMenu(),
|
140
|
+
Compass.ErpApp.Desktop.Applications.Knitkit.NavigationMenu(),
|
141
|
+
Compass.ErpApp.Desktop.Applications.Knitkit.HostsMenu(),
|
142
|
+
Compass.ErpApp.Desktop.Applications.Knitkit.TemplateMenu()
|
143
|
+
]
|
95
144
|
}
|
96
|
-
|
145
|
+
}
|
146
|
+
);
|
147
|
+
}
|
148
|
+
|
149
|
+
tbarItems.push(
|
150
|
+
{
|
151
|
+
iconCls: 'btn-save-light',
|
152
|
+
text: 'Save',
|
153
|
+
handler: function (btn) {
|
154
|
+
centerRegion.saveCurrent();
|
155
|
+
}
|
97
156
|
},
|
98
|
-
items:[
|
99
|
-
this.centerRegion,
|
100
157
|
{
|
101
|
-
|
102
|
-
|
158
|
+
iconCls: 'btn-save-all-light',
|
159
|
+
text: 'Save All',
|
160
|
+
handler: function (btn) {
|
161
|
+
centerRegion.saveAll();
|
162
|
+
}
|
163
|
+
});
|
164
|
+
|
165
|
+
tbarItems.push('->',
|
166
|
+
{
|
167
|
+
iconCls: 'btn-left-panel',
|
168
|
+
handler: function (btn) {
|
169
|
+
var panel = btn.up('window').down('knitkit_westregion');
|
170
|
+
if (panel.collapsed) {
|
171
|
+
panel.expand();
|
172
|
+
}
|
173
|
+
else {
|
174
|
+
panel.collapse(Ext.Component.DIRECTION_LEFT);
|
175
|
+
}
|
176
|
+
}
|
103
177
|
},
|
104
178
|
{
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
179
|
+
iconCls: 'btn-right-panel',
|
180
|
+
handler: function (btn) {
|
181
|
+
var panel = btn.up('window').down('knitkit_eastregion');
|
182
|
+
if (panel.collapsed) {
|
183
|
+
panel.expand();
|
184
|
+
}
|
185
|
+
else {
|
186
|
+
panel.collapse(Ext.Component.DIRECTION_RIGHT);
|
187
|
+
}
|
188
|
+
}
|
189
|
+
},
|
190
|
+
{
|
191
|
+
iconCls: 'btn-left-right-panel',
|
192
|
+
handler: function (btn) {
|
193
|
+
var east = btn.up('window').down('knitkit_eastregion');
|
194
|
+
var west = btn.up('window').down('knitkit_westregion');
|
195
|
+
if (west.collapsed || east.collapsed) {
|
196
|
+
west.expand();
|
197
|
+
east.expand();
|
198
|
+
}
|
199
|
+
else if (!west.collapsed && !east.collapsed) {
|
200
|
+
var task = new Ext.util.DelayedTask(function () {
|
201
|
+
west.collapse(Ext.Component.DIRECTION_LEFT);
|
202
|
+
});
|
203
|
+
east.collapse(Ext.Component.DIRECTION_RIGHT);
|
204
|
+
task.delay(400);
|
205
|
+
|
206
|
+
}
|
207
|
+
}
|
208
|
+
});
|
209
|
+
|
210
|
+
win = desktop.createWindow({
|
211
|
+
id: 'knitkit',
|
212
|
+
title: 'KnitKit',
|
213
|
+
width: 1200,
|
214
|
+
height: 550,
|
215
|
+
maximized: true,
|
216
|
+
iconCls: 'icon-knitkit-light',
|
217
|
+
shim: false,
|
218
|
+
animCollapse: false,
|
219
|
+
constrainHeader: true,
|
220
|
+
layout: 'border',
|
221
|
+
dockedItems: [{
|
222
|
+
xtype: 'toolbar',
|
223
|
+
dock: 'top',
|
224
|
+
ui: 'ide-main',
|
225
|
+
items: tbarItems
|
226
|
+
}],
|
227
|
+
items: [
|
228
|
+
this.centerRegion,
|
229
|
+
{
|
230
|
+
xtype: 'knitkit_eastregion',
|
231
|
+
header: false,
|
232
|
+
module: this
|
233
|
+
},
|
234
|
+
{
|
235
|
+
xtype: 'knitkit_westregion',
|
236
|
+
header: false,
|
237
|
+
centerRegion: this.centerRegion,
|
238
|
+
module: this
|
239
|
+
}
|
240
|
+
]
|
110
241
|
});
|
111
242
|
}
|
243
|
+
|
112
244
|
win.show();
|
113
245
|
}
|
114
246
|
});
|
@@ -1,92 +1,96 @@
|
|
1
|
-
Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.PublishWindow",{
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.PublishWindow", {
|
2
|
+
extend: "Ext.window.Window",
|
3
|
+
alias: 'widget.knikit_publishwindow',
|
4
|
+
initComponent: function () {
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
6
|
+
this.addEvents(
|
7
|
+
/**
|
8
|
+
* @event publish_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
|
+
"publish_success",
|
14
|
+
/**
|
15
|
+
* @event publish_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
|
+
"publish_failure"
|
21
|
+
);
|
22
22
|
|
23
23
|
this.callParent(arguments);
|
24
24
|
},
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
26
|
+
constructor: function (config) {
|
27
|
+
config = Ext.apply({
|
28
|
+
layout: 'fit',
|
29
|
+
title: 'Publish',
|
30
|
+
autoHeight: true,
|
31
|
+
iconCls: 'icon-document',
|
32
|
+
width: 400,
|
33
|
+
height: 300,
|
34
|
+
buttonAlign: 'center',
|
35
|
+
plain: true,
|
36
|
+
items: Ext.create('widget.form', {
|
37
|
+
timeout: 130000,
|
38
|
+
baseParams: config['baseParams'],
|
39
|
+
autoHeight: true,
|
40
|
+
labelWidth: 110,
|
41
|
+
frame: false,
|
42
|
+
layout: 'fit',
|
43
|
+
url: config['url'],
|
44
|
+
defaults: {
|
45
|
+
width: 225
|
46
|
+
},
|
47
|
+
items: [
|
48
|
+
{
|
49
|
+
xtype: 'textarea',
|
50
|
+
hideLabel: true,
|
51
|
+
name: 'comment'
|
52
|
+
}
|
53
|
+
]
|
54
|
+
}),
|
55
|
+
buttons: [
|
56
|
+
{
|
57
|
+
text: 'Submit',
|
58
|
+
listeners: {
|
59
|
+
'click': function (button) {
|
60
|
+
var win = button.findParentByType('knikit_publishwindow');
|
61
|
+
var formPanel = win.query('form')[0];
|
62
|
+
formPanel.getForm().submit({
|
63
|
+
method: 'POST',
|
64
|
+
waitMsg: 'Publishing...',
|
65
|
+
success: function (form, action) {
|
66
|
+
var response = Ext.decode(action.response.responseText);
|
67
|
+
win.fireEvent('publish_success', win, response);
|
68
|
+
win.close();
|
69
|
+
},
|
70
|
+
failure: function (form, action) {
|
71
|
+
var response = Ext.decode(action.response.responseText);
|
72
|
+
win.fireEvent('publish_failure', win, response);
|
73
|
+
win.close();
|
74
|
+
}
|
75
|
+
});
|
76
|
+
}
|
77
|
+
}
|
78
|
+
},
|
79
|
+
{
|
80
|
+
text: 'Cancel',
|
81
|
+
listeners: {
|
82
|
+
'click': function (button) {
|
83
|
+
var win = button.findParentByType('knikit_publishwindow');
|
84
|
+
var form = win.query('form')[0];
|
85
|
+
form.getForm().reset();
|
86
|
+
win.close();
|
87
|
+
}
|
88
|
+
}
|
89
|
+
}
|
90
|
+
]
|
91
|
+
}, config);
|
92
|
+
|
93
|
+
this.callParent([config]);
|
94
|
+
}
|
88
95
|
|
89
|
-
this.callParent([config]);
|
90
|
-
}
|
91
|
-
|
92
96
|
});
|