knitkit 2.1.13 → 2.1.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -31,6 +31,7 @@ module Knitkit
31
31
  def set_section
32
32
  unless params[:section_id].nil?
33
33
  @website_section = WebsiteSection.find(params[:section_id])
34
+ @website_section = @website_section.root if @website_section.is_document_section? # check security on root document section
34
35
  if @website_section.protected_with_capability?(:view)
35
36
  if !current_user and @website_section.path != @login_path
36
37
  session[:return_to_url] = @website_section.path
@@ -4,8 +4,8 @@ module Knitkit
4
4
 
5
5
  layout 'knitkit/online_document_sections'
6
6
 
7
- before_filter :find_root
8
- before_filter :find_document_sections, :only => :build_tree
7
+ append_before_filter :find_root
8
+ append_before_filter :find_document_sections, :only => :build_tree
9
9
 
10
10
  def index
11
11
  @online_document = OnlineDocumentSection.find(params[:section_id])
@@ -31,8 +31,10 @@ module Knitkit
31
31
  end
32
32
 
33
33
  def get_content
34
- document_section = OnlineDocumentSection.find(params[:document_section_id])
35
- content = document_section.documented_item_published_content(@active_publication)
34
+ document_section = OnlineDocumentSection.where(:internal_identifier => params[:document_section_id]).first
35
+ content = document_section.documented_item_published_content(@active_publication) unless @active_publication.nil?
36
+ content = document_section.documented_item.content if @active_publication.nil? or content.nil?
37
+
36
38
  if document_section.use_markdown and content
37
39
  html = Kramdown::Document.new(content.body_html).to_html
38
40
  else
@@ -226,11 +226,10 @@
226
226
  resize_windows();
227
227
 
228
228
  // Load root page
229
-
230
229
  Ext.Ajax.request({
231
230
  url: '/online_document_sections/get_content',
232
231
  params: {
233
- document_section_id:<%= @root.id %>,
232
+ document_section_id:'<%= @root.internal_identifier %>',
234
233
  section_id:<%= @root.id %>
235
234
  },
236
235
  success: function (response) {
@@ -2,7 +2,7 @@ module Knitkit
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 2
4
4
  MINOR = 1
5
- TINY = 13
5
+ TINY = 14
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].compact.join('.')
8
8
  end
@@ -1,4 +1,16 @@
1
1
  Compass.ErpApp.Desktop.Applications.Knitkit.addDocumentOptions = function (self, items, record) {
2
+ if (currentUser.hasCapability('unsecure','WebsiteSection') || currentUser.hasCapability('secure','WebsiteSection')) {
3
+ items.push({
4
+ text:'Security',
5
+ iconCls:'icon-document_lock',
6
+ listeners:{
7
+ 'click':function () {
8
+ self.changeSecurity(record, '/knitkit/erp_app/desktop/section/update_security', record.data.id.split('_')[1]);
9
+ }
10
+ }
11
+ });
12
+ }
13
+
2
14
  if (currentUser.hasCapability('create','WebsiteSection')) {
3
15
  items.push({
4
16
  text:'Add Document',
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.13
4
+ version: 2.1.14
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-08-14 00:00:00.000000000 Z
12
+ date: 2013-08-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: erp_forms