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
@@ -0,0 +1,71 @@
|
|
1
|
+
Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.WebsitesComboBox", {
|
2
|
+
extend: "Ext.form.field.ComboBox",
|
3
|
+
alias: 'widget.websitescombo',
|
4
|
+
initComponent: function () {
|
5
|
+
var self = this;
|
6
|
+
|
7
|
+
var websiteJsonStore = Ext.create('Ext.data.Store', {
|
8
|
+
timeout: 60000,
|
9
|
+
proxy: {
|
10
|
+
type: 'ajax',
|
11
|
+
url: '/knitkit/erp_app/desktop/site/index',
|
12
|
+
reader: {
|
13
|
+
type: 'json',
|
14
|
+
root: 'sites'
|
15
|
+
}
|
16
|
+
},
|
17
|
+
fields: [
|
18
|
+
'name',
|
19
|
+
'title',
|
20
|
+
'subtitle',
|
21
|
+
'id',
|
22
|
+
'url',
|
23
|
+
{name: 'configurationId', mapping: 'configuration_id'}
|
24
|
+
]
|
25
|
+
});
|
26
|
+
|
27
|
+
self.store = websiteJsonStore;
|
28
|
+
|
29
|
+
self.callParent(arguments);
|
30
|
+
|
31
|
+
websiteJsonStore.load({
|
32
|
+
callback: function (records, operation, succes) {
|
33
|
+
if (records.length > 0) {
|
34
|
+
self.select(records.first());
|
35
|
+
|
36
|
+
var knitkitWin = compassDesktop.getModule('knitkit-win');
|
37
|
+
|
38
|
+
knitkitWin.selectWebsite(records.first());
|
39
|
+
}
|
40
|
+
}
|
41
|
+
});
|
42
|
+
},
|
43
|
+
|
44
|
+
constructor: function (config) {
|
45
|
+
config = Ext.apply({
|
46
|
+
id: 'websiteCombo',
|
47
|
+
emptyText: 'No Websites',
|
48
|
+
fieldStyle: {
|
49
|
+
borderRadius: '0px !important'
|
50
|
+
},
|
51
|
+
valueField: 'id',
|
52
|
+
displayField: 'name',
|
53
|
+
triggerAction: 'all',
|
54
|
+
editable: false,
|
55
|
+
forceSelection: true,
|
56
|
+
queryMode: 'local',
|
57
|
+
listeners: {
|
58
|
+
'select': function (combo, records) {
|
59
|
+
var knitkitModule = compassDesktop.getModule('knitkit-win');
|
60
|
+
|
61
|
+
knitkitModule.selectWebsite(records.first());
|
62
|
+
},
|
63
|
+
render: function (combo) {
|
64
|
+
combo.getStore().load();
|
65
|
+
}
|
66
|
+
}
|
67
|
+
}, config);
|
68
|
+
|
69
|
+
this.callParent([config]);
|
70
|
+
}
|
71
|
+
});
|
@@ -1,28 +1,29 @@
|
|
1
1
|
Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.VersionsGridPanel", {
|
2
|
-
extend:"Ext.grid.Panel",
|
3
|
-
initComponent:function () {
|
2
|
+
extend: "Ext.grid.Panel",
|
3
|
+
initComponent: function () {
|
4
4
|
this.callParent(arguments);
|
5
5
|
this.getStore().load();
|
6
6
|
},
|
7
7
|
|
8
|
-
constructor:function (config) {
|
8
|
+
constructor: function (config) {
|
9
9
|
var overiddenColumns = [
|
10
10
|
{
|
11
|
-
header:'Version',
|
12
|
-
dataIndex:'version',
|
13
|
-
sortable:true,
|
14
|
-
width:
|
11
|
+
header: 'Version',
|
12
|
+
dataIndex: 'version',
|
13
|
+
sortable: true,
|
14
|
+
width: 75
|
15
15
|
},
|
16
16
|
{
|
17
|
-
header:'Timestamp',
|
18
|
-
dataIndex:'updated_at',
|
19
|
-
sortable:true,
|
20
|
-
renderer:Ext.util.Format.dateRenderer('m/d/Y H:i:s'),
|
21
|
-
|
17
|
+
header: 'Timestamp',
|
18
|
+
dataIndex: 'updated_at',
|
19
|
+
sortable: true,
|
20
|
+
renderer: Ext.util.Format.dateRenderer('m/d/Y H:i:s'),
|
21
|
+
flex: 1
|
22
22
|
},
|
23
23
|
{
|
24
|
-
header:'Published By',
|
25
|
-
dataIndex:'publisher'
|
24
|
+
header: 'Published By',
|
25
|
+
dataIndex: 'publisher',
|
26
|
+
flex: 1
|
26
27
|
}
|
27
28
|
];
|
28
29
|
|
@@ -32,60 +33,67 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.VersionsGridPanel", {
|
|
32
33
|
|
33
34
|
overiddenColumns = overiddenColumns.concat([
|
34
35
|
{
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
36
|
+
header: 'Active',
|
37
|
+
dataIndex: 'active',
|
38
|
+
sortable: true,
|
39
|
+
align: 'center',
|
40
|
+
flex: 0.5,
|
41
|
+
renderer: function () {
|
42
|
+
var rec = arguments[2];
|
43
|
+
if (rec.get('active')) {
|
44
|
+
return '<img class="x-action-col-0 active-col" ext:qtip="Active" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" alt="">';
|
45
|
+
}
|
46
|
+
else {
|
47
|
+
return '<img class="x-action-col-0 activate-col" ext:qtip="Not Active" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" alt="">';
|
48
|
+
}
|
49
|
+
}
|
50
|
+
},
|
51
|
+
{
|
52
|
+
menuDisabled: true,
|
53
|
+
resizable: false,
|
54
|
+
xtype: 'actioncolumn',
|
55
|
+
header: 'Action',
|
56
|
+
align: 'center',
|
57
|
+
flex: 0.5,
|
58
|
+
items: [
|
42
59
|
{
|
43
|
-
icon:'/images/icons/
|
44
|
-
tooltip:'View',
|
45
|
-
|
60
|
+
icon: '/images/icons/eye/eye_16x16.png',
|
61
|
+
tooltip: 'View',
|
62
|
+
getClass: function (v, meta, rec) {
|
63
|
+
return 'x-action-col-icon';
|
64
|
+
},
|
65
|
+
handler: function (grid, rowIndex, colIndex) {
|
46
66
|
var rec = grid.getStore().getAt(rowIndex);
|
47
67
|
grid.ownerCt.viewVersionedContent(rec);
|
48
68
|
}
|
49
|
-
}
|
50
|
-
]
|
51
|
-
},
|
52
|
-
{
|
53
|
-
menuDisabled:true,
|
54
|
-
resizable:false,
|
55
|
-
xtype:'actioncolumn',
|
56
|
-
header:'Revert',
|
57
|
-
align:'center',
|
58
|
-
width:60,
|
59
|
-
items:[
|
69
|
+
},
|
60
70
|
{
|
61
|
-
icon:'/images/icons/document_down/document_down_16x16.png',
|
62
|
-
tooltip:'Revert',
|
63
|
-
|
71
|
+
icon: '/images/icons/document_down/document_down_16x16.png',
|
72
|
+
tooltip: 'Revert',
|
73
|
+
getClass: function (v, meta, rec) {
|
74
|
+
return 'x-action-col-icon';
|
75
|
+
},
|
76
|
+
handler: function (grid, rowIndex, colIndex) {
|
64
77
|
var rec = grid.getStore().getAt(rowIndex);
|
65
78
|
grid.ownerCt.revert(rec);
|
66
79
|
}
|
67
|
-
}
|
68
|
-
]
|
69
|
-
},
|
70
|
-
{
|
71
|
-
menuDisabled:true,
|
72
|
-
resizable:false,
|
73
|
-
xtype:'actioncolumn',
|
74
|
-
header:'Published',
|
75
|
-
align:'center',
|
76
|
-
width:60,
|
77
|
-
items:[
|
80
|
+
},
|
78
81
|
{
|
79
|
-
|
82
|
+
getTip: function (value, meta, rec) {
|
83
|
+
if (rec.get('published')) {
|
84
|
+
return 'Published';
|
85
|
+
} else {
|
86
|
+
return 'Publish';
|
87
|
+
}
|
88
|
+
},
|
89
|
+
getClass: function (v, meta, rec) { // Or return a class from a function
|
80
90
|
if (rec.get('published')) {
|
81
|
-
|
82
|
-
return 'published-col';
|
91
|
+
return 'published-col x-action-col-icon';
|
83
92
|
} else {
|
84
|
-
|
85
|
-
return 'publish-col';
|
93
|
+
return 'publish-col x-action-col-icon';
|
86
94
|
}
|
87
95
|
},
|
88
|
-
handler:function (grid, rowIndex, colIndex) {
|
96
|
+
handler: function (grid, rowIndex, colIndex) {
|
89
97
|
var rec = grid.getStore().getAt(rowIndex);
|
90
98
|
if (rec.get('published')) {
|
91
99
|
return false;
|
@@ -97,35 +105,19 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.VersionsGridPanel", {
|
|
97
105
|
}
|
98
106
|
}
|
99
107
|
]
|
100
|
-
},
|
101
|
-
{
|
102
|
-
header:'Active',
|
103
|
-
dataIndex:'active',
|
104
|
-
sortable:true,
|
105
|
-
align:'center',
|
106
|
-
width:60,
|
107
|
-
renderer:function () {
|
108
|
-
var rec = arguments[2];
|
109
|
-
if (rec.get('active')) {
|
110
|
-
return '<img class="x-action-col-0 active-col" ext:qtip="Active" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" alt="">';
|
111
|
-
}
|
112
|
-
else {
|
113
|
-
return '<img class="x-action-col-0 activate-col" ext:qtip="Not Active" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" alt="">';
|
114
|
-
}
|
115
|
-
}
|
116
108
|
}
|
117
109
|
]);
|
118
110
|
|
119
111
|
config['columns'] = overiddenColumns;
|
120
112
|
config = Ext.apply({
|
121
|
-
collapsed:true,
|
122
|
-
bbar:Ext.create("Ext.PagingToolbar", {
|
123
|
-
pageSize:15,
|
113
|
+
collapsed: true,
|
114
|
+
bbar: Ext.create("Ext.PagingToolbar", {
|
115
|
+
pageSize: 15,
|
124
116
|
title: 'Version History',
|
125
|
-
store:config['store'],
|
126
|
-
displayInfo:true,
|
127
|
-
displayMsg:'{0} - {1} of {2}',
|
128
|
-
emptyMsg:"Empty"
|
117
|
+
store: config['store'],
|
118
|
+
displayInfo: true,
|
119
|
+
displayMsg: '{0} - {1} of {2}',
|
120
|
+
emptyMsg: "Empty"
|
129
121
|
})
|
130
122
|
}, config);
|
131
123
|
|
@@ -134,25 +126,26 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.VersionsGridPanel", {
|
|
134
126
|
});
|
135
127
|
|
136
128
|
Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.VersionsArticleGridPanel", {
|
137
|
-
extend:"Compass.ErpApp.Desktop.Applications.Knitkit.VersionsGridPanel",
|
138
|
-
alias:'widget.knitkit_versionsarticlegridpanel',
|
139
|
-
|
129
|
+
extend: "Compass.ErpApp.Desktop.Applications.Knitkit.VersionsGridPanel",
|
130
|
+
alias: 'widget.knitkit_versionsarticlegridpanel',
|
131
|
+
collapsed: true,
|
132
|
+
viewVersionedContent: function (rec) {
|
140
133
|
this.initialConfig['centerRegion'].viewContent(rec.get('title') + " - Revision " + rec.get('version'), rec.get('body_html'));
|
141
134
|
},
|
142
135
|
|
143
|
-
revert:function (rec) {
|
144
|
-
if (currentUser.hasCapability('revert_version','Content')) {
|
136
|
+
revert: function (rec) {
|
137
|
+
if (currentUser.hasCapability('revert_version', 'Content')) {
|
145
138
|
var self = this;
|
146
139
|
self.initialConfig['centerRegion'].setWindowStatus('Reverting...');
|
147
140
|
|
148
141
|
Ext.Ajax.request({
|
149
|
-
url:'/knitkit/erp_app/desktop/versions/revert_content',
|
150
|
-
method:'POST',
|
151
|
-
params:{
|
152
|
-
id:rec.get('id'),
|
153
|
-
version:rec.get('version')
|
142
|
+
url: '/knitkit/erp_app/desktop/versions/revert_content',
|
143
|
+
method: 'POST',
|
144
|
+
params: {
|
145
|
+
id: rec.get('id'),
|
146
|
+
version: rec.get('version')
|
154
147
|
},
|
155
|
-
success:function (response) {
|
148
|
+
success: function (response) {
|
156
149
|
self.initialConfig['centerRegion'].clearWindowStatus();
|
157
150
|
var obj = Ext.decode(response.responseText);
|
158
151
|
if (obj.success) {
|
@@ -163,7 +156,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.VersionsArticleGridPanel
|
|
163
156
|
Ext.Msg.alert('Error', 'Error reverting');
|
164
157
|
}
|
165
158
|
},
|
166
|
-
failure:function (response) {
|
159
|
+
failure: function (response) {
|
167
160
|
self.initialConfig['centerRegion'].clearWindowStatus();
|
168
161
|
Ext.Msg.alert('Error', 'Error reverting');
|
169
162
|
}
|
@@ -174,19 +167,19 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.VersionsArticleGridPanel
|
|
174
167
|
}
|
175
168
|
},
|
176
169
|
|
177
|
-
publish:function (rec) {
|
178
|
-
if (currentUser.hasCapability('publish','Content')) {
|
170
|
+
publish: function (rec) {
|
171
|
+
if (currentUser.hasCapability('publish', 'Content')) {
|
179
172
|
var self = this;
|
180
173
|
|
181
|
-
var publishWindow = Ext.create('Compass.ErpApp.Desktop.Applications.Knitkit.PublishWindow',{
|
182
|
-
baseParams:{
|
183
|
-
id:rec.get('id'),
|
184
|
-
site_id:self.initialConfig.siteId,
|
185
|
-
version:rec.get('version')
|
174
|
+
var publishWindow = Ext.create('Compass.ErpApp.Desktop.Applications.Knitkit.PublishWindow', {
|
175
|
+
baseParams: {
|
176
|
+
id: rec.get('id'),
|
177
|
+
site_id: self.initialConfig.siteId,
|
178
|
+
version: rec.get('version')
|
186
179
|
},
|
187
|
-
url:'/knitkit/erp_app/desktop/versions/publish_content',
|
188
|
-
listeners:{
|
189
|
-
'publish_success':function (window, response) {
|
180
|
+
url: '/knitkit/erp_app/desktop/versions/publish_content',
|
181
|
+
listeners: {
|
182
|
+
'publish_success': function (window, response) {
|
190
183
|
if (response.success) {
|
191
184
|
self.initialConfig['centerRegion'].clearWindowStatus();
|
192
185
|
self.getStore().load();
|
@@ -196,7 +189,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.VersionsArticleGridPanel
|
|
196
189
|
self.initialConfig['centerRegion'].clearWindowStatus();
|
197
190
|
}
|
198
191
|
},
|
199
|
-
'publish_failure':function (window, response) {
|
192
|
+
'publish_failure': function (window, response) {
|
200
193
|
self.initialConfig['centerRegion'].clearWindowStatus();
|
201
194
|
Ext.Msg.alert('Error', 'Error publishing');
|
202
195
|
}
|
@@ -209,52 +202,52 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.VersionsArticleGridPanel
|
|
209
202
|
}
|
210
203
|
},
|
211
204
|
|
212
|
-
constructor:function (config) {
|
205
|
+
constructor: function (config) {
|
213
206
|
config = Ext.apply({
|
214
207
|
title: 'Version History',
|
215
|
-
store:Ext.create("Ext.data.Store", {
|
216
|
-
proxy:{
|
217
|
-
type:'ajax',
|
218
|
-
url:'/knitkit/erp_app/desktop/versions/content_versions',
|
219
|
-
reader:{
|
220
|
-
type:'json',
|
221
|
-
root:'data'
|
208
|
+
store: Ext.create("Ext.data.Store", {
|
209
|
+
proxy: {
|
210
|
+
type: 'ajax',
|
211
|
+
url: '/knitkit/erp_app/desktop/versions/content_versions',
|
212
|
+
reader: {
|
213
|
+
type: 'json',
|
214
|
+
root: 'data'
|
222
215
|
},
|
223
|
-
extraParams:{
|
224
|
-
id:config['contentId'],
|
225
|
-
site_id:config['siteId']
|
216
|
+
extraParams: {
|
217
|
+
id: config['contentId'],
|
218
|
+
site_id: config['siteId']
|
226
219
|
}
|
227
220
|
},
|
228
|
-
idProperty:'id',
|
229
|
-
remoteSort:true,
|
230
|
-
fields:[
|
221
|
+
idProperty: 'id',
|
222
|
+
remoteSort: true,
|
223
|
+
fields: [
|
231
224
|
{
|
232
|
-
name:'published'
|
225
|
+
name: 'published'
|
233
226
|
},
|
234
227
|
{
|
235
|
-
name:'id'
|
228
|
+
name: 'id'
|
236
229
|
},
|
237
230
|
{
|
238
|
-
name:'version'
|
231
|
+
name: 'version'
|
239
232
|
},
|
240
233
|
{
|
241
|
-
name:'title'
|
234
|
+
name: 'title'
|
242
235
|
},
|
243
236
|
{
|
244
|
-
name:'excerpt_html'
|
237
|
+
name: 'excerpt_html'
|
245
238
|
},
|
246
239
|
{
|
247
|
-
name:'body_html'
|
240
|
+
name: 'body_html'
|
248
241
|
},
|
249
242
|
{
|
250
|
-
name:'active'
|
243
|
+
name: 'active'
|
251
244
|
},
|
252
245
|
{
|
253
|
-
name:'updated_at',
|
254
|
-
type:'date'
|
246
|
+
name: 'updated_at',
|
247
|
+
type: 'date'
|
255
248
|
},
|
256
249
|
{
|
257
|
-
name:'publisher'
|
250
|
+
name: 'publisher'
|
258
251
|
}
|
259
252
|
]
|
260
253
|
})
|
@@ -265,25 +258,25 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.VersionsArticleGridPanel
|
|
265
258
|
});
|
266
259
|
|
267
260
|
Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.VersionsBlogGridPanel", {
|
268
|
-
extend:"Compass.ErpApp.Desktop.Applications.Knitkit.VersionsGridPanel",
|
269
|
-
alias:'widget.knitkit_versionsbloggridpanel',
|
261
|
+
extend: "Compass.ErpApp.Desktop.Applications.Knitkit.VersionsGridPanel",
|
262
|
+
alias: 'widget.knitkit_versionsbloggridpanel',
|
270
263
|
|
271
|
-
viewVersionedContent:function (rec) {
|
264
|
+
viewVersionedContent: function (rec) {
|
272
265
|
this.initialConfig['centerRegion'].viewContent(rec.get('title') + " - Revision " + rec.get('version'), rec.get('body_html'));
|
273
266
|
},
|
274
267
|
|
275
|
-
revert:function (rec) {
|
276
|
-
if (currentUser.hasCapability('revert_version','Content')) {
|
268
|
+
revert: function (rec) {
|
269
|
+
if (currentUser.hasCapability('revert_version', 'Content')) {
|
277
270
|
var self = this;
|
278
271
|
self.initialConfig['centerRegion'].setWindowStatus('Reverting...');
|
279
272
|
Ext.Ajax.request({
|
280
|
-
url:'/knitkit/erp_app/desktop/versions/revert_content',
|
281
|
-
method:'POST',
|
282
|
-
params:{
|
283
|
-
id:rec.get('id'),
|
284
|
-
version:rec.get('version')
|
273
|
+
url: '/knitkit/erp_app/desktop/versions/revert_content',
|
274
|
+
method: 'POST',
|
275
|
+
params: {
|
276
|
+
id: rec.get('id'),
|
277
|
+
version: rec.get('version')
|
285
278
|
},
|
286
|
-
success:function (response) {
|
279
|
+
success: function (response) {
|
287
280
|
self.initialConfig['centerRegion'].clearWindowStatus();
|
288
281
|
var obj = Ext.decode(response.responseText);
|
289
282
|
if (obj.success) {
|
@@ -294,7 +287,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.VersionsBlogGridPanel",
|
|
294
287
|
Ext.Msg.alert('Error', 'Error reverting');
|
295
288
|
}
|
296
289
|
},
|
297
|
-
failure:function (response) {
|
290
|
+
failure: function (response) {
|
298
291
|
self.initialConfig['centerRegion'].clearWindowStatus();
|
299
292
|
Ext.Msg.alert('Error', 'Error reverting');
|
300
293
|
}
|
@@ -302,18 +295,18 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.VersionsBlogGridPanel",
|
|
302
295
|
}
|
303
296
|
},
|
304
297
|
|
305
|
-
publish:function (rec) {
|
298
|
+
publish: function (rec) {
|
306
299
|
var self = this;
|
307
300
|
|
308
|
-
var publishWindow = Ext.create('Compass.ErpApp.Desktop.Applications.Knitkit.PublishWindow',{
|
309
|
-
baseParams:{
|
310
|
-
id:rec.get('id'),
|
311
|
-
site_id:self.initialConfig.siteId,
|
312
|
-
version:rec.get('version')
|
301
|
+
var publishWindow = Ext.create('Compass.ErpApp.Desktop.Applications.Knitkit.PublishWindow', {
|
302
|
+
baseParams: {
|
303
|
+
id: rec.get('id'),
|
304
|
+
site_id: self.initialConfig.siteId,
|
305
|
+
version: rec.get('version')
|
313
306
|
},
|
314
|
-
url:'/knitkit/erp_app/desktop/versions/publish_content',
|
315
|
-
listeners:{
|
316
|
-
'publish_success':function (window, response) {
|
307
|
+
url: '/knitkit/erp_app/desktop/versions/publish_content',
|
308
|
+
listeners: {
|
309
|
+
'publish_success': function (window, response) {
|
317
310
|
if (response.success) {
|
318
311
|
self.initialConfig['centerRegion'].clearWindowStatus();
|
319
312
|
self.getStore().load();
|
@@ -323,7 +316,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.VersionsBlogGridPanel",
|
|
323
316
|
self.initialConfig['centerRegion'].clearWindowStatus();
|
324
317
|
}
|
325
318
|
},
|
326
|
-
'publish_failure':function (window, response) {
|
319
|
+
'publish_failure': function (window, response) {
|
327
320
|
self.initialConfig['centerRegion'].clearWindowStatus();
|
328
321
|
Ext.Msg.alert('Error', 'Error publishing');
|
329
322
|
}
|
@@ -333,68 +326,71 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.VersionsBlogGridPanel",
|
|
333
326
|
publishWindow.show();
|
334
327
|
},
|
335
328
|
|
336
|
-
constructor:function (config) {
|
329
|
+
constructor: function (config) {
|
337
330
|
config = Ext.apply({
|
338
331
|
title: 'Version History',
|
339
|
-
store:Ext.create("Ext.data.Store", {
|
340
|
-
proxy:{
|
341
|
-
type:'ajax',
|
342
|
-
url:'/knitkit/erp_app/desktop/versions/content_versions',
|
343
|
-
reader:{
|
344
|
-
type:'json',
|
345
|
-
root:'data'
|
332
|
+
store: Ext.create("Ext.data.Store", {
|
333
|
+
proxy: {
|
334
|
+
type: 'ajax',
|
335
|
+
url: '/knitkit/erp_app/desktop/versions/content_versions',
|
336
|
+
reader: {
|
337
|
+
type: 'json',
|
338
|
+
root: 'data'
|
346
339
|
},
|
347
|
-
extraParams:{
|
348
|
-
id:config['contentId'],
|
349
|
-
site_id:config['siteId']
|
340
|
+
extraParams: {
|
341
|
+
id: config['contentId'],
|
342
|
+
site_id: config['siteId']
|
350
343
|
}
|
351
344
|
},
|
352
|
-
idProperty:'id',
|
353
|
-
remoteSort:true,
|
354
|
-
fields:[
|
345
|
+
idProperty: 'id',
|
346
|
+
remoteSort: true,
|
347
|
+
fields: [
|
355
348
|
{
|
356
|
-
name:'id'
|
349
|
+
name: 'id'
|
357
350
|
},
|
358
351
|
{
|
359
|
-
name:'version'
|
352
|
+
name: 'version'
|
360
353
|
},
|
361
354
|
{
|
362
|
-
name:'title'
|
355
|
+
name: 'title'
|
363
356
|
},
|
364
357
|
{
|
365
|
-
name:'excerpt_html'
|
358
|
+
name: 'excerpt_html'
|
366
359
|
},
|
367
360
|
{
|
368
|
-
name:'body_html'
|
361
|
+
name: 'body_html'
|
369
362
|
},
|
370
363
|
{
|
371
|
-
name:'active'
|
364
|
+
name: 'active'
|
372
365
|
},
|
373
366
|
{
|
374
|
-
name:'updated_at',
|
375
|
-
type:'date'
|
367
|
+
name: 'updated_at',
|
368
|
+
type: 'date'
|
376
369
|
},
|
377
370
|
{
|
378
|
-
name:'published'
|
371
|
+
name: 'published'
|
379
372
|
},
|
380
373
|
{
|
381
|
-
name:'publisher'
|
374
|
+
name: 'publisher'
|
382
375
|
}
|
383
376
|
]
|
384
377
|
}),
|
385
|
-
columns:[
|
378
|
+
columns: [
|
386
379
|
{
|
387
|
-
menuDisabled:true,
|
388
|
-
resizable:false,
|
389
|
-
xtype:'actioncolumn',
|
390
|
-
header:'
|
391
|
-
align:'center',
|
392
|
-
width:50,
|
393
|
-
items:[
|
380
|
+
menuDisabled: true,
|
381
|
+
resizable: false,
|
382
|
+
xtype: 'actioncolumn',
|
383
|
+
header: 'Action',
|
384
|
+
align: 'center',
|
385
|
+
width: 50,
|
386
|
+
items: [
|
394
387
|
{
|
395
|
-
icon:'/images/icons/document_view/document_view_16x16.png',
|
396
|
-
tooltip:'View',
|
397
|
-
|
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) {
|
398
394
|
var rec = grid.getStore().getAt(rowIndex);
|
399
395
|
grid.initialConfig['centerRegion'].viewContent(rec.get('title') + " Excerpt - Revision " + rec.get('version'), rec.get('body_html'));
|
400
396
|
}
|
@@ -409,43 +405,43 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.VersionsBlogGridPanel",
|
|
409
405
|
});
|
410
406
|
|
411
407
|
Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.VersionsWebsiteSectionGridPanel", {
|
412
|
-
extend:"Compass.ErpApp.Desktop.Applications.Knitkit.VersionsGridPanel",
|
413
|
-
alias:'widget.knitkit_versionswebsitesectiongridpanel',
|
408
|
+
extend: "Compass.ErpApp.Desktop.Applications.Knitkit.VersionsGridPanel",
|
409
|
+
alias: 'widget.knitkit_versionswebsitesectiongridpanel',
|
414
410
|
|
415
|
-
viewVersionedContent:function (rec) {
|
411
|
+
viewVersionedContent: function (rec) {
|
416
412
|
this.initialConfig['centerRegion'].setWindowStatus('Loading template...');
|
417
413
|
var self = this;
|
418
414
|
Ext.Ajax.request({
|
419
|
-
url:'/knitkit/erp_app/desktop/versions/get_website_section_version',
|
420
|
-
method:'POST',
|
421
|
-
params:{
|
422
|
-
id:rec.get('id'),
|
423
|
-
version:rec.get('version')
|
415
|
+
url: '/knitkit/erp_app/desktop/versions/get_website_section_version',
|
416
|
+
method: 'POST',
|
417
|
+
params: {
|
418
|
+
id: rec.get('id'),
|
419
|
+
version: rec.get('version')
|
424
420
|
},
|
425
|
-
success:function (response) {
|
421
|
+
success: function (response) {
|
426
422
|
self.initialConfig['centerRegion'].clearWindowStatus();
|
427
423
|
var template = response.responseText;
|
428
424
|
self.initialConfig['centerRegion'].viewSectionLayout(rec.get('title'), template);
|
429
425
|
},
|
430
|
-
failure:function (response) {
|
426
|
+
failure: function (response) {
|
431
427
|
self.initialConfig['centerRegion'].clearWindowStatus();
|
432
428
|
Ext.Msg.alert('Error', 'Error loading tempalte');
|
433
429
|
}
|
434
430
|
});
|
435
431
|
},
|
436
432
|
|
437
|
-
revert:function (rec) {
|
438
|
-
if (currentUser.hasCapability('revert_version','Content')) {
|
433
|
+
revert: function (rec) {
|
434
|
+
if (currentUser.hasCapability('revert_version', 'Content')) {
|
439
435
|
var self = this;
|
440
436
|
self.initialConfig['centerRegion'].setWindowStatus('Reverting...');
|
441
437
|
Ext.Ajax.request({
|
442
|
-
url:'/knitkit/erp_app/desktop/versions/revert_website_section',
|
443
|
-
method:'POST',
|
444
|
-
params:{
|
445
|
-
id:rec.get('id'),
|
446
|
-
version:rec.get('version')
|
438
|
+
url: '/knitkit/erp_app/desktop/versions/revert_website_section',
|
439
|
+
method: 'POST',
|
440
|
+
params: {
|
441
|
+
id: rec.get('id'),
|
442
|
+
version: rec.get('version')
|
447
443
|
},
|
448
|
-
success:function (response) {
|
444
|
+
success: function (response) {
|
449
445
|
self.initialConfig['centerRegion'].clearWindowStatus();
|
450
446
|
var obj = Ext.decode(response.responseText);
|
451
447
|
if (obj.success) {
|
@@ -456,7 +452,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.VersionsWebsiteSectionGr
|
|
456
452
|
Ext.Msg.alert('Error', 'Error reverting');
|
457
453
|
}
|
458
454
|
},
|
459
|
-
failure:function (response) {
|
455
|
+
failure: function (response) {
|
460
456
|
self.initialConfig['centerRegion'].clearWindowStatus();
|
461
457
|
Ext.Msg.alert('Error', 'Error reverting');
|
462
458
|
}
|
@@ -464,18 +460,18 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.VersionsWebsiteSectionGr
|
|
464
460
|
}
|
465
461
|
},
|
466
462
|
|
467
|
-
publish:function (rec) {
|
463
|
+
publish: function (rec) {
|
468
464
|
var self = this;
|
469
465
|
|
470
|
-
var publishWindow = Ext.create('Compass.ErpApp.Desktop.Applications.Knitkit.PublishWindow',{
|
471
|
-
baseParams:{
|
472
|
-
id:rec.get('id'),
|
473
|
-
site_id:self.initialConfig.siteId,
|
474
|
-
version:rec.get('version')
|
466
|
+
var publishWindow = Ext.create('Compass.ErpApp.Desktop.Applications.Knitkit.PublishWindow', {
|
467
|
+
baseParams: {
|
468
|
+
id: rec.get('id'),
|
469
|
+
site_id: self.initialConfig.siteId,
|
470
|
+
version: rec.get('version')
|
475
471
|
},
|
476
|
-
url:'/knitkit/erp_app/desktop/versions/publish_website_section',
|
477
|
-
listeners:{
|
478
|
-
'publish_success':function (window, response) {
|
472
|
+
url: '/knitkit/erp_app/desktop/versions/publish_website_section',
|
473
|
+
listeners: {
|
474
|
+
'publish_success': function (window, response) {
|
479
475
|
if (response.success) {
|
480
476
|
self.initialConfig['centerRegion'].clearWindowStatus();
|
481
477
|
self.getStore().load();
|
@@ -485,7 +481,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.VersionsWebsiteSectionGr
|
|
485
481
|
self.initialConfig['centerRegion'].clearWindowStatus();
|
486
482
|
}
|
487
483
|
},
|
488
|
-
'publish_failure':function (window, response) {
|
484
|
+
'publish_failure': function (window, response) {
|
489
485
|
self.initialConfig['centerRegion'].clearWindowStatus();
|
490
486
|
Ext.Msg.alert('Error', 'Error publishing');
|
491
487
|
}
|
@@ -495,46 +491,46 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.VersionsWebsiteSectionGr
|
|
495
491
|
publishWindow.show();
|
496
492
|
},
|
497
493
|
|
498
|
-
constructor:function (config) {
|
494
|
+
constructor: function (config) {
|
499
495
|
config = Ext.apply({
|
500
496
|
title: 'Version History',
|
501
|
-
store:Ext.create("Ext.data.Store", {
|
502
|
-
proxy:{
|
503
|
-
type:'ajax',
|
504
|
-
url:'/knitkit/erp_app/desktop/versions/website_section_layout_versions',
|
505
|
-
reader:{
|
506
|
-
type:'json',
|
507
|
-
root:'data'
|
497
|
+
store: Ext.create("Ext.data.Store", {
|
498
|
+
proxy: {
|
499
|
+
type: 'ajax',
|
500
|
+
url: '/knitkit/erp_app/desktop/versions/website_section_layout_versions',
|
501
|
+
reader: {
|
502
|
+
type: 'json',
|
503
|
+
root: 'data'
|
508
504
|
},
|
509
|
-
extraParams:{
|
510
|
-
id:config['websiteSectionId'],
|
511
|
-
site_id:config['siteId']
|
505
|
+
extraParams: {
|
506
|
+
id: config['websiteSectionId'],
|
507
|
+
site_id: config['siteId']
|
512
508
|
}
|
513
509
|
},
|
514
|
-
idProperty:'id',
|
515
|
-
remoteSort:true,
|
516
|
-
fields:[
|
510
|
+
idProperty: 'id',
|
511
|
+
remoteSort: true,
|
512
|
+
fields: [
|
517
513
|
{
|
518
|
-
name:'id'
|
514
|
+
name: 'id'
|
519
515
|
},
|
520
516
|
{
|
521
|
-
name:'version'
|
517
|
+
name: 'version'
|
522
518
|
},
|
523
519
|
{
|
524
|
-
name:'title'
|
520
|
+
name: 'title'
|
525
521
|
},
|
526
522
|
{
|
527
|
-
name:'updated_at',
|
528
|
-
type:'date'
|
523
|
+
name: 'updated_at',
|
524
|
+
type: 'date'
|
529
525
|
},
|
530
526
|
{
|
531
|
-
name:'active'
|
527
|
+
name: 'active'
|
532
528
|
},
|
533
529
|
{
|
534
|
-
name:'published'
|
530
|
+
name: 'published'
|
535
531
|
},
|
536
532
|
{
|
537
|
-
name:'publisher'
|
533
|
+
name: 'publisher'
|
538
534
|
}
|
539
535
|
]
|
540
536
|
})
|
@@ -545,24 +541,24 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.VersionsWebsiteSectionGr
|
|
545
541
|
});
|
546
542
|
|
547
543
|
Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.NonPublishedVersionsGridPanel", {
|
548
|
-
extend:"Ext.grid.Panel",
|
549
|
-
alias:'widget.knitkit_nonpublishedversionswebsitesectiongridpanel',
|
550
|
-
viewVersionedContent:function (rec) {
|
544
|
+
extend: "Ext.grid.Panel",
|
545
|
+
alias: 'widget.knitkit_nonpublishedversionswebsitesectiongridpanel',
|
546
|
+
viewVersionedContent: function (rec) {
|
551
547
|
this.initialConfig['centerRegion'].viewContent(rec.get('title') + " - Revision " + rec.get('version'), rec.get('body_html'));
|
552
548
|
},
|
553
549
|
|
554
|
-
revert:function (rec) {
|
555
|
-
if (currentUser.hasCapability('revert_version','Content')) {
|
550
|
+
revert: function (rec) {
|
551
|
+
if (currentUser.hasCapability('revert_version', 'Content')) {
|
556
552
|
var self = this;
|
557
553
|
self.initialConfig['centerRegion'].setWindowStatus('Reverting...');
|
558
554
|
Ext.Ajax.request({
|
559
|
-
url:'/knitkit/erp_app/desktop/versions/revert_content',
|
560
|
-
method:'POST',
|
561
|
-
params:{
|
562
|
-
id:rec.get('id'),
|
563
|
-
version:rec.get('version')
|
555
|
+
url: '/knitkit/erp_app/desktop/versions/revert_content',
|
556
|
+
method: 'POST',
|
557
|
+
params: {
|
558
|
+
id: rec.get('id'),
|
559
|
+
version: rec.get('version')
|
564
560
|
},
|
565
|
-
success:function (response) {
|
561
|
+
success: function (response) {
|
566
562
|
self.initialConfig['centerRegion'].clearWindowStatus();
|
567
563
|
var obj = Ext.decode(response.responseText);
|
568
564
|
if (obj.success) {
|
@@ -573,7 +569,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.NonPublishedVersionsGrid
|
|
573
569
|
Ext.Msg.alert('Error', 'Error reverting');
|
574
570
|
}
|
575
571
|
},
|
576
|
-
failure:function (response) {
|
572
|
+
failure: function (response) {
|
577
573
|
self.initialConfig['centerRegion'].clearWindowStatus();
|
578
574
|
Ext.Msg.alert('Error', 'Error reverting');
|
579
575
|
}
|
@@ -581,95 +577,94 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.NonPublishedVersionsGrid
|
|
581
577
|
}
|
582
578
|
},
|
583
579
|
|
584
|
-
initComponent:function () {
|
580
|
+
initComponent: function () {
|
585
581
|
this.callParent(arguments);
|
586
582
|
this.getStore().load();
|
587
583
|
},
|
588
584
|
|
589
|
-
constructor:function (config) {
|
585
|
+
constructor: function (config) {
|
590
586
|
var store = Ext.create("Ext.data.Store", {
|
591
587
|
title: 'Version History',
|
592
|
-
proxy:{
|
593
|
-
type:'ajax',
|
594
|
-
url:'/knitkit/erp_app/desktop/versions/non_published_content_versions',
|
595
|
-
reader:{
|
596
|
-
type:'json',
|
597
|
-
root:'data'
|
588
|
+
proxy: {
|
589
|
+
type: 'ajax',
|
590
|
+
url: '/knitkit/erp_app/desktop/versions/non_published_content_versions',
|
591
|
+
reader: {
|
592
|
+
type: 'json',
|
593
|
+
root: 'data'
|
598
594
|
},
|
599
|
-
extraParams:{
|
600
|
-
id:config['contentId']
|
595
|
+
extraParams: {
|
596
|
+
id: config['contentId']
|
601
597
|
}
|
602
598
|
},
|
603
|
-
idProperty:'id',
|
604
|
-
remoteSort:true,
|
605
|
-
fields:[
|
599
|
+
idProperty: 'id',
|
600
|
+
remoteSort: true,
|
601
|
+
fields: [
|
606
602
|
{
|
607
|
-
name:'id'
|
603
|
+
name: 'id'
|
608
604
|
},
|
609
605
|
{
|
610
|
-
name:'version'
|
606
|
+
name: 'version'
|
611
607
|
},
|
612
608
|
{
|
613
|
-
name:'title'
|
609
|
+
name: 'title'
|
614
610
|
},
|
615
611
|
{
|
616
|
-
name:'excerpt_html'
|
612
|
+
name: 'excerpt_html'
|
617
613
|
},
|
618
614
|
{
|
619
|
-
name:'body_html'
|
615
|
+
name: 'body_html'
|
620
616
|
},
|
621
617
|
{
|
622
|
-
name:'updated_at',
|
623
|
-
type:'date'
|
618
|
+
name: 'updated_at',
|
619
|
+
type: 'date'
|
624
620
|
}
|
625
621
|
]
|
626
622
|
});
|
627
623
|
|
628
624
|
config = Ext.apply({
|
629
|
-
columns:[
|
625
|
+
columns: [
|
630
626
|
{
|
631
|
-
header:'Version',
|
632
|
-
dataIndex:'version',
|
633
|
-
|
634
|
-
|
627
|
+
header: 'Version',
|
628
|
+
dataIndex: 'version',
|
629
|
+
style: {
|
630
|
+
textAlign: 'center'
|
631
|
+
},
|
632
|
+
sortable: true,
|
633
|
+
width: 75
|
635
634
|
},
|
636
635
|
{
|
637
|
-
header:'Timestamp',
|
638
|
-
dataIndex:'updated_at',
|
639
|
-
sortable:true,
|
640
|
-
renderer:Ext.util.Format.dateRenderer('m/d/Y H:i:s'),
|
641
|
-
|
636
|
+
header: 'Timestamp',
|
637
|
+
dataIndex: 'updated_at',
|
638
|
+
sortable: true,
|
639
|
+
renderer: Ext.util.Format.dateRenderer('m/d/Y H:i:s'),
|
640
|
+
flex: 1
|
642
641
|
},
|
643
642
|
{
|
644
|
-
menuDisabled:true,
|
645
|
-
resizable:false,
|
646
|
-
xtype:'actioncolumn',
|
647
|
-
header:'
|
648
|
-
align:'center',
|
649
|
-
|
650
|
-
items:[
|
643
|
+
menuDisabled: true,
|
644
|
+
resizable: false,
|
645
|
+
xtype: 'actioncolumn',
|
646
|
+
header: 'Action',
|
647
|
+
align: 'center',
|
648
|
+
flex: 0.5,
|
649
|
+
items: [
|
651
650
|
{
|
652
|
-
icon:'/images/icons/document_view/document_view_16x16.png',
|
653
|
-
tooltip:'View',
|
654
|
-
|
651
|
+
icon: '/images/icons/document_view/document_view_16x16.png',
|
652
|
+
tooltip: 'View',
|
653
|
+
getClass: function (v, meta, rec) {
|
654
|
+
return 'x-action-col-icon';
|
655
|
+
},
|
656
|
+
handler: function (grid, rowIndex, colIndex) {
|
655
657
|
var rec = grid.getStore().getAt(rowIndex);
|
656
658
|
grid.ownerCt.viewVersionedContent(rec);
|
657
659
|
}
|
658
|
-
}
|
659
|
-
]
|
660
|
-
},
|
661
|
-
{
|
662
|
-
menuDisabled:true,
|
663
|
-
resizable:false,
|
664
|
-
xtype:'actioncolumn',
|
665
|
-
header:'Revert',
|
666
|
-
align:'center',
|
667
|
-
width:60,
|
668
|
-
items:[
|
660
|
+
},
|
669
661
|
{
|
670
|
-
icon:'/images/icons/document_down/document_down_16x16.png',
|
671
|
-
tooltip:'Revert',
|
672
|
-
|
662
|
+
icon: '/images/icons/document_down/document_down_16x16.png',
|
663
|
+
tooltip: 'Revert',
|
664
|
+
getClass: function (v, meta, rec) {
|
665
|
+
return 'x-action-col-icon';
|
666
|
+
},
|
667
|
+
handler: function (grid, rowIndex, colIndex) {
|
673
668
|
var rec = grid.getStore().getAt(rowIndex);
|
674
669
|
grid.ownerCt.revert(rec);
|
675
670
|
}
|
@@ -677,13 +672,13 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.NonPublishedVersionsGrid
|
|
677
672
|
]
|
678
673
|
}
|
679
674
|
],
|
680
|
-
store:store,
|
681
|
-
bbar:Ext.create("Ext.PagingToolbar", {
|
682
|
-
pageSize:15,
|
683
|
-
store:store,
|
684
|
-
displayInfo:true,
|
685
|
-
displayMsg:'{0} - {1} of {2}',
|
686
|
-
emptyMsg:"Empty"
|
675
|
+
store: store,
|
676
|
+
bbar: Ext.create("Ext.PagingToolbar", {
|
677
|
+
pageSize: 15,
|
678
|
+
store: store,
|
679
|
+
displayInfo: true,
|
680
|
+
displayMsg: '{0} - {1} of {2}',
|
681
|
+
emptyMsg: "Empty"
|
687
682
|
})
|
688
683
|
}, config);
|
689
684
|
|