knitkit 3.0.0 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{public → app/assets}/images/check.png +0 -0
- data/{public → app/assets}/images/credit_card.png +0 -0
- data/{public → app/assets}/images/inline_edit/close.png +0 -0
- data/{public → app/assets}/images/knitkit/icons/document.png +0 -0
- data/{public → app/assets}/images/knitkit/icons/multi_doc.png +0 -0
- data/{public → app/assets}/images/knitkit/logo.png +0 -0
- data/{public → app/assets}/images/knitkit/splash/images/add-site.png +0 -0
- data/app/assets/images/knitkit/splash/images/add_website_105x105-active.png +0 -0
- data/app/assets/images/knitkit/splash/images/add_website_105x105.png +0 -0
- data/{public → app/assets}/images/knitkit/splash/images/adjust-site.png +0 -0
- data/{public → app/assets}/images/knitkit/splash/images/browse-site.png +0 -0
- data/app/assets/images/knitkit/splash/images/browse_db_105x105-active.png +0 -0
- data/app/assets/images/knitkit/splash/images/browse_db_105x105.png +0 -0
- data/app/assets/images/knitkit/splash/images/console_105x105-active.png +0 -0
- data/app/assets/images/knitkit/splash/images/console_105x105.png +0 -0
- data/{public → app/assets}/images/knitkit/splash/images/find-themes.png +0 -0
- data/app/assets/images/knitkit/splash/images/find_themes_105x105-active.png +0 -0
- data/app/assets/images/knitkit/splash/images/find_themes_105x105.png +0 -0
- data/app/assets/images/knitkit/splash/images/learn_more_105x105-active.png +0 -0
- data/app/assets/images/knitkit/splash/images/learn_more_105x105.png +0 -0
- data/{public → app/assets}/images/knitkit/splash/images/settings.png +0 -0
- data/{public → app/assets}/images/knitkit/splash/images/tutorials.png +0 -0
- data/app/assets/images/knitkit/splash/splash.png +0 -0
- data/app/assets/images/widgets/manage_profile/contact_information.png +0 -0
- data/app/assets/images/widgets/manage_profile/password.png +0 -0
- data/app/assets/images/widgets/manage_profile/user_information.png +0 -0
- data/app/assets/javascripts/erp_app/desktop/applications/knitkit/app.js +24 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/articles_grid_panel.js +15 -12
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/center_region.js +69 -48
- data/app/assets/javascripts/erp_app/desktop/applications/knitkit/comments_grid_panel.js +214 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/east_region.js +0 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/file_assets_panel.js +17 -19
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/image_assets_data_view.js +13 -3
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/image_assets_panel.js +59 -48
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/widgets_panel.js +0 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/inquiries_grid_panel.js +2 -2
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/module.js +2 -2
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/publish_window.js +0 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/published_grid_panel.js +1 -1
- data/app/assets/javascripts/erp_app/desktop/applications/knitkit/splash_screen.js +268 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/top_menu/main_menu.js +85 -33
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/top_menu/websites_combo.js +0 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/versions_grid_panel.js +5 -28
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/article.js +22 -8
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/document.js +143 -25
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/host.js +5 -1
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/menu.js +2 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/section.js +181 -65
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/website_nav_items.js +0 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/hosts_tree_panel.js +0 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/menu_tree_panel.js +0 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/site_contents_tree_panel.js +121 -116
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/themes_tree_panel.js +101 -10
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/west_region.js +9 -5
- data/app/assets/javascripts/knitkit-web.js +22 -0
- data/app/assets/javascripts/knitkit/additional-methods.min.js +4 -0
- data/app/assets/javascripts/knitkit/bootstrap.min.js +7 -0
- data/app/assets/javascripts/knitkit/captcha.js +154 -0
- data/{public → app/assets}/javascripts/knitkit/confirm-bootstrap.js +1 -1
- data/{public → app/assets}/javascripts/knitkit/inline_editing.js +1 -1
- data/{public → app/assets}/javascripts/knitkit/jquery.maskedinput.min.js +0 -0
- data/app/assets/javascripts/knitkit/jquery.validate.min.js +4 -0
- data/app/assets/javascripts/knitkit/js.cookie.js +145 -0
- data/{public → app/assets}/javascripts/knitkit/theme.js +0 -0
- data/app/assets/stylesheets/erp_app/desktop/applications/knitkit/app.css +12 -0
- data/{public → app/assets}/stylesheets/erp_app/desktop/applications/knitkit/knitkit.css +23 -33
- data/app/assets/stylesheets/erp_app/shared/knitkit_shared.css +21 -0
- data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.svg +288 -0
- data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.woff2 +0 -0
- data/app/assets/stylesheets/knitkit-web.css +16 -0
- data/app/assets/stylesheets/knitkit/bootstrap.min.css +5 -0
- data/app/assets/stylesheets/knitkit/captcha.css +59 -0
- data/app/assets/stylesheets/knitkit/custom.css +144 -0
- data/{public → app/assets}/stylesheets/knitkit/inline_editing.css +0 -0
- data/app/assets/stylesheets/knitkit/submenu.css +93 -0
- data/app/controllers/api/v1/websites_controller.rb +14 -0
- data/app/controllers/captcha_controller.rb +53 -0
- data/app/controllers/knitkit/base_controller.rb +1 -5
- data/app/controllers/knitkit/erp_app/desktop/app_controller.rb +2 -9
- data/app/controllers/knitkit/erp_app/desktop/articles_controller.rb +20 -7
- data/app/controllers/knitkit/erp_app/desktop/file_assets_controller.rb +38 -28
- data/app/controllers/knitkit/erp_app/desktop/image_assets_controller.rb +16 -9
- data/app/controllers/knitkit/erp_app/desktop/online_document_sections_controller.rb +69 -15
- data/app/controllers/knitkit/erp_app/desktop/position_controller.rb +45 -58
- data/app/controllers/knitkit/erp_app/desktop/theme_controller.rb +64 -29
- data/app/controllers/knitkit/erp_app/desktop/website_controller.rb +36 -13
- data/app/controllers/knitkit/erp_app/desktop/website_host_controller.rb +12 -0
- data/app/controllers/knitkit/erp_app/desktop/website_nav_controller.rb +4 -11
- data/app/controllers/knitkit/erp_app/desktop/website_nav_item_controller.rb +2 -9
- data/app/controllers/knitkit/erp_app/desktop/website_section_controller.rb +56 -20
- data/app/controllers/knitkit/online_document_sections_controller.rb +9 -3
- data/app/mailers/website_inquiry_mailer.rb +11 -3
- data/app/models/content.rb +16 -6
- data/app/models/documented_item.rb +12 -1
- data/app/models/online_document_section.rb +54 -20
- data/app/models/published_website.rb +16 -0
- data/app/models/theme.rb +53 -47
- data/app/models/website.rb +172 -191
- data/app/models/website_section.rb +64 -30
- data/app/views/knitkit/blogs/show.html.erb +5 -2
- data/app/views/layouts/knitkit/base.html.erb +54 -51
- data/app/views/menus/knitkit/_default_menu.html.erb +11 -11
- data/app/views/menus/knitkit/_default_section_menu.html.erb +2 -2
- data/app/views/menus/knitkit/_default_sub_menu.erb +27 -0
- data/app/views/menus/knitkit/_default_sub_section_menu.html.erb +30 -0
- data/app/views/website_inquiry_mailer/inquiry.html.erb +266 -0
- data/app/widgets/contact_us/base.rb +26 -16
- data/app/widgets/contact_us/javascript/contact_us.js +1 -1
- data/app/widgets/contact_us/views/error.html.erb +7 -3
- data/app/widgets/contact_us/views/index.html.erb +36 -28
- data/app/widgets/google_map/javascript/google_map.js +1 -1
- data/app/widgets/google_map/views/index.html.erb +1 -1
- data/app/widgets/login/javascript/login.js +1 -1
- data/app/widgets/login/views/index.html.erb +1 -1
- data/app/widgets/manage_profile/base.rb +141 -112
- data/app/widgets/manage_profile/javascript/manage_profile.js +2 -2
- data/app/widgets/manage_profile/views/_password_form.html.erb +1 -1
- data/app/widgets/manage_profile/views/_user_information_form.html.erb +1 -30
- data/app/widgets/manage_profile/views/index.html.erb +42 -40
- data/app/widgets/reset_password/base.rb +39 -8
- data/app/widgets/reset_password/javascript/reset_password.js +1 -1
- data/app/widgets/reset_password/views/index.html.erb +3 -3
- data/app/widgets/reset_password/views/invalid_reset_token.html.erb +7 -0
- data/app/widgets/reset_password/views/layouts/base.html.erb +1 -1
- data/app/widgets/reset_password/views/reset_password.html.erb +39 -0
- data/app/widgets/reset_password/views/reset_success.html.erb +5 -0
- data/app/widgets/search/base.rb +5 -5
- data/app/widgets/search/javascript/search.js +6 -6
- data/app/widgets/search/views/_inline_search_form.html.erb +23 -12
- data/app/widgets/search/views/_search_form.html.erb +34 -30
- data/app/widgets/search/views/layouts/base.html.erb +6 -1
- data/app/widgets/signup/base.rb +73 -30
- data/app/widgets/signup/javascript/signup.js +1 -1
- data/app/widgets/signup/views/_signup_form.html.erb +2 -1
- data/app/widgets/signup/views/layouts/base.html.erb +1 -1
- data/app/widgets/signup/views/success.html.erb +2 -3
- data/config/routes.rb +25 -4
- data/db/data_migrations/20110509223702_add_publisher_role.rb +0 -2
- data/db/data_migrations/20110816153456_add_knitkit_application.rb +7 -15
- data/db/data_migrations/20120127150505_create_website_default_configuration.rb +63 -3
- data/db/data_migrations/20150118180450_add_website_member_roles.rb +12 -0
- data/db/data_migrations/20150414150359_nest_knitkit_security_roles.rb +35 -0
- data/db/data_migrations/20150414173437_move_website_roles_under_website_builder.rb +19 -0
- data/db/migrate/20110211002317_setup_knitkit.rb +86 -39
- data/lib/knitkit.rb +8 -2
- data/lib/knitkit/config.rb +2 -3
- data/lib/knitkit/engine.rb +35 -4
- data/lib/knitkit/extensions.rb +2 -1
- data/lib/knitkit/extensions/action_controller/theme_support/acts_as_themed_controller.rb +1 -1
- data/lib/knitkit/extensions/action_mailer/theme_support/acts_as_themed_mailer.rb +1 -1
- data/lib/knitkit/extensions/compass_ae/mailers/user_mailer.rb +31 -0
- data/lib/knitkit/extensions/compass_ae/widgets/base.rb +1 -1
- data/lib/knitkit/extensions/railties/action_controller/captcha_helper.rb +43 -0
- data/lib/knitkit/extensions/railties/action_view/helpers/content_helper.rb +1 -1
- data/lib/knitkit/extensions/railties/action_view/helpers/menu_helper.rb +11 -1
- data/lib/knitkit/extensions/railties/theme_support/asset_tag_helper.rb +83 -0
- data/lib/knitkit/routing_filter/section_router.rb +24 -14
- data/lib/knitkit/version.rb +1 -1
- data/lib/tasks/knitkit_tasks.rake +89 -4
- data/lib/tasks/theme_parser.rake +85 -0
- data/public/fonts/glyphicons-halflings-regular.eot +0 -0
- data/public/fonts/glyphicons-halflings-regular.svg +288 -0
- data/public/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/public/fonts/glyphicons-halflings-regular.woff +0 -0
- data/public/fonts/glyphicons-halflings-regular.woff2 +0 -0
- data/public/paypal-button.min.js +7 -0
- metadata +161 -82
- data/app/assets/javascripts/knitkit/application.js +0 -9
- data/app/assets/stylesheets/knitkit/application.css +0 -7
- data/app/mailers/document_mailer.rb +0 -10
- data/app/views/document_mailer/email_document.html.erb +0 -12
- data/app/views/knitkit/mobile/index.html.erb +0 -162
- data/app/views/knitkit/online_document_sections/index.html.erb +0 -279
- data/app/views/layouts/knitkit/online_document_sections.html.erb +0 -80
- data/app/views/website_inquiry_mailer/inquiry.erb +0 -24
- data/db/data_migrations/20120127150506_add_primary_host_to_website_configuration.rb +0 -33
- data/db/data_migrations/20120316150424_add_is_template_to_default_website_config.rb +0 -16
- data/db/data_migrations/20120809020508_update_website_and_configuration.rb +0 -82
- data/db/data_migrations/20121129185611_upgrade_website_role_iid.rb +0 -20
- data/db/migrate/20130405184234_add_use_markdown_to_section.rb +0 -19
- data/db/migrate/20131112013052_add_knitkit_missing_indexes.rb +0 -33
- data/db/migrate/20140622212723_update_website_inquiries.rb +0 -22
- data/db/migrate/20140911185022_add_publishing_to_website.rb +0 -5
- data/db/migrate/20141013073349_add_custom_fields_to_documents.rb +0 -12
- data/db/migrate/20141016101936_upgrade_remove_dynamic_attributes.rb +0 -13
- data/lib/knitkit/extensions/railties/theme_support/theme_file_resolver.rb +0 -49
- data/public/images/knitkit/close_window.png +0 -0
- data/public/images/knitkit/splash/splash.png +0 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/comments_grid_panel.js +0 -215
- data/public/javascripts/erp_app/desktop/applications/knitkit/select_roles_window.js +0 -108
- data/public/javascripts/erp_app/desktop/applications/knitkit/splash_screen.js +0 -170
- data/public/javascripts/knitkit/bootstrap-datepicker.js +0 -474
- data/public/javascripts/knitkit/bootstrap.min.js +0 -7
- data/public/javascripts/knitkit/mobile/app/view/Main.js +0 -108
- data/public/javascripts/knitkit/mobile/ux/slidenavigation/View.js +0 -734
- data/public/stylesheets/knitkit/bootstrap-responsive.min.css +0 -10
- data/public/stylesheets/knitkit/bootstrap.min.css +0 -7
- data/public/stylesheets/knitkit/custom.css +0 -122
- data/public/stylesheets/knitkit/datepicker.css +0 -182
File without changes
|
File without changes
|
File without changes
|
@@ -35,9 +35,15 @@ Ext.define('SiteContentsModel', {
|
|
35
35
|
'parentItemId',
|
36
36
|
'tag_list',
|
37
37
|
// if an article is part of a blog then you can edit the excerpt
|
38
|
-
'canEditExcerpt',
|
39
|
-
|
40
|
-
|
38
|
+
'canEditExcerpt', {
|
39
|
+
name: 'createdAt',
|
40
|
+
mapping: 'created_at',
|
41
|
+
type: 'date'
|
42
|
+
}, {
|
43
|
+
name: 'updatedAt',
|
44
|
+
mapping: 'updated_at',
|
45
|
+
type: 'date'
|
46
|
+
}
|
41
47
|
]
|
42
48
|
});
|
43
49
|
|
@@ -57,7 +63,7 @@ var siteContentsStore = Ext.create('Ext.data.TreeStore', {
|
|
57
63
|
expanded: true
|
58
64
|
},
|
59
65
|
listeners: {
|
60
|
-
beforeexpand: function
|
66
|
+
beforeexpand: function(node, eOpts) {
|
61
67
|
if (!node.isRoot()) {
|
62
68
|
var tree = node.getOwnerTree();
|
63
69
|
tree.getStore().getProxy().setExtraParam('record_type', node.get('recordType'));
|
@@ -77,7 +83,7 @@ var viewConfigItems = {
|
|
77
83
|
markDirty: false,
|
78
84
|
plugins: pluginItems,
|
79
85
|
listeners: {
|
80
|
-
'beforedrop': function
|
86
|
+
'beforedrop': function(dom, data, overModel, dropPosition, dropHandlers, options) {
|
81
87
|
var record = data.records.first();
|
82
88
|
|
83
89
|
if (record.get('objectType') == 'Article') {
|
@@ -86,7 +92,7 @@ var viewConfigItems = {
|
|
86
92
|
}
|
87
93
|
}
|
88
94
|
},
|
89
|
-
'drop': function
|
95
|
+
'drop': function(dom, data, overModel, dropPosition, options) {
|
90
96
|
var positionArray = [],
|
91
97
|
record = data.records.first(),
|
92
98
|
result = true,
|
@@ -95,67 +101,59 @@ var viewConfigItems = {
|
|
95
101
|
if (record.get('isSection') || record.get('isDocument')) {
|
96
102
|
// if the record is modified and the parentId has changed we need to change
|
97
103
|
// the section parent
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
},
|
106
|
-
success: function (response) {
|
107
|
-
var obj = Ext.decode(response.responseText);
|
108
|
-
if (!obj.success) {
|
109
|
-
Ext.Msg.alert("Error", obj.message);
|
110
|
-
result = false;
|
111
|
-
}
|
112
|
-
},
|
113
|
-
failure: function (response) {
|
114
|
-
Ext.Msg.alert('Error', 'Error saving positions.');
|
115
|
-
result = false;
|
116
|
-
}
|
104
|
+
var parentNode = null;
|
105
|
+
|
106
|
+
if (dropPosition == 'append') {
|
107
|
+
positionArray.push({
|
108
|
+
id: record.get('recordId'),
|
109
|
+
parent_id: overModel.get('recordId'),
|
110
|
+
position: 0
|
117
111
|
});
|
112
|
+
|
113
|
+
parentNode = overModel;
|
114
|
+
} else {
|
115
|
+
parentNode = overModel.parentNode;
|
118
116
|
}
|
119
|
-
else {
|
120
|
-
overModel.parentNode.eachChild(function (node) {
|
121
|
-
if (node.get('isSection') || record.get('isDocument')) {
|
122
|
-
positionArray.push({
|
123
|
-
id: node.data.id.split('_')[1],
|
124
|
-
position: counter
|
125
|
-
});
|
126
|
-
counter++;
|
127
|
-
}
|
128
|
-
});
|
129
117
|
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
118
|
+
parentNode.eachChild(function(node) {
|
119
|
+
if (node.get('isSection') || record.get('isDocument')) {
|
120
|
+
positionArray.push({
|
121
|
+
id: node.get('recordId'),
|
122
|
+
parent_id: node.parentNode.get('recordId'),
|
123
|
+
position: counter
|
124
|
+
});
|
125
|
+
|
126
|
+
counter++;
|
127
|
+
}
|
128
|
+
});
|
129
|
+
|
130
|
+
Ext.Ajax.request({
|
131
|
+
url: '/knitkit/erp_app/desktop/position/update_section_position',
|
132
|
+
method: 'PUT',
|
133
|
+
jsonData: {
|
134
|
+
position_array: positionArray
|
135
|
+
},
|
136
|
+
success: function(response) {
|
137
|
+
var obj = Ext.decode(response.responseText);
|
138
|
+
if (!obj.success) {
|
139
|
+
Ext.Msg.alert("Error", obj.message);
|
145
140
|
result = false;
|
146
141
|
}
|
147
|
-
}
|
148
|
-
|
142
|
+
},
|
143
|
+
failure: function(response) {
|
144
|
+
Ext.Msg.alert('Error', 'Error saving positions.');
|
145
|
+
result = false;
|
146
|
+
}
|
147
|
+
});
|
149
148
|
}
|
150
149
|
// this is an article
|
151
150
|
else {
|
152
151
|
if (record.modified && record.modified.parentId) {
|
153
152
|
result = false;
|
154
|
-
}
|
155
|
-
|
156
|
-
overModel.parentNode.eachChild(function (node) {
|
153
|
+
} else {
|
154
|
+
overModel.parentNode.eachChild(function(node) {
|
157
155
|
positionArray.push({
|
158
|
-
id: node.get('
|
156
|
+
id: node.get('recordId'),
|
159
157
|
position: counter
|
160
158
|
});
|
161
159
|
counter++;
|
@@ -168,16 +166,16 @@ var viewConfigItems = {
|
|
168
166
|
position_array: positionArray
|
169
167
|
},
|
170
168
|
params: {
|
171
|
-
section_id: record.parentNode.get('
|
169
|
+
section_id: record.parentNode.get('recordId')
|
172
170
|
},
|
173
|
-
success: function
|
171
|
+
success: function(response) {
|
174
172
|
var obj = Ext.decode(response.responseText);
|
175
173
|
if (!obj.success) {
|
176
174
|
Ext.Msg.alert("Error", obj.message);
|
177
175
|
result = false;
|
178
176
|
}
|
179
177
|
},
|
180
|
-
failure: function
|
178
|
+
failure: function(response) {
|
181
179
|
Ext.Msg.alert('Error', 'Error saving positions.');
|
182
180
|
result = false;
|
183
181
|
}
|
@@ -202,7 +200,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.SiteContentsTreePanel", {
|
|
202
200
|
store: siteContentsStore,
|
203
201
|
enableDD: true,
|
204
202
|
|
205
|
-
editSectionLayout: function
|
203
|
+
editSectionLayout: function(sectionName, sectionId, websiteId) {
|
206
204
|
var self = this;
|
207
205
|
|
208
206
|
Ext.Ajax.request({
|
@@ -211,40 +209,37 @@ Ext.define("Compass.ErpApp.Desktop.Applications.SiteContentsTreePanel", {
|
|
211
209
|
params: {
|
212
210
|
id: sectionId
|
213
211
|
},
|
214
|
-
success: function
|
212
|
+
success: function(response) {
|
215
213
|
self.initialConfig['centerRegion'].editSectionLayout(
|
216
214
|
sectionName,
|
217
215
|
websiteId,
|
218
216
|
sectionId,
|
219
|
-
response.responseText,
|
220
|
-
|
221
|
-
{
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
codeMirror.insertContent('<%=render_content_area(:' + text + ')%>');
|
228
|
-
}
|
217
|
+
response.responseText, [{
|
218
|
+
text: 'Insert Content Area',
|
219
|
+
handler: function(btn) {
|
220
|
+
var codeMirror = btn.findParentByType('codemirror');
|
221
|
+
Ext.MessageBox.prompt('New File', 'Please enter content area name:', function(btn, text) {
|
222
|
+
if (btn == 'ok') {
|
223
|
+
codeMirror.insertContent('<%=render_content_area(:' + text + ')%>');
|
224
|
+
}
|
229
225
|
|
230
|
-
|
231
|
-
}
|
226
|
+
});
|
232
227
|
}
|
233
|
-
]);
|
228
|
+
}]);
|
234
229
|
},
|
235
|
-
failure: function
|
230
|
+
failure: function(response) {
|
236
231
|
Ext.Msg.alert('Error', 'Error loading section layout.');
|
237
232
|
}
|
238
233
|
});
|
239
234
|
},
|
240
235
|
|
241
|
-
clearWebsite: function
|
236
|
+
clearWebsite: function() {
|
242
237
|
var store = this.getStore();
|
243
238
|
store.getProxy().extraParams = {};
|
244
239
|
store.load();
|
245
240
|
},
|
246
241
|
|
247
|
-
selectWebsite: function
|
242
|
+
selectWebsite: function(website) {
|
248
243
|
var store = this.getStore();
|
249
244
|
store.getProxy().extraParams = {
|
250
245
|
website_id: website.id
|
@@ -253,51 +248,69 @@ Ext.define("Compass.ErpApp.Desktop.Applications.SiteContentsTreePanel", {
|
|
253
248
|
},
|
254
249
|
|
255
250
|
listeners: {
|
256
|
-
|
251
|
+
itemclick: function(view, record, htmlItem, index, e) {
|
252
|
+
var url = null;
|
257
253
|
var self = this;
|
258
254
|
e.stopEvent();
|
255
|
+
|
259
256
|
if (record.data['isSection']) {
|
260
257
|
self.initialConfig['centerRegion'].openIframeInTab(record.data.text, record.data['url']);
|
261
|
-
}
|
262
|
-
|
263
|
-
var url = '/knitkit/erp_app/desktop/articles/show/' + record.data.id;
|
258
|
+
} else if (record.data['objectType'] === "Article") {
|
259
|
+
url = '/knitkit/erp_app/desktop/articles/show/' + record.get('recordId');
|
264
260
|
|
265
261
|
Ext.Ajax.request({
|
266
262
|
url: url,
|
267
263
|
method: 'GET',
|
268
264
|
extraParams: {
|
269
|
-
id: record.
|
265
|
+
id: record.get('recordId')
|
270
266
|
},
|
271
267
|
timeout: 90000,
|
272
|
-
success: function
|
268
|
+
success: function(response) {
|
273
269
|
var article = Ext.decode(response.responseText);
|
274
|
-
self.initialConfig['centerRegion'].editContent(record.data.text, record.
|
270
|
+
self.initialConfig['centerRegion'].editContent(record.data.text, record.get('recordId'), article.body_html, record.data['siteId'], 'article');
|
271
|
+
},
|
272
|
+
failure: function() {
|
273
|
+
Ext.Msg.alert('Error', 'Could not load content');
|
275
274
|
}
|
276
275
|
});
|
277
|
-
}
|
278
|
-
|
276
|
+
} else if (record.data['isDocument']) {
|
277
|
+
url = '/knitkit/erp_app/desktop/online_document_sections/' + record.get('recordId') + '/content/';
|
279
278
|
var contentInfo = record.data['contentInfo'];
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
279
|
+
|
280
|
+
Ext.Ajax.request({
|
281
|
+
url: url,
|
282
|
+
method: 'GET',
|
283
|
+
timeout: 90000,
|
284
|
+
success: function(response) {
|
285
|
+
var result = Ext.decode(response.responseText);
|
286
|
+
if (result.success) {
|
287
|
+
if (record.data['useMarkdown']) {
|
288
|
+
self.initialConfig['centerRegion'].editDocumentationMarkdown(
|
289
|
+
contentInfo.title,
|
290
|
+
record.data['siteId'],
|
291
|
+
contentInfo.id,
|
292
|
+
result.content, []
|
293
|
+
);
|
294
|
+
} else {
|
295
|
+
self.initialConfig['centerRegion'].editContent(
|
296
|
+
contentInfo.title,
|
297
|
+
contentInfo.id,
|
298
|
+
result.content,
|
299
|
+
record.data['siteId'],
|
300
|
+
'article'
|
301
|
+
);
|
302
|
+
}
|
303
|
+
} else {
|
304
|
+
Ext.Msg.alert('Error', 'Could not load content');
|
305
|
+
}
|
306
|
+
},
|
307
|
+
failure: function() {
|
308
|
+
Ext.Msg.alert('Error', 'Could not load content');
|
309
|
+
}
|
310
|
+
});
|
298
311
|
}
|
299
312
|
},
|
300
|
-
|
313
|
+
itemcontextmenu: function(view, record, htmlItem, index, e) {
|
301
314
|
e.stopEvent();
|
302
315
|
var items = [];
|
303
316
|
|
@@ -306,7 +319,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.SiteContentsTreePanel", {
|
|
306
319
|
text: 'View In Web Navigator',
|
307
320
|
iconCls: 'icon-globe',
|
308
321
|
listeners: {
|
309
|
-
'click': function
|
322
|
+
'click': function() {
|
310
323
|
var webNavigator = window.compassDesktop.getModule('web-navigator-win');
|
311
324
|
webNavigator.createWindow(record.data['url']);
|
312
325
|
}
|
@@ -337,24 +350,16 @@ Ext.define("Compass.ErpApp.Desktop.Applications.SiteContentsTreePanel", {
|
|
337
350
|
|
338
351
|
if (record.data['isSection']) {
|
339
352
|
items = Compass.ErpApp.Desktop.Applications.Knitkit.addSectionOptions(self, items, record);
|
340
|
-
}
|
341
|
-
else if (record.data['isWebsite']) {
|
353
|
+
} else if (record.data['isWebsite']) {
|
342
354
|
items = Compass.ErpApp.Desktop.Applications.Knitkit.addWebsiteOptions(self, items, record);
|
343
355
|
}
|
344
356
|
|
345
|
-
if (items.length
|
357
|
+
if (items.length !== 0) {
|
346
358
|
var contextMenu = Ext.create("Ext.menu.Menu", {
|
347
359
|
items: items
|
348
360
|
});
|
349
361
|
contextMenu.showAt(e.xy);
|
350
362
|
}
|
351
363
|
}
|
352
|
-
},
|
353
|
-
|
354
|
-
initComponent: function (config) {
|
355
|
-
config = Ext.apply({
|
356
|
-
}, config);
|
357
|
-
|
358
|
-
this.callParent([config]);
|
359
364
|
}
|
360
365
|
});
|
@@ -22,6 +22,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.ThemesTreePanel", {
|
|
22
22
|
|
23
23
|
Ext.create("Ext.window.Window", {
|
24
24
|
layout: 'fit',
|
25
|
+
modal: true,
|
25
26
|
width: 375,
|
26
27
|
title: 'Theme Widget',
|
27
28
|
plain: true,
|
@@ -171,8 +172,93 @@ Ext.define("Compass.ErpApp.Desktop.Applications.ThemesTreePanel", {
|
|
171
172
|
});
|
172
173
|
},
|
173
174
|
|
174
|
-
|
175
|
-
|
175
|
+
showUpdateThemeForm: function(node){
|
176
|
+
Ext.create("Ext.window.Window", {
|
177
|
+
layout: 'fit',
|
178
|
+
modal: true,
|
179
|
+
title: 'Rename Theme',
|
180
|
+
width: 360,
|
181
|
+
plain: true,
|
182
|
+
buttonAlign: 'center',
|
183
|
+
defaultFocus: 'name',
|
184
|
+
items: Ext.create('widget.form', {
|
185
|
+
labelWidth: 110,
|
186
|
+
frame: false,
|
187
|
+
bodyStyle: 'padding:5px 5px 0',
|
188
|
+
fileUpload: true,
|
189
|
+
url: '/knitkit/erp_app/desktop/theme/update',
|
190
|
+
defaults: {
|
191
|
+
width: 320
|
192
|
+
},
|
193
|
+
items: [
|
194
|
+
{
|
195
|
+
xtype: 'hidden',
|
196
|
+
name: 'id',
|
197
|
+
value: node.get('id')
|
198
|
+
},
|
199
|
+
{
|
200
|
+
xtype: 'textfield',
|
201
|
+
fieldLabel: 'Name',
|
202
|
+
value: node.get('name'),
|
203
|
+
allowBlank: false,
|
204
|
+
name: 'name',
|
205
|
+
itemId: 'name'
|
206
|
+
}
|
207
|
+
]
|
208
|
+
}),
|
209
|
+
buttons: [
|
210
|
+
{
|
211
|
+
text: 'Submit',
|
212
|
+
listeners: {
|
213
|
+
'click': function (button) {
|
214
|
+
var window = button.findParentByType('window'),
|
215
|
+
formPanel = window.query('form')[0],
|
216
|
+
|
217
|
+
westRegion = Ext.ComponentQuery.query('#knitkitWestRegion').first(),
|
218
|
+
themesTreePanel = westRegion.down('#themesTreePanel');
|
219
|
+
|
220
|
+
|
221
|
+
var loading = new Ext.LoadMask(window, {msg: 'Please wait...'});
|
222
|
+
loading.show();
|
223
|
+
|
224
|
+
formPanel.getForm().submit({
|
225
|
+
reset: true,
|
226
|
+
timeout: 300000,
|
227
|
+
success: function (form, action) {
|
228
|
+
loading.hide();
|
229
|
+
window.close();
|
230
|
+
|
231
|
+
var obj = Ext.decode(action.response.responseText);
|
232
|
+
if (obj.success) {
|
233
|
+
// update node
|
234
|
+
node.set('name', obj.theme.name);
|
235
|
+
node.set('text', obj.theme.text);
|
236
|
+
node.commit();
|
237
|
+
}
|
238
|
+
},
|
239
|
+
failure: function (form, action) {
|
240
|
+
loading.hide();
|
241
|
+
|
242
|
+
Ext.Msg.alert("Error", "Error updating theme");
|
243
|
+
}
|
244
|
+
});
|
245
|
+
}
|
246
|
+
}
|
247
|
+
},
|
248
|
+
{
|
249
|
+
text: 'Close',
|
250
|
+
handler: function (btn) {
|
251
|
+
btn.up('window').close();
|
252
|
+
}
|
253
|
+
}
|
254
|
+
]
|
255
|
+
}).show();
|
256
|
+
},
|
257
|
+
|
258
|
+
deleteTheme: function (theme) {
|
259
|
+
var self = this,
|
260
|
+
themeId = theme.get('id');
|
261
|
+
|
176
262
|
self.initialConfig['centerRegion'].setWindowStatus('Deleting theme...');
|
177
263
|
Ext.Ajax.request({
|
178
264
|
url: '/knitkit/erp_app/desktop/theme/delete',
|
@@ -184,9 +270,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.ThemesTreePanel", {
|
|
184
270
|
var obj = Ext.decode(response.responseText);
|
185
271
|
if (obj.success) {
|
186
272
|
self.initialConfig['centerRegion'].clearWindowStatus();
|
187
|
-
|
188
|
-
node: self.getRootNode()
|
189
|
-
});
|
273
|
+
theme.parentNode.removeChild(theme);
|
190
274
|
}
|
191
275
|
else {
|
192
276
|
Ext.Msg.alert('Error', 'Error deleting theme');
|
@@ -226,6 +310,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.ThemesTreePanel", {
|
|
226
310
|
fields: [
|
227
311
|
'isTheme',
|
228
312
|
'themeId',
|
313
|
+
'name',
|
229
314
|
'isActive',
|
230
315
|
'siteId',
|
231
316
|
'text',
|
@@ -238,9 +323,6 @@ Ext.define("Compass.ErpApp.Desktop.Applications.ThemesTreePanel", {
|
|
238
323
|
scroll: 'vertical',
|
239
324
|
//containerScroll: true,
|
240
325
|
listeners: {
|
241
|
-
'load': function (store) {
|
242
|
-
store.getRootNode().expandChildren();
|
243
|
-
},
|
244
326
|
'showImage': function (fileManager, node, themeId) {
|
245
327
|
var themeId = null;
|
246
328
|
var themeNode = node;
|
@@ -267,7 +349,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.ThemesTreePanel", {
|
|
267
349
|
}
|
268
350
|
self.initialConfig['centerRegion'].editTemplateFile(node, content, [], themeId);
|
269
351
|
},
|
270
|
-
'handleContextMenu': function (fileManager, node, e) {
|
352
|
+
'handleContextMenu': function (fileManager, node, item, index, e) {
|
271
353
|
var items = [];
|
272
354
|
|
273
355
|
if (node.isRoot()) {
|
@@ -307,12 +389,21 @@ Ext.define("Compass.ErpApp.Desktop.Applications.ThemesTreePanel", {
|
|
307
389
|
return false;
|
308
390
|
}
|
309
391
|
else if (btn == 'yes') {
|
310
|
-
self.deleteTheme(node
|
392
|
+
self.deleteTheme(node);
|
311
393
|
}
|
312
394
|
});
|
313
395
|
}
|
314
396
|
}
|
315
397
|
});
|
398
|
+
items.push({
|
399
|
+
text: 'Rename Theme',
|
400
|
+
iconCls: 'icon-edit',
|
401
|
+
listeners: {
|
402
|
+
'click': function () {
|
403
|
+
self.showUpdateThemeForm(node);
|
404
|
+
}
|
405
|
+
}
|
406
|
+
});
|
316
407
|
items.push({
|
317
408
|
text: 'Export',
|
318
409
|
iconCls: 'icon-document_out',
|