qcms 1.3.10 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/controllers/documents_controller.rb +3 -20
- data/app/views/pages/bot_detected.html.erb +3 -0
- data/app/views/pages/contact.html.erb +2 -0
- data/app/views/pages/shared/_archive.erb +18 -0
- data/app/views/pages/shared/_related_pages.html.erb +5 -8
- data/app/views/pages/shared/_section_menu.html.erb +17 -0
- data/app/views/pages/shared/_sitemap.html.erb +7 -0
- data/qcms.gemspec +6 -2
- metadata +9 -5
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2.0.0
|
@@ -59,26 +59,12 @@ class DocumentsController < ApplicationController
|
|
59
59
|
|
60
60
|
# public facing creation of documents
|
61
61
|
def create
|
62
|
+
render :template => '/pages/bot_detected' and return unless params[:javascript_enabled] == 'true'
|
63
|
+
|
62
64
|
@document = Document.public.find(params[:id])
|
63
|
-
|
64
|
-
begin
|
65
|
-
do_human_test
|
66
|
-
rescue
|
67
|
-
flash.now[:notice] = 'You did not add up the numbers correctly, please try again.'
|
68
|
-
|
69
|
-
new_document = Document.new
|
70
|
-
new_document.body = params[:document][:body]
|
71
|
-
|
72
|
-
eval("@new_#{params[:label]} = new_document")
|
73
|
-
|
74
|
-
setup_view_environment
|
75
|
-
render :template => view_for
|
76
|
-
return
|
77
|
-
end
|
78
|
-
|
65
|
+
|
79
66
|
params[:document][:state] = nil # prevent auto approval hack (FIXME: use attr_protected)
|
80
67
|
|
81
|
-
|
82
68
|
if @document.meta_definition_for(params[:label]).allowed? current_user, 'create'
|
83
69
|
|
84
70
|
new_document = Document.new(params[:document])
|
@@ -131,9 +117,6 @@ class DocumentsController < ApplicationController
|
|
131
117
|
end
|
132
118
|
end
|
133
119
|
|
134
|
-
def do_human_test
|
135
|
-
raise 'Human Test Failed' unless params[:human_test][:answer].crypt('humAn5') == params[:human_test][:crypted_answer]
|
136
|
-
end
|
137
120
|
|
138
121
|
def setup_view_environment
|
139
122
|
# create children vars such as @comments
|
@@ -15,6 +15,7 @@
|
|
15
15
|
<!-- <input type="hidden" name="meta[message]" value="Thank you!" /> -->
|
16
16
|
<input type="hidden" name="meta[show_page]" value="thank_you" />
|
17
17
|
|
18
|
+
<input id="javascript_enabled" type="hidden" name="javascript_enabled" value="false" />
|
18
19
|
|
19
20
|
<input type="submit" name="submit" value="Send" />
|
20
21
|
</form>
|
@@ -28,6 +29,7 @@
|
|
28
29
|
<script>
|
29
30
|
$(document).ready(function() {
|
30
31
|
$('form').validate();
|
32
|
+
$('#javascript_enabled').attr('value'', 'true');
|
31
33
|
});
|
32
34
|
|
33
35
|
$('#message').blur(function(){
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<%
|
2
|
+
document ||= @document
|
3
|
+
skip_empty_months ||= true
|
4
|
+
-%>
|
5
|
+
<% document.archive.each do | year, posts_by_month | -%>
|
6
|
+
<ul class="submenu">
|
7
|
+
<h4><%= year %></h4>
|
8
|
+
<ul>
|
9
|
+
<% (1..12).each do | month | -%>
|
10
|
+
<% next if skip_empty_months && posts_by_month[month].empty? %>
|
11
|
+
<li>
|
12
|
+
<a href="<%= document_archive_path(document, month_name(month), year) %>"><%= month_name(month) %></a>
|
13
|
+
<span>(<%= posts_by_month[month].size %>)</span><label></label>
|
14
|
+
</li>
|
15
|
+
<% end -%>
|
16
|
+
</ul>
|
17
|
+
</ul>
|
18
|
+
<% end -%>
|
@@ -1,13 +1,10 @@
|
|
1
1
|
<%
|
2
|
-
|
3
|
-
heading ||= 'Related Pages'
|
4
|
-
page ||= @document
|
2
|
+
document ||= @document
|
5
3
|
-%>
|
6
|
-
<% unless
|
7
|
-
<h3><%= heading %></h3>
|
4
|
+
<% unless document.siblings.empty? -%>
|
8
5
|
<ol id="related_pages">
|
9
|
-
<%
|
10
|
-
<li><a href="<%= document_path(
|
6
|
+
<% Document.ordered_siblings_for(document).each do | doc | -%>
|
7
|
+
<li><a href="<%= document_path(doc) %>"><%= doc.title %></a></li>
|
11
8
|
<% end -%>
|
12
9
|
</ol>
|
13
|
-
<% end
|
10
|
+
<% end -%>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<%
|
2
|
+
document ||= @document.root
|
3
|
+
id ||= document.root? ? 'section_menu' : ''
|
4
|
+
order ||= 'title ASC'
|
5
|
+
|
6
|
+
-%>
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
<ul id="<%= id %>">
|
12
|
+
<% document.children.public.order_by(order).each do | child_document | %>
|
13
|
+
<li><a href="<%= document_path(child_document) %>"><%= child_document.title %></a>
|
14
|
+
<%= render :partial => 'pages/shared/section_menu', :locals => { :document => child_document } unless document.children.empty? %>
|
15
|
+
</li>
|
16
|
+
<% end %>
|
17
|
+
</ul>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<%
|
2
|
+
order = document.meta_definition.children.by_label(label).first.sort_by || Settings.documents._sort_by
|
3
|
+
documents = document.children.by_label(label).order_by(order).public
|
4
|
+
-%>
|
5
|
+
<% documents.each do |d| -%>
|
6
|
+
<li><a href='<%= document_path(d) %>'><%= d.title %></a>
|
7
|
+
<% end -%>
|
data/qcms.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{qcms}
|
8
|
-
s.version = "
|
8
|
+
s.version = "2.0.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Kris Leech"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-11-15}
|
13
13
|
s.description = %q{Key CMS features: extended template pathing, sitemap.yml, simple configurable, deeply nestable content}
|
14
14
|
s.email = %q{kris.leech@interkonect.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -47,13 +47,17 @@ Gem::Specification.new do |s|
|
|
47
47
|
"app/views/layouts/application.html.erb",
|
48
48
|
"app/views/layouts/system.html.erb",
|
49
49
|
"app/views/pages/404.html.erb",
|
50
|
+
"app/views/pages/bot_detected.html.erb",
|
50
51
|
"app/views/pages/contact.html.erb",
|
51
52
|
"app/views/pages/default.html.erb",
|
52
53
|
"app/views/pages/feed.rss.builder",
|
53
54
|
"app/views/pages/home.html.erb",
|
54
55
|
"app/views/pages/search.html.erb",
|
56
|
+
"app/views/pages/shared/_archive.erb",
|
55
57
|
"app/views/pages/shared/_archived_pages.erb",
|
56
58
|
"app/views/pages/shared/_related_pages.html.erb",
|
59
|
+
"app/views/pages/shared/_section_menu.html.erb",
|
60
|
+
"app/views/pages/shared/_sitemap.html.erb",
|
57
61
|
"app/views/pages/sitemap.html.erb",
|
58
62
|
"app/views/pages/template.erb",
|
59
63
|
"app/views/pages/thank_you.html.erb",
|
metadata
CHANGED
@@ -4,10 +4,10 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
hash: 15
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
|
-
-
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version:
|
7
|
+
- 2
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
version: 2.0.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kris Leech
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-11-15 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -59,13 +59,17 @@ files:
|
|
59
59
|
- app/views/layouts/application.html.erb
|
60
60
|
- app/views/layouts/system.html.erb
|
61
61
|
- app/views/pages/404.html.erb
|
62
|
+
- app/views/pages/bot_detected.html.erb
|
62
63
|
- app/views/pages/contact.html.erb
|
63
64
|
- app/views/pages/default.html.erb
|
64
65
|
- app/views/pages/feed.rss.builder
|
65
66
|
- app/views/pages/home.html.erb
|
66
67
|
- app/views/pages/search.html.erb
|
68
|
+
- app/views/pages/shared/_archive.erb
|
67
69
|
- app/views/pages/shared/_archived_pages.erb
|
68
70
|
- app/views/pages/shared/_related_pages.html.erb
|
71
|
+
- app/views/pages/shared/_section_menu.html.erb
|
72
|
+
- app/views/pages/shared/_sitemap.html.erb
|
69
73
|
- app/views/pages/sitemap.html.erb
|
70
74
|
- app/views/pages/template.erb
|
71
75
|
- app/views/pages/thank_you.html.erb
|