knitkit 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +22 -0
- data/app/controllers/knitkit/base_controller.rb +15 -2
- data/app/controllers/knitkit/blogs_controller.rb +4 -4
- data/app/controllers/knitkit/erp_app/desktop/app_controller.rb +16 -2
- data/app/controllers/knitkit/erp_app/desktop/articles_controller.rb +198 -57
- data/app/controllers/knitkit/erp_app/desktop/content_controller.rb +25 -11
- data/app/controllers/knitkit/erp_app/desktop/file_assets_controller.rb +123 -44
- data/app/controllers/knitkit/erp_app/desktop/image_assets_controller.rb +83 -9
- data/app/controllers/knitkit/erp_app/desktop/online_document_sections_controller.rb +38 -0
- data/app/controllers/knitkit/erp_app/desktop/position_controller.rb +15 -6
- data/app/controllers/knitkit/erp_app/desktop/theme_controller.rb +185 -98
- data/app/controllers/knitkit/erp_app/desktop/versions_controller.rb +38 -16
- data/app/controllers/knitkit/erp_app/desktop/website_controller.rb +126 -68
- data/app/controllers/knitkit/erp_app/desktop/website_nav_controller.rb +154 -107
- data/app/controllers/knitkit/erp_app/desktop/website_section_controller.rb +113 -54
- data/app/controllers/knitkit/online_document_sections_controller.rb +45 -0
- data/app/controllers/knitkit/unauthorized_controller.rb +5 -0
- data/app/controllers/knitkit/website_sections_controller.rb +8 -9
- data/app/mailers/document_mailer.rb +10 -0
- data/app/models/article.rb +1 -1
- data/app/models/content.rb +35 -3
- data/app/models/document.rb +8 -0
- data/app/models/document_type.rb +3 -0
- data/app/models/documented_content.rb +29 -0
- data/app/models/documented_item.rb +31 -0
- data/app/models/extensions/configuration.rb +5 -0
- data/app/models/extensions/party.rb +13 -0
- data/app/models/online_document_section.rb +40 -0
- data/app/models/theme.rb +22 -26
- data/app/models/valid_document.rb +4 -0
- data/app/models/website.rb +158 -119
- data/app/models/website_inquiry.rb +7 -2
- data/app/models/website_inquiry_mailer.rb +4 -3
- data/app/models/website_party_role.rb +5 -0
- data/app/models/website_section.rb +76 -38
- data/app/views/document_mailer/email_document.html.erb +12 -0
- data/app/views/knitkit/blogs/_add_comment.html.erb +2 -2
- data/app/views/knitkit/online_document_sections/index.html.erb +149 -0
- data/app/views/knitkit/website_sections/index.html.erb +0 -1
- data/app/views/layouts/knitkit/base.html.erb +4 -2
- data/app/views/layouts/knitkit/online_document_sections.html.erb +59 -0
- data/app/views/menus/knitkit/_default_menu.html.erb +1 -1
- data/app/views/menus/knitkit/_default_section_menu.html.erb +1 -1
- data/app/views/menus/knitkit/_default_sub_menu.html.erb +2 -2
- data/app/views/menus/knitkit/_default_sub_section_menu.html.erb +1 -1
- data/app/widgets/contact_us/base.rb +5 -5
- data/app/widgets/contact_us/javascript/contact_us.js +2 -1
- data/app/widgets/google_map/base.rb +0 -4
- data/app/widgets/google_map/javascript/google_map.js +4 -3
- data/app/widgets/login/base.rb +0 -5
- data/app/widgets/login/javascript/login.js +155 -153
- data/app/widgets/login/views/index.html.erb +3 -3
- data/app/widgets/login/views/reset_password.html.erb +2 -2
- data/app/widgets/manage_profile/base.rb +46 -67
- data/app/widgets/manage_profile/javascript/manage_profile.js +2 -1
- data/app/widgets/manage_profile/views/_user_information_form.html.erb +5 -1
- data/app/widgets/reset_password/base.rb +4 -6
- data/app/widgets/reset_password/javascript/reset_password.js +2 -1
- data/app/widgets/reset_password/views/index.html.erb +4 -3
- data/app/widgets/search/base.rb +1 -5
- data/app/widgets/search/javascript/search.js +2 -1
- data/app/widgets/search/views/show.html.erb +2 -2
- data/app/widgets/signup/base.rb +7 -6
- data/app/widgets/signup/javascript/signup.js +2 -1
- data/app/widgets/signup/views/error.html.erb +1 -1
- data/config/routes.rb +6 -2
- data/db/data_migrations/20110509223702_add_publisher_role.rb +10 -0
- data/db/data_migrations/20111118182910_setup_knitkit_capabilities.rb +84 -0
- data/db/data_migrations/20120127144444_create_website_role_types.rb +13 -0
- data/db/data_migrations/20120127150505_create_website_default_configuration.rb +72 -0
- data/db/data_migrations/20120127150506_add_primary_host_to_website_configuration.rb +33 -0
- data/db/data_migrations/20120316150424_add_is_template_to_default_website_config.rb +16 -0
- data/db/data_migrations/upgrade/20120210195616_add_website_configs.rb +19 -0
- data/db/data_migrations/upgrade/20120213205519_populate_website_iids.rb +17 -0
- data/db/migrate/20110211002317_setup_knitkit.rb +22 -5
- data/db/migrate/20111207161928_create_documented_items_table.rb +13 -0
- data/db/migrate/20111208180539_add_document_id_to_documented_item.rb +9 -0
- data/db/migrate/20120315163736_add_document.rb +32 -0
- data/db/migrate/20120503183431_create_valid_documents.rb +16 -0
- data/db/migrate/upgrade/20120116201510_add_render_base_layout_flag.rb +13 -0
- data/db/migrate/upgrade/20120127143745_create_website_party_roles.rb +24 -0
- data/db/migrate/upgrade/20120213184509_add_iid_to_websites.rb +14 -0
- data/lib/knitkit.rb +2 -0
- data/lib/knitkit/config.rb +31 -0
- data/lib/knitkit/engine.rb +12 -3
- data/lib/knitkit/extensions.rb +1 -3
- data/lib/knitkit/extensions/action_controller/theme_support/acts_as_themed_controller.rb +2 -3
- data/lib/knitkit/extensions/active_record/acts_as_document.rb +63 -0
- data/lib/knitkit/extensions/active_record/acts_as_publishable.rb +5 -4
- data/lib/knitkit/extensions/compass_ae/widgets/base.rb +70 -0
- data/lib/knitkit/extensions/railties/action_view.rb +22 -10
- data/lib/knitkit/extensions/railties/theme_support/asset_tag_helper.rb +3 -3
- data/lib/knitkit/extensions/railties/theme_support/theme_file_resolver.rb +8 -3
- data/lib/knitkit/routing_filter/section_router.rb +16 -6
- data/lib/knitkit/version.rb +7 -1
- data/public/images/check.png +0 -0
- data/public/images/credit_card.png +0 -0
- data/public/images/knitkit/tooltip.gif +0 -0
- data/public/javascripts/ajax_pagination.js +33 -0
- data/public/javascripts/datepicker.js +6 -1
- data/public/javascripts/erp_app/desktop/applications/knitkit/articles_grid_panel.js +731 -258
- data/public/javascripts/erp_app/desktop/applications/knitkit/center_region.js +289 -238
- data/public/javascripts/erp_app/desktop/applications/knitkit/comments_grid_panel.js +2 -4
- data/public/javascripts/erp_app/desktop/applications/knitkit/east_region.js +29 -3
- data/public/javascripts/erp_app/desktop/applications/knitkit/file_assets_panel.js +193 -21
- data/public/javascripts/erp_app/desktop/applications/knitkit/image_assets_data_view.js +27 -26
- data/public/javascripts/erp_app/desktop/applications/knitkit/image_assets_panel.js +167 -20
- data/public/javascripts/erp_app/desktop/applications/knitkit/inquiries_grid_panel.js +1 -2
- data/public/javascripts/erp_app/desktop/applications/knitkit/module.js +5 -1
- data/public/javascripts/erp_app/desktop/applications/knitkit/publish_window.js +2 -2
- data/public/javascripts/erp_app/desktop/applications/knitkit/published_grid_panel.js +20 -11
- data/public/javascripts/erp_app/desktop/applications/knitkit/section_articles_grid_panel.js +279 -228
- data/public/javascripts/erp_app/desktop/applications/knitkit/themes_tree_panel.js +40 -40
- data/public/javascripts/erp_app/desktop/applications/knitkit/versions_grid_panel.js +83 -76
- data/public/javascripts/erp_app/desktop/applications/knitkit/west_region.js +1961 -1397
- data/public/javascripts/erp_app/desktop/applications/knitkit/widgets_panel.js +47 -43
- data/public/javascripts/knitkit/helpers.js +26 -0
- data/public/stylesheets/erp_app/desktop/applications/knitkit/knitkit.css +1 -2
- data/public/stylesheets/knitkit/documentation.css +50 -0
- data/public/stylesheets/knitkit/style.css +23 -1
- data/spec/controllers/knitkit/erp_app/desktop/articles_controller_spec.rb +8 -0
- data/spec/controllers/knitkit/erp_app/desktop/website_controller_spec.rb +396 -0
- data/spec/controllers/knitkit/erp_app/desktop/website_nav_controller_spec.rb +260 -0
- data/spec/controllers/knitkit/erp_app/desktop/website_section_controller_spec.rb +222 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +9 -0
- data/spec/dummy/app/assets/stylesheets/application.css +7 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +43 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +8 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/spec.rb +27 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +10 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +12 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +4 -0
- data/spec/dummy/config/workflow.yml +1 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +26 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/factories/article.rb +4 -0
- data/spec/factories/basic.rb +3 -0
- data/spec/factories/blog.rb +5 -0
- data/spec/factories/documented_content.rb +4 -0
- data/spec/factories/documented_item.rb +4 -0
- data/spec/factories/online_document_section.rb +6 -0
- data/spec/factories/published_website.rb +4 -0
- data/spec/factories/theme.rb +6 -0
- data/spec/factories/website.rb +5 -0
- data/spec/factories/website_host.rb +4 -0
- data/spec/factories/website_nav.rb +5 -0
- data/spec/factories/website_nav_item.rb +4 -0
- data/spec/factories/website_section.rb +5 -0
- data/spec/models/article_spec.rb +35 -0
- data/spec/models/attribute_type_spec.rb +55 -0
- data/spec/models/attribute_value_spec.rb +114 -0
- data/spec/models/blog_spec.rb +16 -0
- data/spec/models/comment_spec.rb +11 -0
- data/spec/models/content_spec.rb +187 -0
- data/spec/models/documented_item_spec.rb +29 -0
- data/spec/models/online_document_section_spec.rb +34 -0
- data/spec/models/published_element_spec.rb +11 -0
- data/spec/models/published_website_spec.rb +11 -0
- data/spec/models/theme_spec.rb +12 -0
- data/spec/models/website_host_spec.rb +11 -0
- data/spec/models/website_inquiry_spec.rb +24 -0
- data/spec/models/website_nav_item_spec.rb +11 -0
- data/spec/models/website_nav_spec.rb +11 -0
- data/spec/models/website_section_content_spec.rb +11 -0
- data/spec/models/website_section_spec.rb +49 -0
- data/spec/models/website_spec.rb +146 -0
- data/spec/spec_helper.rb +61 -0
- metadata +391 -154
- data/app/controllers/knitkit/articles_controller.rb +0 -7
- data/lib/knitkit/extensions/compass/widgets/base.rb +0 -53
@@ -9,16 +9,16 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion",{
|
|
9
9
|
['SpellChecker','-','SelectAll'],
|
10
10
|
['TextColor','BGColor'],
|
11
11
|
['Bold','Italic','Underline','Strike'],
|
12
|
-
['Subscript','Superscript','-','
|
13
|
-
['NumberedList','BulletedList'],
|
14
|
-
['Outdent','Indent','Blockquote'
|
12
|
+
['Subscript','Superscript','-','jwplayer'],
|
13
|
+
['Table','NumberedList','BulletedList'],
|
14
|
+
['Outdent','Indent','Blockquote'],
|
15
15
|
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
|
16
16
|
['BidiLtr','BidiRtl'],
|
17
17
|
['Link','Unlink','Anchor'],
|
18
|
-
['jwplayer','Flash','Table'],
|
19
18
|
['HorizontalRule','SpecialChar','PageBreak'],
|
19
|
+
['ShowBlocks','RemoveFormat'],
|
20
20
|
['Styles','Format','Font','FontSize' ],
|
21
|
-
['Maximize','
|
21
|
+
['Maximize','-','About']
|
22
22
|
],
|
23
23
|
|
24
24
|
setWindowStatus : function(status){
|
@@ -45,8 +45,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion",{
|
|
45
45
|
saveSectionLayout : function(sectionId, content){
|
46
46
|
var self = this;
|
47
47
|
this.setWindowStatus('Saving...');
|
48
|
-
|
49
|
-
conn.request({
|
48
|
+
Ext.Ajax.request({
|
50
49
|
url: '/knitkit/erp_app/desktop/section/save_layout',
|
51
50
|
method: 'POST',
|
52
51
|
params:{
|
@@ -73,52 +72,58 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion",{
|
|
73
72
|
|
74
73
|
editSectionLayout : function(sectionName, websiteId, websiteSectionId, content, tbarItems){
|
75
74
|
var self = this;
|
76
|
-
var
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
title:sectionName
|
83
|
-
tbarItems:tbarItems,
|
84
|
-
xtype:'codemirror',
|
85
|
-
parser:'erb',
|
86
|
-
region:'center',
|
87
|
-
sourceCode:content,
|
75
|
+
var itemId = 'section-'+websiteSectionId;
|
76
|
+
var item = this.workArea.query('#'+itemId).first();
|
77
|
+
|
78
|
+
if(Compass.ErpApp.Utility.isBlank(item)){
|
79
|
+
item = Ext.create("Ext.panel.Panel",{
|
80
|
+
layout:'border',
|
81
|
+
title:sectionName,
|
88
82
|
closable:true,
|
89
|
-
|
90
|
-
|
91
|
-
|
83
|
+
itemId:itemId,
|
84
|
+
items:[
|
85
|
+
{
|
86
|
+
title:sectionName + ' - Layout',
|
87
|
+
tbarItems:tbarItems,
|
88
|
+
xtype:'codemirror',
|
89
|
+
parser:'erb',
|
90
|
+
region:'center',
|
91
|
+
sourceCode:content,
|
92
|
+
closable:true,
|
93
|
+
listeners:{
|
94
|
+
'save':function(codeMirror, content){
|
95
|
+
self.saveSectionLayout(websiteSectionId, content);
|
96
|
+
}
|
92
97
|
}
|
98
|
+
},
|
99
|
+
{
|
100
|
+
xtype:'knitkit_versionswebsitesectiongridpanel',
|
101
|
+
websiteSectionId:websiteSectionId,
|
102
|
+
region:'south',
|
103
|
+
height:150,
|
104
|
+
collapsible:true,
|
105
|
+
centerRegion:self,
|
106
|
+
siteId:websiteId
|
93
107
|
}
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
height:300,
|
100
|
-
collapsible:true,
|
101
|
-
centerRegion:self,
|
102
|
-
siteId:websiteId
|
103
|
-
}
|
104
|
-
],
|
105
|
-
listeners:{
|
106
|
-
'show':function(panel){
|
107
|
-
Ext.getCmp('knitkitWestRegion').selectWebsite(websiteId);
|
108
|
+
],
|
109
|
+
listeners:{
|
110
|
+
'show':function(panel){
|
111
|
+
Ext.getCmp('knitkitWestRegion').selectWebsite(websiteId);
|
112
|
+
}
|
108
113
|
}
|
109
|
-
}
|
110
|
-
});
|
114
|
+
});
|
111
115
|
|
112
|
-
|
113
|
-
|
116
|
+
this.workArea.add(item);
|
117
|
+
}
|
118
|
+
|
119
|
+
this.workArea.setActiveTab(item);
|
114
120
|
return false;
|
115
121
|
},
|
116
122
|
|
117
123
|
saveTemplateFile : function(path, content){
|
118
124
|
var self = this;
|
119
125
|
this.setWindowStatus('Saving...');
|
120
|
-
|
121
|
-
conn.request({
|
126
|
+
Ext.Ajax.request({
|
122
127
|
url: '/knitkit/erp_app/desktop/theme/update_file',
|
123
128
|
method: 'POST',
|
124
129
|
params:{
|
@@ -139,38 +144,44 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion",{
|
|
139
144
|
});
|
140
145
|
},
|
141
146
|
|
142
|
-
editTemplateFile : function(node, content, tbarItems){
|
147
|
+
editTemplateFile : function(node, content, tbarItems, themeId){
|
143
148
|
var self = this;
|
144
|
-
var
|
149
|
+
var fileName = node.data.id.split('/').pop().split('.')[0];
|
145
150
|
var fileType = node.data.id.split('.').pop();
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
layout:'fit',
|
152
|
-
items:[{
|
153
|
-
tbarItems:tbarItems,
|
154
|
-
xtype:'codemirror',
|
155
|
-
parser:fileType,
|
156
|
-
sourceCode:content,
|
151
|
+
var itemId = fileName+themeId;
|
152
|
+
var item = this.workArea.query('#'+itemId).first();
|
153
|
+
|
154
|
+
if(Compass.ErpApp.Utility.isBlank(item)){
|
155
|
+
item = Ext.create('Ext.panel.Panel',{
|
157
156
|
closable:true,
|
158
|
-
|
159
|
-
|
160
|
-
|
157
|
+
title:fileName,
|
158
|
+
itemId:itemId,
|
159
|
+
layout:'fit',
|
160
|
+
items:[{
|
161
|
+
tbarItems:tbarItems,
|
162
|
+
xtype:'codemirror',
|
163
|
+
parser:fileType,
|
164
|
+
sourceCode:content,
|
165
|
+
closable:true,
|
166
|
+
listeners:{
|
167
|
+
'save':function(codeMirror, content){
|
168
|
+
self.saveTemplateFile(node.data.id, content);
|
169
|
+
}
|
161
170
|
}
|
162
|
-
}
|
163
|
-
}
|
164
|
-
|
165
|
-
|
171
|
+
}]
|
172
|
+
});
|
173
|
+
|
174
|
+
this.workArea.add(item);
|
175
|
+
}
|
176
|
+
|
177
|
+
this.workArea.setActiveTab(item);
|
166
178
|
return false;
|
167
179
|
},
|
168
180
|
|
169
181
|
saveExcerpt : function(id, content){
|
170
182
|
var self = this;
|
171
183
|
this.setWindowStatus('Saving...');
|
172
|
-
|
173
|
-
conn.request({
|
184
|
+
Ext.Ajax.request({
|
174
185
|
url: '/knitkit/erp_app/desktop/content/save_excerpt',
|
175
186
|
method: 'POST',
|
176
187
|
params:{
|
@@ -202,75 +213,81 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion",{
|
|
202
213
|
|
203
214
|
editExcerpt : function(title, id, content, siteId, contentGridStore){
|
204
215
|
var self = this;
|
205
|
-
var
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
self.
|
215
|
-
|
216
|
+
var itemId = 'editExcerpt-'+id;
|
217
|
+
var item = this.workArea.query('#'+itemId).first();
|
218
|
+
|
219
|
+
if(Compass.ErpApp.Utility.isBlank(item)){
|
220
|
+
var ckEditor = Ext.create("Compass.ErpApp.Shared.CKeditor",{
|
221
|
+
autoHeight:true,
|
222
|
+
value:content,
|
223
|
+
ckEditorConfig:{
|
224
|
+
extraPlugins:'compasssave,jwplayer', // removed codemirror plugin as it is unstable
|
225
|
+
toolbar:self.ckEditorToolbar
|
226
|
+
},
|
227
|
+
listeners:{
|
228
|
+
'save':function(ckEditor, content){
|
229
|
+
self.saveExcerpt(id, content);
|
230
|
+
contentGridStore.load();
|
231
|
+
}
|
216
232
|
}
|
217
|
-
}
|
218
|
-
});
|
219
|
-
|
220
|
-
var items = [ {
|
221
|
-
xtype:'panel',
|
222
|
-
layout:'fit',
|
223
|
-
split:true,
|
224
|
-
region:'center',
|
225
|
-
items:ckEditor,
|
226
|
-
autoDestroy:true
|
227
|
-
}];
|
228
|
-
|
229
|
-
if(!Compass.ErpApp.Utility.isBlank(siteId)){
|
230
|
-
items.push( {
|
231
|
-
xtype:'knitkit_versionsbloggridpanel',
|
232
|
-
contentId:id,
|
233
|
-
region:'south',
|
234
|
-
height:300,
|
235
|
-
collapsible:true,
|
236
|
-
centerRegion:self,
|
237
|
-
siteId:siteId
|
238
233
|
});
|
239
|
-
}
|
240
|
-
else{
|
241
|
-
items.push({
|
242
|
-
xtype:'knitkit_nonpublishedversionswebsitesectiongridpanel',
|
243
|
-
contentId:id,
|
244
|
-
region:'south',
|
245
|
-
height:300,
|
246
|
-
collapsible:true,
|
247
|
-
centerRegion:self
|
248
|
-
});
|
249
|
-
}
|
250
234
|
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
235
|
+
var items = [ {
|
236
|
+
xtype:'panel',
|
237
|
+
layout:'fit',
|
238
|
+
split:true,
|
239
|
+
region:'center',
|
240
|
+
items:ckEditor,
|
241
|
+
autoDestroy:true
|
242
|
+
}];
|
243
|
+
|
244
|
+
if(!Compass.ErpApp.Utility.isBlank(siteId)){
|
245
|
+
items.push( {
|
246
|
+
xtype:'knitkit_versionsbloggridpanel',
|
247
|
+
contentId:id,
|
248
|
+
region:'south',
|
249
|
+
height:150,
|
250
|
+
collapsible:true,
|
251
|
+
centerRegion:self,
|
252
|
+
siteId:siteId
|
253
|
+
});
|
254
|
+
}
|
255
|
+
else{
|
256
|
+
items.push({
|
257
|
+
xtype:'knitkit_nonpublishedversionswebsitesectiongridpanel',
|
258
|
+
contentId:id,
|
259
|
+
region:'south',
|
260
|
+
height:150,
|
261
|
+
collapsible:true,
|
262
|
+
centerRegion:self
|
263
|
+
});
|
264
|
+
}
|
265
|
+
|
266
|
+
item = Ext.create("Ext.panel.Panel",{
|
267
|
+
layout:'border',
|
268
|
+
title:title,
|
269
|
+
closable:true,
|
270
|
+
items:items,
|
271
|
+
itemId:itemId,
|
272
|
+
listeners:{
|
273
|
+
'show':function(panel){
|
274
|
+
if(!Compass.ErpApp.Utility.isBlank(siteId)){
|
275
|
+
Ext.getCmp('knitkitWestRegion').selectWebsite(siteId);
|
276
|
+
}
|
260
277
|
}
|
261
278
|
}
|
262
|
-
}
|
263
|
-
})
|
279
|
+
});
|
264
280
|
|
265
|
-
|
266
|
-
|
281
|
+
this.workArea.add(item);
|
282
|
+
}
|
283
|
+
|
284
|
+
this.workArea.setActiveTab(item);
|
267
285
|
},
|
268
286
|
|
269
287
|
saveContent : function(id, content, contentType){
|
270
288
|
var self = this;
|
271
289
|
this.setWindowStatus('Saving...');
|
272
|
-
|
273
|
-
conn.request({
|
290
|
+
Ext.Ajax.request({
|
274
291
|
url: '/knitkit/erp_app/desktop/content/update',
|
275
292
|
method: 'POST',
|
276
293
|
params:{
|
@@ -311,8 +328,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion",{
|
|
311
328
|
}
|
312
329
|
});
|
313
330
|
|
314
|
-
|
315
|
-
xtype:'panel',
|
331
|
+
var item = Ext.create('Ext.panel.Panel',{
|
316
332
|
closable:true,
|
317
333
|
layout:'fit',
|
318
334
|
title:title,
|
@@ -320,77 +336,98 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion",{
|
|
320
336
|
items:ckEditor,
|
321
337
|
autoDestroy:true
|
322
338
|
});
|
323
|
-
|
339
|
+
|
340
|
+
this.workArea.add(item);
|
341
|
+
this.workArea.setActiveTab(item);
|
324
342
|
},
|
325
343
|
|
326
344
|
editContent : function(title, id, content, siteId, contentType, contentGridStore){
|
327
345
|
var self = this;
|
328
|
-
var
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
self.
|
338
|
-
|
346
|
+
var itemId = 'editContent-'+id;
|
347
|
+
var item = this.workArea.query('#'+itemId).first();
|
348
|
+
|
349
|
+
if(Compass.ErpApp.Utility.isBlank(item)){
|
350
|
+
var ckEditor = Ext.create("Compass.ErpApp.Shared.CKeditor",{
|
351
|
+
autoHeight:true,
|
352
|
+
//value:content,
|
353
|
+
ckEditorConfig:{
|
354
|
+
extraPlugins:'compasssave,jwplayer', // removed codemirror plugin as it is unstable
|
355
|
+
toolbar:self.ckEditorToolbar
|
356
|
+
},
|
357
|
+
listeners:{
|
358
|
+
'save':function(ckEditor, content){
|
359
|
+
if (currentUser.hasApplicationCapability('knitkit', {
|
360
|
+
capability_type_iid:'edit_html',
|
361
|
+
resource:'Article'
|
362
|
+
}))
|
363
|
+
{
|
364
|
+
self.saveContent(id, content, contentType);
|
365
|
+
if (contentGridStore){
|
366
|
+
contentGridStore.load();
|
367
|
+
}
|
368
|
+
|
369
|
+
}else{
|
370
|
+
currentUser.showInvalidAccess();
|
371
|
+
}
|
372
|
+
}
|
339
373
|
}
|
340
|
-
}
|
341
|
-
});
|
374
|
+
});
|
342
375
|
|
343
|
-
|
376
|
+
ckEditor.setValue(content);
|
344
377
|
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
378
|
+
var items = [
|
379
|
+
{
|
380
|
+
xtype:'panel',
|
381
|
+
layout:'fit',
|
382
|
+
split:true,
|
383
|
+
region:'center',
|
384
|
+
items:ckEditor,
|
385
|
+
autoDestroy:true
|
386
|
+
}
|
387
|
+
];
|
388
|
+
|
389
|
+
if(!Compass.ErpApp.Utility.isBlank(siteId)){
|
390
|
+
items.push({
|
391
|
+
xtype:'knitkit_versions'+contentType+'gridpanel',
|
392
|
+
contentId:id,
|
393
|
+
region:'south',
|
394
|
+
height:150,
|
395
|
+
collapsible:true,
|
396
|
+
centerRegion:self,
|
397
|
+
siteId:siteId
|
398
|
+
});
|
399
|
+
}
|
400
|
+
else{
|
401
|
+
items.push({
|
402
|
+
xtype:'knitkit_nonpublishedversionswebsitesectiongridpanel',
|
403
|
+
contentId:id,
|
404
|
+
region:'south',
|
405
|
+
height:150,
|
406
|
+
collapsible:true,
|
407
|
+
centerRegion:self
|
408
|
+
});
|
409
|
+
}
|
377
410
|
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
411
|
+
item = Ext.create('Ext.panel.Panel',{
|
412
|
+
xtype:'panel',
|
413
|
+
layout:'border',
|
414
|
+
title:title,
|
415
|
+
itemId:itemId,
|
416
|
+
closable:true,
|
417
|
+
items:items,
|
418
|
+
listeners:{
|
419
|
+
'show':function(panel){
|
420
|
+
if(!Compass.ErpApp.Utility.isBlank(siteId)){
|
421
|
+
Ext.getCmp('knitkitWestRegion').selectWebsite(siteId);
|
422
|
+
}
|
387
423
|
}
|
388
424
|
}
|
389
|
-
}
|
390
|
-
});
|
425
|
+
});
|
391
426
|
|
392
|
-
|
393
|
-
|
427
|
+
this.workArea.add(item);
|
428
|
+
}
|
429
|
+
|
430
|
+
this.workArea.setActiveTab(item);
|
394
431
|
},
|
395
432
|
|
396
433
|
showComment : function(comment){
|
@@ -406,67 +443,81 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion",{
|
|
406
443
|
|
407
444
|
viewContentComments : function(contentId, title){
|
408
445
|
var self = this;
|
409
|
-
var
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
446
|
+
var itemId = 'contentComments-'+contentId;
|
447
|
+
var item = this.workArea.query('#'+itemId).first();
|
448
|
+
|
449
|
+
if(Compass.ErpApp.Utility.isBlank(item)){
|
450
|
+
item = Ext.create("Ext.panel.Panel",{
|
451
|
+
layout:'border',
|
452
|
+
itemId:itemId,
|
453
|
+
title:title,
|
454
|
+
closable:true,
|
455
|
+
items:[
|
456
|
+
{
|
457
|
+
xtype:'panel',
|
458
|
+
layout:'card',
|
459
|
+
split:true,
|
460
|
+
region:'center',
|
461
|
+
items:[],
|
462
|
+
autoDestroy:true
|
463
|
+
},
|
464
|
+
{
|
465
|
+
xtype:'knitkit_commentsgridpanel',
|
466
|
+
contentId:contentId,
|
467
|
+
region:'south',
|
468
|
+
height:300,
|
469
|
+
collapsible:true,
|
470
|
+
centerRegion:self
|
471
|
+
}
|
472
|
+
]
|
473
|
+
});
|
474
|
+
this.workArea.add(item);
|
475
|
+
}
|
476
|
+
|
477
|
+
this.workArea.setActiveTab(item);
|
435
478
|
},
|
436
479
|
|
437
480
|
viewWebsiteInquiries : function(websiteId, title){
|
438
481
|
var self = this;
|
439
|
-
var
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
{
|
482
|
+
var itemId = 'websiteInqueries-'+websiteId;
|
483
|
+
var item = this.workArea.query('#'+itemId).first();
|
484
|
+
|
485
|
+
if(Compass.ErpApp.Utility.isBlank(item)){
|
486
|
+
item = {
|
445
487
|
xtype:'panel',
|
446
|
-
layout:'
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
488
|
+
layout:'border',
|
489
|
+
title:title + " Inquiries",
|
490
|
+
itemId:itemId,
|
491
|
+
closable:true,
|
492
|
+
items:[
|
493
|
+
{
|
494
|
+
xtype:'panel',
|
495
|
+
layout:'card',
|
496
|
+
split:true,
|
497
|
+
region:'center',
|
498
|
+
items:[],
|
499
|
+
autoDestroy:true
|
500
|
+
},
|
501
|
+
{
|
502
|
+
xtype:'knitkit_inquiriesgridpanel',
|
503
|
+
websiteId:websiteId,
|
504
|
+
region:'south',
|
505
|
+
height:300,
|
506
|
+
collapsible:true,
|
507
|
+
centerRegion:self
|
464
508
|
}
|
465
|
-
|
466
|
-
|
509
|
+
],
|
510
|
+
listeners:{
|
511
|
+
'show':function(panel){
|
512
|
+
Ext.getCmp('knitkitWestRegion').selectWebsite(websiteId);
|
513
|
+
}
|
514
|
+
}
|
515
|
+
};
|
467
516
|
|
468
|
-
|
469
|
-
|
517
|
+
this.workArea.add(item);
|
518
|
+
}
|
519
|
+
|
520
|
+
this.workArea.setActiveTab(item);
|
470
521
|
},
|
471
522
|
|
472
523
|
insertHtmlIntoActiveCkEditor : function(html){
|