knitkit 2.1.3 → 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. data/app/controllers/knitkit/base_controller.rb +1 -0
  2. data/app/controllers/knitkit/erp_app/desktop/app_controller.rb +2 -0
  3. data/app/controllers/knitkit/erp_app/desktop/content_controller.rb +2 -2
  4. data/app/controllers/knitkit/erp_app/desktop/website_nav_controller.rb +17 -7
  5. data/app/controllers/knitkit/erp_app/desktop/website_section_controller.rb +8 -1
  6. data/app/controllers/knitkit/online_document_sections_controller.rb +25 -17
  7. data/app/models/documented_content.rb +3 -3
  8. data/app/models/online_document_section.rb +1 -0
  9. data/app/models/published_website.rb +18 -11
  10. data/app/models/website.rb +49 -28
  11. data/app/models/website_nav_item.rb +12 -0
  12. data/app/models/website_section.rb +1 -3
  13. data/app/views/knitkit/online_document_sections/index.html.erb +77 -46
  14. data/app/views/layouts/knitkit/online_document_sections.html.erb +13 -14
  15. data/app/widgets/login/base.rb +1 -1
  16. data/config/routes.rb +1 -1
  17. data/db/migrate/20110211002317_setup_knitkit.rb +1 -0
  18. data/db/migrate/20130405184234_add_use_markdown_to_section.rb +19 -0
  19. data/lib/knitkit/extensions/railties/action_view/helpers/knitkit_helper.rb +1 -1
  20. data/lib/knitkit/extensions/railties/action_view/helpers/menu_helper.rb +0 -1
  21. data/lib/knitkit/version.rb +1 -1
  22. data/public/javascripts/erp_app/desktop/applications/knitkit/articles_grid_panel.js +1 -0
  23. data/public/javascripts/erp_app/desktop/applications/knitkit/center_region.js +109 -26
  24. data/public/javascripts/erp_app/desktop/applications/knitkit/section_articles_grid_panel.js +60 -61
  25. data/public/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/document.js +26 -0
  26. data/public/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/menu.js +3 -2
  27. data/public/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/section.js +9 -24
  28. data/public/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/website_nav_items.js +232 -248
  29. data/public/javascripts/erp_app/desktop/applications/knitkit/west_region/west_region.js +33 -43
  30. metadata +19 -3
  31. data/public/stylesheets/knitkit/documentation.css +0 -50
@@ -68,7 +68,8 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.WestRegion", {
68
68
  self.clearWindowStatus();
69
69
  var obj = Ext.decode(response.responseText);
70
70
  if (obj.success) {
71
- node.remove(true);
71
+ node.removeAll();
72
+ node.remove();
72
73
  }
73
74
  else {
74
75
  Ext.Msg.alert('Error', 'Error deleting Website');
@@ -147,7 +148,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.WestRegion", {
147
148
  });
148
149
  },
149
150
 
