documentation 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 520e069661e53c4c070266cf3c339de59a4ea842
4
- data.tar.gz: 85bb9754a1fcc14e68d433a0f83d4ed77c48e1d4
3
+ metadata.gz: cab528824c7fab1863c090801877ae911fd6a7cc
4
+ data.tar.gz: ad6380d770fed9ca096a7cf9852be75ceb76e028
5
5
  SHA512:
6
- metadata.gz: 01058094e255fd916be2252042c7a2f05b8d86d4e4a8ab61b021ed2a09934d2843b1be433834528de0a437679dd8c95735dbb38366331c7d420f75f069a0f347
7
- data.tar.gz: aa86c964d041987c69be24ac45300814255a7f30aca45ba8b0214468da72a37c5c8b886e351b2ef0ca1c1b669f74db793069ab46bac386374251c7690db2c4f4
6
+ metadata.gz: f68be8e46d201e8f4cccc64c97ae01f6da4ab1be0a54fa30b37edd7a9c6ecb8ee91bb6c185b3737768049b6b5978772b6d922f565253be11e1264b40c8ddc341
7
+ data.tar.gz: 22cebaf4439f0e4910110245bcfded91198f3c2be9c00adfb1d5a1d02972cc58beb58500df10b7507a73f05815112dc5f319a677ef8fe6f24df844fcb3a1e177
@@ -1,3 +1,3 @@
1
1
  module Documentation
2
- VERSION = '1.0.6'
2
+ VERSION = '1.0.7'
3
3
  end
@@ -1,44 +1,44 @@
1
1
  module Documentation
2
2
  module ViewHelpers
3
-
3
+
4
4
  #
5
5
  # Path to edit a page in the manager UI
6
6
  #
7
7
  def documentation_edit_page_path(page)
8
8
  "#{::Documentation::Engine.mounted_path}/edit/#{page.full_permalink}"
9
9
  end
10
-
10
+
11
11
  #
12
12
  # Path to view a page in the manager UI
13
13
  #
14
14
  def documentation_page_path(page)
15
15
  "#{::Documentation::Engine.mounted_path}/#{page.try(:full_permalink)}"
16
16
  end
17
-
17
+
18
18
  #
19
19
  # Return a breadcrumb for the given page
20
20
  #
21
21
  def documentation_breadcrumb_for(page, options = {})
22
22
  options[:root_link] = options[:root_link].nil? ? t('documentation.helpers.documentation_breadcrumb_for.default_root_link') : options[:root_link]
23
23
  options[:class] ||= 'breadcrumb'
24
-
24
+
25
25
  String.new.tap do |s|
26
26
  s << "<nav class='#{options[:class]}'><ul>"
27
-
27
+
28
28
  if options[:root_link]
29
29
  s << "<li><a href='#{documentation_doc_root.blank? ? '/' : documentation_doc_root}'>#{options[:root_link]}</a></li>"
30
30
  end
31
-
31
+
32
32
  if page.is_a?(::Documentation::Page)
33
33
  page.breadcrumb.each do |child|
34
34
  s << "<li><a href='#{documentation_doc_root}/#{child.full_permalink}'>#{child.title}</a></li>"
35
35
  end
36
36
  end
37
-
37
+
38
38
  s << "</ul></nav>"
39
39
  end.html_safe
40
40
  end
41
-
41
+
42
42
  #
43
43
  # Return a default navigation tree for the given page
44
44
  #
@@ -56,39 +56,39 @@ module Documentation
56
56
  end
57
57
  s << "</ul>"
58
58
  end
59
- s << "</li>"
59
+ s << "</li>"
60
60
  end
61
61
  else
62
- ::Documentation::Page.roots.each do |page|
62
+ ::Documentation::Page.roots.select { |p| documentation_authorizer.can_view_page?(p) }.each do |page|
63
63
  s << "<li><a href='#{documentation_doc_root}/#{page.full_permalink}'>#{page.title}</a></li>"
64
64
  end
65
65
  end
66
66
  s << "</ul>"
67
67
  end.html_safe
68
68
  end
69
-
69
+
70
70
  #
71
71
  # Return appropriate content for a given page
72
72
  #
73
73
  def documentation_content_for(page)
74
74
  # Get the content
75
75
  content = page.compiled_content.to_s
76
-
76
+
77
77
  # Insert navigation
78
- content.gsub!("<p class=''>{{nav}}</p>") do
78
+ content.gsub!("<p class=''>{{nav}}</p>") do
79
79
  children = page.children
80
80
  children = children.select { |c| documentation_authorizer.can_view_page?(c) }
81
81
  items = children.map { |c| "<li><a href='#{documentation_doc_root}/#{c.full_permalink}'>#{c.title}</a></li>" }.join
82
82
  "<ul class='pages'>#{items}</ul>"
83
83
  end
84
-
84
+
85
85
  # Set the document root as appropriate
86
86
  content.gsub!("{{docRoot}}", documentation_doc_root)
87
-
87
+
88
88
  # Return HTML safe content
89
89
  content.html_safe
90
90
  end
91
-
91
+
92
92
  #
93
93
  # Return the documentation document root
94
94
  #
@@ -101,21 +101,21 @@ module Documentation
101
101
  end
102
102
  end
103
103
  end
104
-
104
+
105
105
  #
106
- # Return the documentation authorizer
106
+ # Return the documentation authorizer
107
107
  #
108
108
  def documentation_authorizer
109
109
  @documentation_authorizer ||= Documentation.config.authorizer.new(controller)
110
110
  end
111
-
112
- #
111
+
112
+ #
113
113
  # Return summary information for search results
114
114
  #
115
115
  def documentation_search_summary(result)
116
116
  t('documentation.helpers.documentation_search_summary.text', :total_results => result.total_results, :start_result => result.start_result_number, :end_result => result.end_result_number, :query => result.query)
117
117
  end
118
-
118
+
119
119
  #
120
120
  # Return the search results
121
121
  #
@@ -137,7 +137,7 @@ module Documentation
137
137
  s << "</ul>"
138
138
  end.html_safe
139
139
  end
140
-
140
+
141
141
  #
142
142
  # Return search pagination links
143
143
  #
@@ -154,6 +154,6 @@ module Documentation
154
154
  end
155
155
  end.html_safe
156
156
  end
157
-
157
+
158
158
  end
159
159
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: documentation
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Cooke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-21 00:00:00.000000000 Z
11
+ date: 2014-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails