knitkit 2.1.2 → 2.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/knitkit/comments_controller.rb +1 -1
- data/app/controllers/knitkit/erp_app/desktop/app_controller.rb +5 -0
- data/app/controllers/knitkit/erp_app/desktop/articles_controller.rb +0 -4
- data/app/controllers/knitkit/erp_app/desktop/content_controller.rb +0 -2
- data/app/controllers/knitkit/erp_app/desktop/theme_controller.rb +13 -0
- data/app/controllers/knitkit/erp_app/desktop/website_section_controller.rb +37 -29
- data/app/controllers/knitkit/online_document_sections_controller.rb +1 -1
- data/app/models/website_section.rb +2 -3
- data/app/views/knitkit/blogs/_add_comment.html.erb +2 -1
- data/app/views/knitkit/online_document_sections/index.html.erb +143 -136
- data/app/views/layouts/knitkit/online_document_sections.html.erb +2 -2
- data/app/widgets/contact_us/javascript/contact_us.js +3 -1
- data/app/widgets/dynamic_forms/javascript/dynamic_forms.js +91 -92
- data/app/widgets/dynamic_grid/base.rb +7 -7
- data/app/widgets/dynamic_grid/javascript/dynamic_grid.js +111 -112
- data/app/widgets/dynamic_grid/views/index.html.erb +1 -1
- data/app/widgets/google_map/javascript/google_map.js +132 -119
- data/app/widgets/google_map/views/index.html.erb +1 -1
- data/app/widgets/login/javascript/login.js +160 -155
- data/app/widgets/manage_profile/javascript/manage_profile.js +3 -1
- data/app/widgets/reset_password/javascript/reset_password.js +3 -1
- data/app/widgets/scaffold/base.rb +8 -4
- data/app/widgets/scaffold/javascript/scaffold.js +218 -220
- data/app/widgets/scaffold/views/index.html.erb +1 -1
- data/app/widgets/search/javascript/search.js +21 -21
- data/app/widgets/signup/javascript/signup.js +2 -1
- data/config/routes.rb +1 -1
- data/lib/knitkit/extensions/railties/action_view/helpers/blog_helper.rb +3 -3
- data/lib/knitkit/extensions/railties/action_view/helpers/knitkit_helper.rb +0 -2
- data/lib/knitkit/version.rb +1 -1
- data/public/javascripts/erp_app/desktop/applications/knitkit/center_region.js +6 -7
- data/public/javascripts/erp_app/desktop/applications/knitkit/publish_window.js +3 -3
- data/public/javascripts/erp_app/desktop/applications/knitkit/select_roles_window.js +103 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/section.js +4 -4
- data/public/javascripts/erp_app/desktop/applications/knitkit/west_region/west_region.js +32 -21
- metadata +3 -2
@@ -1,6 +1,7 @@
|
|
1
1
|
Compass.ErpApp.Widgets.Signup = {
|
2
|
+
template: new Ext.Template('<%= render_widget :signup, :params => {:login_url => "/login"}%>'),
|
2
3
|
addSignup:function(){
|
3
|
-
Ext.getCmp('knitkitCenterRegion').addContentToActiveCodeMirror(
|
4
|
+
Ext.getCmp('knitkitCenterRegion').addContentToActiveCodeMirror(Compass.ErpApp.Widgets.Signup.template.apply());
|
4
5
|
}
|
5
6
|
}
|
6
7
|
|
data/config/routes.rb
CHANGED
@@ -8,7 +8,7 @@ Rails.application.routes.draw do
|
|
8
8
|
get 'blogs/:section_id/:id' => 'knitkit/blogs#show', :as => 'blog_article'
|
9
9
|
get 'blogs/:section_id/tag/:tag_id(.:format)' => 'knitkit/blogs#tag', :as => 'blog_tag'
|
10
10
|
|
11
|
-
match '/comments/add
|
11
|
+
match '/comments/add' => 'knitkit/comments#add', :as => 'comments'
|
12
12
|
match '/unauthorized' => 'knitkit/unauthorized#index', :as => 'knitkit/unauthorized'
|
13
13
|
match '/view_current_publication' => 'knitkit/base#view_current_publication'
|
14
14
|
match '/online_document_sections/build_tree' => 'knitkit/online_document_sections#build_tree'
|
@@ -6,7 +6,7 @@ module Knitkit
|
|
6
6
|
module BlogHelper
|
7
7
|
|
8
8
|
def blog_add_comment_form
|
9
|
-
render :partial => 'add_comment'
|
9
|
+
render :partial => 'add_comment' if current_user
|
10
10
|
end
|
11
11
|
|
12
12
|
def blog_topics(css_class='tag_link')
|
@@ -23,9 +23,9 @@ module Knitkit
|
|
23
23
|
|
24
24
|
def blog_rss_links(link_title='RSS Feed')
|
25
25
|
if params[:action] == 'tag'
|
26
|
-
return link_to link_title, main_app.blog_tag_url(params[:section_id], params[:tag_id], :rss)
|
26
|
+
return link_to link_title, main_app.blog_tag_url(params[:section_id], params[:tag_id], :rss), :target => '_blank'
|
27
27
|
else
|
28
|
-
return link_to link_title, main_app.blogs_url(params[:section_id], :rss)
|
28
|
+
return link_to link_title, main_app.blogs_url(params[:section_id], :rss), :target => '_blank'
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -34,7 +34,6 @@ module Knitkit
|
|
34
34
|
#section_unique_name
|
35
35
|
# - sections permalink to start breadcrumbs at
|
36
36
|
def build_crumbs(options={})
|
37
|
-
links = []
|
38
37
|
if options[:menu]
|
39
38
|
menu = WebsiteNav.find_by_name(options[:menu])
|
40
39
|
raise "Menu with name #{options[:menu]} does not exist" if menu.nil?
|
@@ -48,7 +47,6 @@ module Knitkit
|
|
48
47
|
else
|
49
48
|
links = @website_section.self_and_ancestors.collect{|child| {:url => child.path, :title => child.title}}
|
50
49
|
end
|
51
|
-
links
|
52
50
|
|
53
51
|
render :partial => 'shared/knitkit/bread_crumb', :locals => {:links => links}
|
54
52
|
end
|
data/lib/knitkit/version.rb
CHANGED
@@ -17,7 +17,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
|
|
17
17
|
['Link', 'Unlink', 'Anchor'],
|
18
18
|
['HorizontalRule', 'SpecialChar', 'PageBreak'],
|
19
19
|
['ShowBlocks', 'RemoveFormat'],
|
20
|
-
['
|
20
|
+
['KnitkitThemes', 'Format', 'Font', 'FontSize' ],
|
21
21
|
['Maximize', '-', 'About']
|
22
22
|
],
|
23
23
|
|
@@ -235,7 +235,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
|
|
235
235
|
autoHeight:true,
|
236
236
|
value:content,
|
237
237
|
ckEditorConfig:{
|
238
|
-
extraPlugins:'jwplayer',
|
238
|
+
extraPlugins:'jwplayer,knitkitthemes',
|
239
239
|
toolbar:self.ckEditorToolbar
|
240
240
|
},
|
241
241
|
listeners:{
|
@@ -408,7 +408,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
|
|
408
408
|
autoHeight:true,
|
409
409
|
//value:content,
|
410
410
|
ckEditorConfig:{
|
411
|
-
extraPlugins:'jwplayer',
|
411
|
+
extraPlugins:'jwplayer,knitkitthemes',
|
412
412
|
toolbar:self.ckEditorToolbar
|
413
413
|
},
|
414
414
|
listeners:{
|
@@ -542,8 +542,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
|
|
542
542
|
var item = this.workArea.query('#' + itemId).first();
|
543
543
|
|
544
544
|
if (Compass.ErpApp.Utility.isBlank(item)) {
|
545
|
-
item = {
|
546
|
-
xtype:'panel',
|
545
|
+
item = Ext.create("Ext.panel.Panel", {
|
547
546
|
layout:'border',
|
548
547
|
title:title + " Inquiries",
|
549
548
|
itemId:itemId,
|
@@ -571,7 +570,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
|
|
571
570
|
Ext.getCmp('knitkitWestRegion').selectWebsite(websiteId);
|
572
571
|
}
|
573
572
|
}
|
574
|
-
};
|
573
|
+
});
|
575
574
|
|
576
575
|
this.workArea.add(item);
|
577
576
|
}
|
@@ -680,6 +679,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
|
|
680
679
|
}
|
681
680
|
return false;
|
682
681
|
},
|
682
|
+
|
683
683
|
saveCurrent:function () {
|
684
684
|
var activeTab = this.workArea.getActiveTab();
|
685
685
|
if (!Ext.isEmpty(activeTab) && !Ext.isEmpty(activeTab.initialConfig.save)) {
|
@@ -687,7 +687,6 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
|
|
687
687
|
}
|
688
688
|
},
|
689
689
|
|
690
|
-
|
691
690
|
saveAll:function () {
|
692
691
|
this.workArea.items.each(function (comp) {
|
693
692
|
if (!Ext.isEmpty(comp) && !Ext.isEmpty(comp.initialConfig.save)) {
|
@@ -6,14 +6,14 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.PublishWindow",{
|
|
6
6
|
this.addEvents(
|
7
7
|
/**
|
8
8
|
* @event publish_success
|
9
|
-
* Fired after success response is
|
9
|
+
* Fired after success response is received from server
|
10
10
|
* @param {Compass.ErpApp.Applications.Desktop.PublishWindow} this Object
|
11
11
|
* @param {Object} Server Response
|
12
12
|
*/
|
13
13
|
"publish_success",
|
14
14
|
/**
|
15
15
|
* @event publish_failure
|
16
|
-
* Fired after response is
|
16
|
+
* Fired after response is received from server with error
|
17
17
|
* @param {Compass.ErpApp.Applications.Desktop.PublishWindow} this Object
|
18
18
|
* @param {Object} Server Response
|
19
19
|
*/
|
@@ -33,7 +33,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.PublishWindow",{
|
|
33
33
|
height:300,
|
34
34
|
buttonAlign:'center',
|
35
35
|
plain: true,
|
36
|
-
items:
|
36
|
+
items: Ext.create('widget.form',{
|
37
37
|
timeout: 130000,
|
38
38
|
baseParams:config['baseParams'],
|
39
39
|
autoHeight:true,
|
@@ -0,0 +1,103 @@
|
|
1
|
+
Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.SelectRolesWindow",{
|
2
|
+
extend:"Ext.window.Window",
|
3
|
+
alias:'widget.knikit_selectroleswindow',
|
4
|
+
initComponent : function() {
|
5
|
+
|
6
|
+
this.addEvents(
|
7
|
+
/**
|
8
|
+
* @event success
|
9
|
+
* Fired after success response is received from server
|
10
|
+
* @param {Compass.ErpApp.Applications.Desktop.PublishWindow} this Object
|
11
|
+
* @param {Object} Server Response
|
12
|
+
*/
|
13
|
+
"success",
|
14
|
+
/**
|
15
|
+
* @event failure
|
16
|
+
* Fired after response is received from server with error
|
17
|
+
* @param {Compass.ErpApp.Applications.Desktop.PublishWindow} this Object
|
18
|
+
* @param {Object} Server Response
|
19
|
+
*/
|
20
|
+
"failure"
|
21
|
+
);
|
22
|
+
|
23
|
+
this.callParent(arguments);
|
24
|
+
},
|
25
|
+
|
26
|
+
constructor : function(config) {
|
27
|
+
var currentRoles = config['currentRoles'],
|
28
|
+
availableRoles = config['availableRoles'],
|
29
|
+
checkBoxes = [];
|
30
|
+
|
31
|
+
Ext.each(availableRoles, function(role){
|
32
|
+
checkBoxes.push({
|
33
|
+
name:role['internal_identifier'],
|
34
|
+
boxLabel:role['description'],
|
35
|
+
checked:currentRoles.contains(role['internal_identifier'])
|
36
|
+
})
|
37
|
+
});
|
38
|
+
|
39
|
+
config = Ext.apply({
|
40
|
+
layout:'fit',
|
41
|
+
title:'Secure',
|
42
|
+
iconCls:'icon-document_lock',
|
43
|
+
width:250,
|
44
|
+
height:300,
|
45
|
+
buttonAlign:'center',
|
46
|
+
plain: true,
|
47
|
+
items: Ext.create('widget.form',{
|
48
|
+
timeout: 130000,
|
49
|
+
baseParams:config['baseParams'],
|
50
|
+
autoHeight:true,
|
51
|
+
labelWidth:110,
|
52
|
+
bodyPadding:'5px',
|
53
|
+
frame:false,
|
54
|
+
layout:'fit',
|
55
|
+
url:config['url'],
|
56
|
+
defaults: {
|
57
|
+
width: 225
|
58
|
+
},
|
59
|
+
items: [{
|
60
|
+
xtype: 'fieldset',
|
61
|
+
autoScroll:true,
|
62
|
+
title:'Select Roles',
|
63
|
+
defaultType: 'checkbox',
|
64
|
+
items:checkBoxes
|
65
|
+
}]
|
66
|
+
}),
|
67
|
+
buttons: [{
|
68
|
+
text:'Submit',
|
69
|
+
listeners:{
|
70
|
+
'click':function(button){
|
71
|
+
var win = button.up('knikit_selectroleswindow');
|
72
|
+
var formPanel = win.down('form');
|
73
|
+
formPanel.getForm().submit({
|
74
|
+
method:'POST',
|
75
|
+
waitMsg:'Updating Security...',
|
76
|
+
success:function(form, action){
|
77
|
+
var response = Ext.decode(action.response.responseText);
|
78
|
+
win.fireEvent('success', win, response);
|
79
|
+
win.close();
|
80
|
+
},
|
81
|
+
failure:function(form, action){
|
82
|
+
var response = Ext.decode(action.response.responseText);
|
83
|
+
win.fireEvent('failure', win, response);
|
84
|
+
}
|
85
|
+
});
|
86
|
+
}
|
87
|
+
}
|
88
|
+
},
|
89
|
+
{
|
90
|
+
text: 'Cancel',
|
91
|
+
listeners:{
|
92
|
+
'click':function(button){
|
93
|
+
var win = button.up('knikit_selectroleswindow');
|
94
|
+
win.close();
|
95
|
+
}
|
96
|
+
}
|
97
|
+
}]
|
98
|
+
}, config);
|
99
|
+
|
100
|
+
this.callParent([config]);
|
101
|
+
}
|
102
|
+
|
103
|
+
});
|
@@ -12,11 +12,11 @@ Compass.ErpApp.Desktop.Applications.Knitkit.addSectionOptions = function (self,
|
|
12
12
|
if (record.data.isSecured) {
|
13
13
|
if (currentUser.hasCapability('unsecure','WebsiteSection')) {
|
14
14
|
items.push({
|
15
|
-
text:'
|
16
|
-
iconCls:'icon-
|
15
|
+
text:'Security',
|
16
|
+
iconCls:'icon-document_lock',
|
17
17
|
listeners:{
|
18
18
|
'click':function () {
|
19
|
-
self.changeSecurityOnSection(record,
|
19
|
+
self.changeSecurityOnSection(record, true);
|
20
20
|
}
|
21
21
|
}
|
22
22
|
});
|
@@ -25,7 +25,7 @@ Compass.ErpApp.Desktop.Applications.Knitkit.addSectionOptions = function (self,
|
|
25
25
|
else {
|
26
26
|
if (currentUser.hasCapability('secure','WebsiteSection')) {
|
27
27
|
items.push({
|
28
|
-
text:'
|
28
|
+
text:'Security',
|
29
29
|
iconCls:'icon-document_lock',
|
30
30
|
listeners:{
|
31
31
|
'click':function () {
|
@@ -147,37 +147,45 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.WestRegion", {
|
|
147
147
|
});
|
148
148
|
},
|
149
149
|
|
150
|
-
changeSecurityOnSection:function (node
|
151
|
-
var self = this;
|
152
|
-
self.setWindowStatus('Updating section...');
|
150
|
+
changeSecurityOnSection:function (node) {
|
153
151
|
Ext.Ajax.request({
|
154
|
-
url:'/knitkit/erp_app/desktop/
|
152
|
+
url:'/knitkit/erp_app/desktop/available_roles',
|
155
153
|
method:'POST',
|
156
|
-
params:{
|
157
|
-
id:node.data.id.split('_')[1],
|
158
|
-
site_id:node.data.siteId,
|
159
|
-
secure:secure
|
160
|
-
},
|
161
154
|
success:function (response) {
|
162
155
|
var obj = Ext.decode(response.responseText);
|
163
156
|
if (obj.success) {
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
157
|
+
Ext.create('widget.knikit_selectroleswindow',{
|
158
|
+
baseParams:{
|
159
|
+
id:node.data.id.split('_')[1],
|
160
|
+
site_id:node.get('siteId')
|
161
|
+
},
|
162
|
+
url:'/knitkit/erp_app/desktop/section/update_security',
|
163
|
+
currentRoles:node.get('roles'),
|
164
|
+
availableRoles:obj.availableRoles,
|
165
|
+
listeners:{
|
166
|
+
success:function(window, response){
|
167
|
+
node.set('roles', response.roles);
|
168
|
+
if (response.secured) {
|
169
|
+
node.set('iconCls', 'icon-document_lock');
|
170
|
+
}
|
171
|
+
else {
|
172
|
+
node.set('iconCls', 'icon-document');
|
173
|
+
}
|
174
|
+
node.set('isSecured', response.secured);
|
175
|
+
node.commit();
|
176
|
+
},
|
177
|
+
failure:function(){
|
178
|
+
Ext.Msg.alert('Error', 'Could not update security');
|
179
|
+
}
|
180
|
+
}
|
181
|
+
}).show();
|
173
182
|
}
|
174
183
|
else {
|
175
|
-
Ext.Msg.alert('Error', '
|
184
|
+
Ext.Msg.alert('Error', 'Could not load available roles');
|
176
185
|
}
|
177
186
|
},
|
178
187
|
failure:function (response) {
|
179
|
-
|
180
|
-
Ext.Msg.alert('Error', 'Error securing section.');
|
188
|
+
Ext.Msg.alert('Error', 'Could not load available roles');
|
181
189
|
}
|
182
190
|
});
|
183
191
|
},
|
@@ -383,6 +391,9 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.WestRegion", {
|
|
383
391
|
},
|
384
392
|
{
|
385
393
|
name:'publication_comments_enabled'
|
394
|
+
},
|
395
|
+
{
|
396
|
+
name:'roles'
|
386
397
|
}
|
387
398
|
],
|
388
399
|
listeners:{
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knitkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-03-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: erp_forms
|
@@ -145,6 +145,7 @@ files:
|
|
145
145
|
- public/javascripts/erp_app/desktop/applications/knitkit/publish_window.js
|
146
146
|
- public/javascripts/erp_app/desktop/applications/knitkit/published_grid_panel.js
|
147
147
|
- public/javascripts/erp_app/desktop/applications/knitkit/section_articles_grid_panel.js
|
148
|
+
- public/javascripts/erp_app/desktop/applications/knitkit/select_roles_window.js
|
148
149
|
- public/javascripts/erp_app/desktop/applications/knitkit/themes_tree_panel.js
|
149
150
|
- public/javascripts/erp_app/desktop/applications/knitkit/versions_grid_panel.js
|
150
151
|
- public/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/document.js
|