150
- changeSecurityOnSection:function (node) {
151
+ changeSecurity:function (node, updateUrl, id) {
151
152
  Ext.Ajax.request({
152
153
  url:'/knitkit/erp_app/desktop/available_roles',
153
154
  method:'POST',
@@ -156,10 +157,10 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.WestRegion", {
156
157
  if (obj.success) {
157
158
  Ext.create('widget.knikit_selectroleswindow',{
158
159
  baseParams:{
159
- id:node.data.id.split('_')[1],
160
+ id:id,
160
161
  site_id:node.get('siteId')
161
162
  },
162
- url:'/knitkit/erp_app/desktop/section/update_security',
163
+ url: updateUrl,
163
164
  currentRoles:node.get('roles'),
164
165
  availableRoles:obj.availableRoles,
165
166
  listeners:{
@@ -190,41 +191,6 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.WestRegion", {
190
191
  });
191
192
  },
192
193
 
193
- changeSecurityOnMenuItem:function (node, secure) {
194
- var self = this;
195
- self.setWindowStatus('Updating menu item security...');
196
- Ext.Ajax.request({
197
- url:'/knitkit/erp_app/desktop/website_nav/update_security',
198
- method:'POST',
199
- params:{
200
- id:node.data.websiteNavItemId,
201
- site_id:node.data.websiteId,
202
- secure:secure
203
- },
204
- success:function (response) {
205
- var obj = Ext.decode(response.responseText);
206
- if (obj.success) {
207
- self.clearWindowStatus();
208
- if (secure) {
209
- node.set('iconCls', 'icon-document_lock');
210
- }
211
- else {
212
- node.set('iconCls', 'icon-document');
213
- }
214
- node.set('isSecured', secure);
215
- node.commit();
216
- }
217
- else {
218
- Ext.Msg.alert('Error', 'Error securing menu item');
219
- }
220
- },
221
- failure:function (response) {
222
- self.clearWindowStatus();
223
- Ext.Msg.alert('Error', 'Error securing menu item');
224
- }
225
- });
226
- },
227
-
228
194
  selectWebsite:function (websiteId) {
229
195
  var node = this.sitesTree.getStore().getNodeById("website_" + websiteId);
230
196
  if (node.data.iconCls != 'icon-globe') {
@@ -394,13 +360,18 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.WestRegion", {
394
360
  },
395
361
  {
396
362
  name:'roles'
363
+ },
364
+ {
365
+ name:'useMarkdown'
397
366
  }
398
367
  ],
399
368
  listeners:{
400
369
  'load':function(store, node, records){
401
- var websiteId = records[0].id.split('_')[1];
402
- var westRegion = Ext.ComponentQuery.query('#knitkitWestRegion').first();
403
- westRegion.selectWebsite(websiteId);
370
+ if(records.length > 0){
371
+ var websiteId = records[0].id.split('_')[1];
372
+ westRegion = Ext.ComponentQuery.query('#knitkitWestRegion').first();
373
+ westRegion.selectWebsite(websiteId);
374
+ }
404
375
  }
405
376
  }
406
377
  });
@@ -500,7 +471,26 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.WestRegion", {
500
471
  webNavigator.createWindow(record.data['url']);
501
472
  }
502
473
  else if (record.data['isDocument']) {
503
- self.initialConfig['centerRegion'].editContent(record.data['contentInfo'].title, record.data['contentInfo'].id, record.data['contentInfo'].body_html, record.data['siteId'], 'article');
474
+ var contentInfo = record.data['contentInfo'];
475
+ if(record.data['useMarkdown']){
476
+ self.initialConfig['centerRegion'].editDocumentationMarkdown(
477
+ contentInfo.title,
478
+ record.data['siteId'],
479
+ contentInfo.id,
480
+ contentInfo.body_html,
481
+ []
482
+ );
483
+ }
484
+ else{
485
+ self.initialConfig['centerRegion'].editContent(
486
+ record.data['contentInfo'].title,
487
+ record.data['contentInfo'].id,
488
+ record.data['contentInfo'].body_html,
489
+ record.data['siteId'],
490
+ 'article'
491
+ );
492
+ }
493
+
504
494
  }
505
495
  },
506
496
  'itemcontextmenu':function (view, record, htmlItem, index, e) {
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.3
4
+ version: 2.1.4
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-03-14 00:00:00.000000000 Z
12
+ date: 2013-04-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: erp_forms
@@ -107,6 +107,22 @@ dependencies:
107
107
  - - '='
108
108
  - !ruby/object:Gem::Version
109
109
  version: 2.3.3
110
+ - !ruby/object:Gem::Dependency
111
+ name: github-markdown
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - '='
116
+ - !ruby/object:Gem::Version
117
+ version: 0.5.3
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - '='
124
+ - !ruby/object:Gem::Version
125
+ version: 0.5.3
110
126
  description: Knitkit is CompassAE's content and digital asset management application.
111
127
  It is based on ideas and code adapted from Mephisto and adva_cms, with significant
112
128
  changes to integrate with the CompassAE object-relational layer and to harmonize
@@ -161,7 +177,6 @@ files:
161
177
  - public/stylesheets/datepicker.css
162
178
  - public/stylesheets/erp_app/desktop/applications/knitkit/knitkit.css
163
179
  - public/stylesheets/extjs/resources/css/knitkit_extjs_4.css
164
- - public/stylesheets/knitkit/documentation.css
165
180
  - public/stylesheets/knitkit/inline_editing.css
166
181
  - public/stylesheets/knitkit/style.css
167
182
  - app/assets/javascripts/knitkit/application.js
@@ -301,6 +316,7 @@ files:
301
316
  - db/data_migrations/20120809020508_update_website_and_configuration.rb
302
317
  - db/data_migrations/20121129185611_upgrade_website_role_iid.rb
303
318
  - db/migrate/20110211002317_setup_knitkit.rb
319
+ - db/migrate/20130405184234_add_use_markdown_to_section.rb
304
320
  - lib/knitkit/config.rb
305
321
  - lib/knitkit/engine.rb
306
322
  - lib/knitkit/extensions/action_controller/theme_support/acts_as_themed_controller.rb
@@ -1,50 +0,0 @@
1
- html, body { height: 100%; }
2
-
3
- #main{
4
- min-height: 100%;
5
- }
6
-
7
- #document_content{
8
- margin: 0 auto 0 auto;
9
- width: 897px;
10
- padding: 10px 22px 62px 22px;
11
- background: #FFF url(../../images/knitkit/content.png) repeat-y;*/
12
- }
13
-
14
- #footer{
15
- position: relative;
16
- margin-top: -62px;
17
- clear: both;
18
- height: 62px;
19
- }
20
-
21
- /*Opera Fix*/
22
- body:before {
23
- content: "";
24
- height: 100%;
25
- float: left;
26
- width: 0;
27
- margin-top: -32767px;/
28
- }
29
-
30
- /* this corrects a rendering issue */
31
- #menubar ul li a
32
- {
33
- -moz-box-sizing:content-box;
34
- -ms-box-sizing:content-box;
35
- -webkit-box-sizing:content-box;
36
- box-sizing:content-box;
37
- }
38
-
39
- ::-webkit-scrollbar {
40
- height: 1ex;
41
- width: 6px;
42
- -webkit-border-radius: 1ex;
43
- background: #FFF;
44
- }
45
-
46
- ::-webkit-scrollbar-thumb:vertical{
47
- background: rgba(0, 0, 0, .2);
48
- -webkit-border-radius: 1ex;
49
- }
50
-