knitkit 2.0.5 → 2.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/knitkit/erp_app/desktop/app_controller.rb +5 -8
- data/app/controllers/knitkit/erp_app/desktop/articles_controller.rb +11 -8
- data/app/controllers/knitkit/erp_app/desktop/content_controller.rb +26 -4
- data/app/controllers/knitkit/erp_app/desktop/file_assets_controller.rb +49 -35
- data/app/controllers/knitkit/erp_app/desktop/image_assets_controller.rb +30 -21
- data/app/controllers/knitkit/erp_app/desktop/theme_controller.rb +41 -32
- data/app/controllers/knitkit/erp_app/desktop/website_controller.rb +0 -6
- data/app/controllers/knitkit/erp_app/desktop/website_section_controller.rb +42 -6
- data/app/{models → mailers}/website_inquiry_mailer.rb +0 -0
- data/app/models/article.rb +4 -0
- data/app/models/content.rb +0 -4
- data/app/models/theme.rb +3 -3
- data/app/models/website.rb +44 -17
- data/app/views/knitkit/website_sections/index.html.erb +1 -1
- data/app/views/layouts/knitkit/base.html.erb +6 -0
- data/app/views/shared/knitkit/_footer.html.erb +2 -2
- data/app/widgets/signup/base.rb +0 -2
- data/db/data_migrations/20120809020508_update_website_and_configuration.rb +77 -0
- data/lib/knitkit/engine.rb +4 -0
- data/lib/knitkit/extensions.rb +4 -1
- data/lib/knitkit/extensions/action_controller/theme_support/acts_as_themed_controller.rb +36 -33
- data/lib/knitkit/extensions/action_mailer/theme_support/acts_as_themed_mailer.rb +60 -0
- data/lib/knitkit/extensions/active_record/acts_as_commentable.rb +9 -4
- data/lib/knitkit/extensions/active_record/acts_as_document.rb +1 -1
- data/lib/knitkit/extensions/compass_ae/widgets/base.rb +21 -1
- data/lib/knitkit/extensions/compass_ae/widgets/widget_proxy_controller.rb +26 -0
- data/lib/knitkit/extensions/railties/action_view/base.rb +11 -0
- data/lib/knitkit/extensions/railties/action_view/helpers/blog_helper.rb +62 -0
- data/lib/knitkit/extensions/railties/action_view/helpers/content_helper.rb +83 -0
- data/lib/knitkit/extensions/railties/action_view/helpers/knitkit_helper.rb +67 -0
- data/lib/knitkit/extensions/railties/action_view/helpers/menu_helper.rb +71 -0
- data/lib/knitkit/version.rb +1 -1
- data/public/images/knitkit/close.png +0 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/articles_grid_panel.js +150 -400
- data/public/javascripts/erp_app/desktop/applications/knitkit/center_region.js +687 -593
- data/public/javascripts/erp_app/desktop/applications/knitkit/east_region.js +1 -2
- data/public/javascripts/erp_app/desktop/applications/knitkit/file_assets_panel.js +39 -15
- data/public/javascripts/erp_app/desktop/applications/knitkit/image_assets_data_view.js +1 -1
- data/public/javascripts/erp_app/desktop/applications/knitkit/image_assets_panel.js +65 -126
- data/public/javascripts/erp_app/desktop/applications/knitkit/module.js +65 -1
- data/public/javascripts/erp_app/desktop/applications/knitkit/section_articles_grid_panel.js +265 -183
- data/public/javascripts/erp_app/desktop/applications/knitkit/themes_tree_panel.js +24 -9
- data/public/javascripts/erp_app/desktop/applications/knitkit/versions_grid_panel.js +631 -595
- data/public/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/document.js +265 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/host.js +133 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/menu.js +174 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/section.js +399 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/website.js +165 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/website_nav_items.js +266 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/west_region/west_region.js +1224 -0
- data/public/javascripts/knitkit/inline_editing.js +136 -0
- data/public/stylesheets/extjs/resources/css/knitkit_extjs_4.css +1 -2
- data/public/stylesheets/knitkit/inline_editing.css +88 -0
- data/public/stylesheets/knitkit/style.css +1 -1
- metadata +47 -31
- data/lib/knitkit/extensions/railties/action_view.rb +0 -199
- data/public/javascripts/erp_app/desktop/applications/knitkit/west_region.js +0 -2725
@@ -17,7 +17,8 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit",{
|
|
17
17
|
//***********************************************************
|
18
18
|
var desktop = this.app.getDesktop();
|
19
19
|
var win = desktop.getWindow('knitkit');
|
20
|
-
|
20
|
+
var centerRegion = Ext.create('Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion');
|
21
|
+
this.centerRegion = centerRegion;
|
21
22
|
if(!win){
|
22
23
|
win = desktop.createWindow({
|
23
24
|
id: 'knitkit',
|
@@ -31,6 +32,69 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit",{
|
|
31
32
|
animCollapse:false,
|
32
33
|
constrainHeader:true,
|
33
34
|
layout: 'border',
|
35
|
+
tbar:{
|
36
|
+
items:[
|
37
|
+
{
|
38
|
+
iconCls:'btn-save',
|
39
|
+
text:'Save',
|
40
|
+
handler:function(btn){
|
41
|
+
centerRegion.saveCurrent();
|
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
|
+
}
|
95
|
+
}
|
96
|
+
]
|
97
|
+
},
|
34
98
|
items:[
|
35
99
|
this.centerRegion,
|
36
100
|
{
|
@@ -31,135 +31,159 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.SectionArticlesGridPanel
|
|
31
31
|
|
32
32
|
editArticle : function(record){
|
33
33
|
var self = this;
|
34
|
-
|
35
|
-
|
36
|
-
var
|
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
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
34
|
+
var itemId = 'editArticle-'+record.get('id');
|
35
|
+
var editArticleWindow = Ext.ComponentQuery.query('#'+itemId).first();
|
36
|
+
// var addFormItems = self.addFormItems;
|
37
|
+
if (self.alias.first() == 'widget.knitkit_pagearticlesgridpanel'){
|
38
|
+
var addFormItems = [
|
39
|
+
{
|
40
|
+
xtype:'textfield',
|
41
|
+
fieldLabel:'Content Area',
|
42
|
+
name:'content_area',
|
43
|
+
value:record.data.content_area
|
44
|
+
},
|
45
|
+
{
|
46
|
+
xtype:'numberfield',
|
47
|
+
fieldLabel:'Position',
|
48
|
+
name:'position',
|
49
|
+
value:record.data.position
|
50
|
+
}
|
51
|
+
]
|
52
|
+
}
|
53
|
+
else {
|
54
|
+
if (self.alias.first() == 'widget.knitkit_blogarticlesgridpanel'){
|
55
|
+
var addFormItems = [
|
56
|
+
{
|
57
|
+
xtype:'textfield',
|
58
|
+
fieldLabel:'Tags',
|
59
|
+
allowBlank:true,
|
60
|
+
name:'tags',
|
61
|
+
value:record.data.tag_list
|
62
|
+
}
|
63
|
+
]
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
if(Compass.ErpApp.Utility.isBlank(editArticleWindow)){
|
68
|
+
var editArticleWindow = Ext.create("Ext.window.Window",{
|
69
|
+
layout:'fit',
|
70
|
+
width:375,
|
71
|
+
title:'Edit Article',
|
72
|
+
itemId:itemId,
|
73
|
+
plain: true,
|
74
|
+
buttonAlign:'center',
|
75
|
+
items: {
|
76
|
+
xtype: 'form',
|
77
|
+
labelWidth: 110,
|
78
|
+
frame:false,
|
79
|
+
bodyStyle:'padding:5px 5px 0',
|
80
|
+
width: 425,
|
81
|
+
url:'/knitkit/erp_app/desktop/articles/update/' + self.sectionId,
|
82
|
+
defaults: {
|
83
|
+
width: 225
|
84
|
+
},
|
85
|
+
items: [
|
86
|
+
{
|
87
|
+
xtype:'hidden',
|
88
|
+
allowBlank:false,
|
89
|
+
name:'id',
|
90
|
+
value: record.data.id
|
91
|
+
},
|
92
|
+
{
|
93
|
+
xtype:'textfield',
|
94
|
+
fieldLabel:'Title',
|
95
|
+
allowBlank:false,
|
96
|
+
name:'title',
|
97
|
+
value: record.data.title
|
98
|
+
},
|
99
|
+
{
|
100
|
+
xtype:'radiogroup',
|
101
|
+
fieldLabel:'Display title?',
|
102
|
+
name:'display_title',
|
103
|
+
columns:2,
|
104
|
+
items:[
|
105
|
+
{
|
106
|
+
boxLabel:'Yes',
|
107
|
+
name:'display_title',
|
108
|
+
inputValue: 'yes',
|
109
|
+
checked:record.data.display_title
|
110
|
+
},
|
111
|
+
{
|
112
|
+
boxLabel:'No',
|
113
|
+
name:'display_title',
|
114
|
+
inputValue:'no',
|
115
|
+
checked:!record.data.display_title
|
116
|
+
}]
|
117
|
+
},
|
118
|
+
{
|
119
|
+
xtype:'textfield',
|
120
|
+
fieldLabel:'Unique Name',
|
121
|
+
allowBlank:true,
|
122
|
+
name:'internal_identifier',
|
123
|
+
value: record.data.internal_identifier
|
124
|
+
},
|
125
|
+
addFormItems,
|
126
|
+
{
|
127
|
+
xtype: 'displayfield',
|
128
|
+
fieldLabel: 'Created At',
|
129
|
+
name: 'created_at',
|
130
|
+
value: record.data.created_at
|
131
|
+
},
|
132
|
+
{
|
133
|
+
xtype: 'displayfield',
|
134
|
+
fieldLabel: 'Updated At',
|
135
|
+
name: 'updated_at',
|
136
|
+
value: record.data.updated_at
|
137
|
+
}
|
138
|
+
]
|
139
|
+
},
|
140
|
+
buttons: [{
|
141
|
+
text:'Submit',
|
142
|
+
listeners:{
|
143
|
+
'click':function(button){
|
144
|
+
var window = button.findParentByType('window');
|
145
|
+
var formPanel = window.query('form')[0];
|
146
|
+
self.initialConfig['centerRegion'].setWindowStatus('Updating article...');
|
147
|
+
formPanel.getForm().submit({
|
148
|
+
reset:false,
|
149
|
+
success:function(form, action){
|
150
|
+
self.initialConfig['centerRegion'].clearWindowStatus();
|
151
|
+
var obj = Ext.decode(action.response.responseText);
|
152
|
+
if(obj.success){
|
153
|
+
self.getStore().load();
|
154
|
+
if(formPanel.getForm().findField('tag_list')){
|
155
|
+
var tag_list = formPanel.getForm().findField('tag_list').getValue();
|
156
|
+
record.set('tag_list', tag_list);
|
157
|
+
}
|
158
|
+
if(formPanel.getForm().findField('content_area')){
|
159
|
+
var content_area = formPanel.getForm().findField('content_area').getValue();
|
160
|
+
record.set('content_area', content_area);
|
161
|
+
}
|
162
|
+
if(formPanel.getForm().findField('position')){
|
163
|
+
var position = formPanel.getForm().findField('position').getValue();
|
164
|
+
record.set('position', position);
|
165
|
+
}
|
166
|
+
editArticleWindow.close();
|
167
|
+
}
|
168
|
+
else{
|
169
|
+
Ext.Msg.alert("Error", obj.msg);
|
170
|
+
}
|
171
|
+
},
|
172
|
+
failure:function(form, action){
|
173
|
+
self.initialConfig['centerRegion'].clearWindowStatus();
|
174
|
+
Ext.Msg.alert("Error", "Error updating article");
|
175
|
+
}
|
176
|
+
});
|
177
|
+
}
|
178
|
+
}
|
179
|
+
},{
|
180
|
+
text: 'Close',
|
181
|
+
handler: function(){
|
182
|
+
editArticleWindow.close();
|
183
|
+
}
|
184
|
+
}]
|
185
|
+
});
|
186
|
+
}
|
163
187
|
editArticleWindow.show();
|
164
188
|
},
|
165
189
|
|
@@ -185,39 +209,17 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.SectionArticlesGridPanel
|
|
185
209
|
},
|
186
210
|
remoteSort: true,
|
187
211
|
fields:[
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
},
|
200
|
-
{
|
201
|
-
name:'position'
|
202
|
-
},
|
203
|
-
{
|
204
|
-
name:'content_area'
|
205
|
-
},
|
206
|
-
{
|
207
|
-
name:'body_html'
|
208
|
-
},
|
209
|
-
{
|
210
|
-
name:'internal_identifier'
|
211
|
-
},
|
212
|
-
{
|
213
|
-
name:'display_title'
|
214
|
-
},
|
215
|
-
{
|
216
|
-
name:'created_at'
|
217
|
-
},
|
218
|
-
{
|
219
|
-
name:'updated_at'
|
220
|
-
}
|
212
|
+
{name:'id'},
|
213
|
+
{name:'title'},
|
214
|
+
{name:'tag_list'},
|
215
|
+
{name:'excerpt_html'},
|
216
|
+
{name:'position'},
|
217
|
+
{name:'content_area'},
|
218
|
+
{name:'body_html'},
|
219
|
+
{name:'internal_identifier'},
|
220
|
+
{name:'display_title'},
|
221
|
+
{name:'created_at'},
|
222
|
+
{name:'updated_at'}
|
221
223
|
]
|
222
224
|
});
|
223
225
|
|
@@ -242,6 +244,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.SectionArticlesGridPanel
|
|
242
244
|
width:40,
|
243
245
|
items:[{
|
244
246
|
icon:'/images/icons/edit/edit_16x16.png',
|
247
|
+
iconCls:'actioncolumn_hover',
|
245
248
|
tooltip:'Edit',
|
246
249
|
handler :function(grid, rowIndex, colIndex){
|
247
250
|
var rec = grid.getStore().getAt(rowIndex);
|
@@ -266,6 +269,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.SectionArticlesGridPanel
|
|
266
269
|
width:40,
|
267
270
|
items:[{
|
268
271
|
icon:'/images/icons/edit/edit_16x16.png',
|
272
|
+
iconCls:'actioncolumn_hover',
|
269
273
|
tooltip:'Edit Attributes',
|
270
274
|
handler :function(grid, rowIndex, colIndex){
|
271
275
|
var rec = grid.getStore().getAt(rowIndex);
|
@@ -291,6 +295,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.SectionArticlesGridPanel
|
|
291
295
|
width:40,
|
292
296
|
items:[{
|
293
297
|
icon:'/images/icons/delete/delete_16x16.png',
|
298
|
+
iconCls:'actioncolumn_hover',
|
294
299
|
tooltip:'Delete Article from Section',
|
295
300
|
handler :function(grid, rowIndex, colIndex){
|
296
301
|
var rec = grid.getStore().getAt(rowIndex);
|
@@ -431,8 +436,8 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.SectionArticlesGridPanel
|
|
431
436
|
var addExistingArticleWindow = new Ext.Window({
|
432
437
|
layout:'fit',
|
433
438
|
width:375,
|
434
|
-
title:'
|
435
|
-
height:
|
439
|
+
title:'Attach Existing Article',
|
440
|
+
height:130,
|
436
441
|
plain: true,
|
437
442
|
buttonAlign:'center',
|
438
443
|
items: new Ext.FormPanel({
|
@@ -442,14 +447,80 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.SectionArticlesGridPanel
|
|
442
447
|
width: 425,
|
443
448
|
url:'/knitkit/erp_app/desktop/articles/add_existing/' + self.initialConfig['sectionId'],
|
444
449
|
items:[
|
450
|
+
{
|
451
|
+
itemId: 'available_articles_filter_combobox',
|
452
|
+
xtype:'combo',
|
453
|
+
hiddenName:'website_id',
|
454
|
+
name:'website_id',
|
455
|
+
labelWidth: 50,
|
456
|
+
width:350,
|
457
|
+
loadingText:'Retrieving Websites...',
|
458
|
+
store:Ext.create('Ext.data.Store',{
|
459
|
+
autoLoad: true,
|
460
|
+
proxy:{
|
461
|
+
type:'ajax',
|
462
|
+
reader:{
|
463
|
+
type:'json',
|
464
|
+
root:'websites'
|
465
|
+
},
|
466
|
+
extraParams:{
|
467
|
+
section_id:self.initialConfig['sectionId']
|
468
|
+
},
|
469
|
+
url:'/knitkit/erp_app/desktop/section/available_articles_filter'
|
470
|
+
},
|
471
|
+
fields:[
|
472
|
+
{
|
473
|
+
name:'id'
|
474
|
+
},
|
475
|
+
{
|
476
|
+
name:'internal_identifier'
|
477
|
+
|
478
|
+
},
|
479
|
+
{
|
480
|
+
name:'name'
|
481
|
+
|
482
|
+
}],
|
483
|
+
listeners:{
|
484
|
+
'load':function(store){
|
485
|
+
available_articles_filter_combobox = Ext.ComponentQuery.query('#available_articles_filter_combobox')[0];
|
486
|
+
available_articles_filter_combobox.select(0);
|
487
|
+
//available_articles_filter_combobox.fireEvent('select');
|
488
|
+
},
|
489
|
+
}
|
490
|
+
}),
|
491
|
+
forceSelection:true,
|
492
|
+
fieldLabel:'Filter By',
|
493
|
+
queryMode: 'local',
|
494
|
+
autoSelect:true,
|
495
|
+
typeAhead: true,
|
496
|
+
displayField:'name',
|
497
|
+
valueField:'id',
|
498
|
+
triggerAction: 'all',
|
499
|
+
allowBlank:false,
|
500
|
+
listeners:{
|
501
|
+
'select':function(combo, records){
|
502
|
+
available_articles_combobox = Ext.ComponentQuery.query('#available_articles_combobox')[0];
|
503
|
+
available_articles_combobox.getPicker().setLoading(false);
|
504
|
+
available_articles_combobox.getStore().load({
|
505
|
+
params:{
|
506
|
+
section_id: self.initialConfig['sectionId'],
|
507
|
+
website_id: combo.getValue()
|
508
|
+
}
|
509
|
+
});
|
510
|
+
}
|
511
|
+
}
|
512
|
+
},
|
445
513
|
{
|
446
514
|
xtype:'combo',
|
515
|
+
itemId:'available_articles_combobox',
|
447
516
|
hiddenName:'article_id',
|
448
517
|
name:'article_id',
|
449
518
|
labelWidth: 50,
|
450
|
-
width:
|
519
|
+
width:350,
|
451
520
|
loadingText:'Retrieving Articles...',
|
452
521
|
store:Ext.create('Ext.data.Store',{
|
522
|
+
autoLoad: false,
|
523
|
+
remoteFilter: true,
|
453
524
|
proxy:{
|
454
525
|
type:'ajax',
|
455
526
|
reader:{
|
@@ -468,19 +539,34 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.SectionArticlesGridPanel
|
|
468
539
|
{
|
469
540
|
name:'internal_identifier'
|
470
541
|
|
542
|
+
},
|
543
|
+
{
|
544
|
+
name:'combobox_display_value'
|
545
|
+
}
|
546
|
+
],
|
547
|
+
listeners: {
|
548
|
+
'beforeload':function(store){
|
549
|
+
Ext.apply(store.getProxy().extraParams, {
|
550
|
+
website_id: Ext.ComponentQuery.query('#available_articles_filter_combobox')[0].getValue()
|
551
|
+
});
|
552
|
+
}
|
553
|
+
// ,
|
554
|
+
// 'load':function(store, records){
|
555
|
+
// available_articles_combobox = Ext.ComponentQuery.query('#available_articles_combobox')[0];
|
556
|
+
// available_articles_combobox.setValue(store.getAt(0).data.id);
|
557
|
+
// }
|
471
558
|
}
|
472
|
-
]
|
473
559
|
}),
|
560
|
+
queryMode: 'local',
|
474
561
|
forceSelection:true,
|
475
|
-
editable:true,
|
476
562
|
fieldLabel:'Article',
|
477
563
|
autoSelect:true,
|
478
564
|
typeAhead: true,
|
479
|
-
|
480
|
-
displayField:'internal_identifier',
|
565
|
+
displayField:'combobox_display_value',
|
481
566
|
valueField:'id',
|
482
567
|
triggerAction: 'all',
|
483
|
-
allowBlank:false
|
568
|
+
allowBlank:false,
|
569
|
+
loadMask: false
|
484
570
|
}
|
485
571
|
]
|
486
572
|
}),
|
@@ -490,7 +576,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.SectionArticlesGridPanel
|
|
490
576
|
'click':function(button){
|
491
577
|
var window = button.findParentByType('window');
|
492
578
|
var formPanel = window.query('form')[0];
|
493
|
-
self.initialConfig['centerRegion'].setWindowStatus('
|
579
|
+
self.initialConfig['centerRegion'].setWindowStatus('Attaching article...');
|
494
580
|
formPanel.getForm().submit({
|
495
581
|
reset:true,
|
496
582
|
success:function(form, action){
|
@@ -498,13 +584,14 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.SectionArticlesGridPanel
|
|
498
584
|
var obj = Ext.decode(action.response.responseText);
|
499
585
|
if(obj.success){
|
500
586
|
self.getStore().load();
|
587
|
+
window.close();
|
501
588
|
}else{
|
502
|
-
Ext.Msg.alert("Error", "Error
|
589
|
+
Ext.Msg.alert("Error", "Error Attaching article");
|
503
590
|
}
|
504
591
|
},
|
505
592
|
failure:function(form, action){
|
506
593
|
self.initialConfig['centerRegion'].clearWindowStatus();
|
507
|
-
Ext.Msg.alert("Error", "Error
|
594
|
+
Ext.Msg.alert("Error", "Error Attaching article");
|
508
595
|
}
|
509
596
|
});
|
510
597
|
}
|
@@ -577,20 +664,17 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.PageArticlesGridPanel",{
|
|
577
664
|
{
|
578
665
|
xtype:'hidden',
|
579
666
|
allowBlank:false,
|
580
|
-
name:'id'
|
581
|
-
id: 'record_id'
|
667
|
+
name:'id'
|
582
668
|
},
|
583
669
|
{
|
584
670
|
xtype:'textfield',
|
585
671
|
fieldLabel:'Content Area',
|
586
|
-
name:'content_area'
|
587
|
-
id: 'content_area'
|
672
|
+
name:'content_area'
|
588
673
|
},
|
589
674
|
{
|
590
675
|
xtype:'numberfield',
|
591
676
|
fieldLabel:'Position',
|
592
|
-
name:'position'
|
593
|
-
id: 'position'
|
677
|
+
name:'position'
|
594
678
|
}
|
595
679
|
]
|
596
680
|
}, config);
|
@@ -615,15 +699,13 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.BlogArticlesGridPanel",{
|
|
615
699
|
{
|
616
700
|
xtype:'hidden',
|
617
701
|
allowBlank:false,
|
618
|
-
name:'id'
|
619
|
-
id: 'record_id'
|
702
|
+
name:'id'
|
620
703
|
},
|
621
704
|
{
|
622
705
|
xtype:'textfield',
|
623
706
|
fieldLabel:'Tags',
|
624
707
|
allowBlank:true,
|
625
|
-
name:'tags'
|
626
|
-
id: 'tag_list'
|
708
|
+
name:'tags'
|
627
709
|
}
|
628
710
|
],
|
629
711
|
columns:[{
|