drg_blog_news_forum 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +65 -0
- data/Rakefile +34 -0
- data/app/assets/stylesheets/drg_blog_news_forum.css +162 -0
- data/app/controllers/drgcms_controls/dc_blog_dc_reply_control.rb +50 -0
- data/app/controllers/drgcms_controls/dc_forum_topic_control.rb +50 -0
- data/app/controllers/drgcms_controls/dc_forum_topic_dc_reply_control.rb +61 -0
- data/app/forms/cms_menu.yml +33 -0
- data/app/forms/dc_blog.yml +42 -0
- data/app/forms/dc_forum.yml +59 -0
- data/app/forms/dc_forum_policy_rule.yml +4 -0
- data/app/forms/dc_forum_topic.yml +30 -0
- data/app/forms/dc_reply.yml +25 -0
- data/app/helpers/dc_blog_renderer.rb +75 -0
- data/app/helpers/dc_forum_helper.rb +39 -0
- data/app/helpers/dc_forum_renderer.rb +79 -0
- data/app/models/dc_blog.rb +83 -0
- data/app/models/dc_forum.rb +45 -0
- data/app/models/dc_forum_policy_rule.rb +30 -0
- data/app/models/dc_forum_topic.rb +47 -0
- data/app/models/dc_news.rb +42 -0
- data/app/models/dc_reply.rb +39 -0
- data/app/models/dc_reply_concern.rb +45 -0
- data/app/views/dc_blog/_blog.html.erb +24 -0
- data/app/views/dc_blog/_blogers.html.erb +9 -0
- data/app/views/dc_blog/_entries.html.erb +13 -0
- data/app/views/dc_blog/_entry.html.erb +18 -0
- data/app/views/dc_forum/_forums.html.erb +33 -0
- data/app/views/dc_forum/_topic.html.erb +51 -0
- data/app/views/dc_forum/_topics.html.erb +44 -0
- data/app/views/dc_replay/_reply.html.erb +24 -0
- data/config/locales/dc_forum_en.yml +44 -0
- data/config/locales/dc_forum_sl.yml +45 -0
- data/config/locales/models_en.yml +118 -0
- data/config/locales/models_sl.yml +101 -0
- data/lib/drg_blog_news_forum/engine.rb +4 -0
- data/lib/drg_blog_news_forum/version.rb +3 -0
- data/lib/drg_blog_news_forum.rb +6 -0
- data/lib/tasks/drg_blog_news_forum_tasks.rake +44 -0
- data/test/drg_blog_news_forum_test.rb +7 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/test_helper.rb +15 -0
- metadata +118 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b88cecd9b28336d49f881c85207cbdb8ea4f9dde
|
4
|
+
data.tar.gz: b8287e2cefd66d96de4b0013465ba350ed015cd8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9248e5349a32ba9b95ddd9721b6ecf06bedcc89c238fe8ef981c93ccccc8665d803300819e09de506fb695c988f9fd943ad9d85cb104ca993110426afe4755d1
|
7
|
+
data.tar.gz: 14028d7cefac6ccdbd266a1733bf4bd5e4f8212087297536445afc4f6caddb9acc7b461ab8bbc8df2e9d79e29b43b801a99b3f49e7c562c3ace7c0c60de70ff8
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2014 YOURNAME
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
# DrgBlogNewsForum
|
2
|
+
|
3
|
+
DRG CMS DrgBlogNewsForum plugin implements basic funcionality for enabling blog, news or forum on your web site.
|
4
|
+
|
5
|
+
Configuration
|
6
|
+
----------------
|
7
|
+
|
8
|
+
Add this line to your gem file:
|
9
|
+
```ruby
|
10
|
+
gem 'drg_blog_news_forum'
|
11
|
+
```
|
12
|
+
|
13
|
+
Usage:
|
14
|
+
```yaml
|
15
|
+
fields:
|
16
|
+
10:
|
17
|
+
name: body
|
18
|
+
type: html_field
|
19
|
+
options: "height: 500, width: 550, toolbar: 'basic'"
|
20
|
+
|
21
|
+
20:
|
22
|
+
name: picture
|
23
|
+
type: file_select
|
24
|
+
html:
|
25
|
+
size: 50
|
26
|
+
```
|
27
|
+
|
28
|
+
Optional configuration in Site document:
|
29
|
+
```yaml
|
30
|
+
```
|
31
|
+
|
32
|
+
Documentation
|
33
|
+
-------------
|
34
|
+
|
35
|
+
Please see the DRG CMS website for up-to-date documentation:
|
36
|
+
[www.drgcms.org](http://www.drgcms.org)
|
37
|
+
|
38
|
+
License
|
39
|
+
-------
|
40
|
+
|
41
|
+
Copyright (c) 2012-2015 Damjan Rems
|
42
|
+
|
43
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
44
|
+
a copy of this software and associated documentation files (the
|
45
|
+
"Software"), to deal in the Software without restriction, including
|
46
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
47
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
48
|
+
permit persons to whom the Software is furnished to do so, subject to
|
49
|
+
the following conditions:
|
50
|
+
|
51
|
+
The above copyright notice and this permission notice shall be
|
52
|
+
included in all copies or substantial portions of the Software.
|
53
|
+
|
54
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
55
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
56
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
57
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
58
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
59
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
60
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
61
|
+
|
62
|
+
Credits
|
63
|
+
-------
|
64
|
+
|
65
|
+
Damjan Rems: damjan dot rems at gmail dot com
|
data/Rakefile
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'DrgBlogNewsForum'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.rdoc')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
Bundler::GemHelper.install_tasks
|
23
|
+
|
24
|
+
require 'rake/testtask'
|
25
|
+
|
26
|
+
Rake::TestTask.new(:test) do |t|
|
27
|
+
t.libs << 'lib'
|
28
|
+
t.libs << 'test'
|
29
|
+
t.pattern = 'test/**/*_test.rb'
|
30
|
+
t.verbose = false
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
task default: :test
|
@@ -0,0 +1,162 @@
|
|
1
|
+
/*
|
2
|
+
#--
|
3
|
+
# Copyright (c) 2014+ Damjan Rems
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
# a copy of this software and associated documentation files (the
|
7
|
+
# "Software"), to deal in the Software without restriction, including
|
8
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
# the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be
|
14
|
+
# included in all copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
23
|
+
#++
|
24
|
+
*/
|
25
|
+
|
26
|
+
#dc-forum {
|
27
|
+
background-color: white;
|
28
|
+
}
|
29
|
+
|
30
|
+
#dc-forum hr {
|
31
|
+
color: #ddd;
|
32
|
+
border: none;
|
33
|
+
height: 1px;
|
34
|
+
}
|
35
|
+
|
36
|
+
#dc-forum h1, #dc-forum h2 {
|
37
|
+
margin-bottom: 2px;
|
38
|
+
margin-top: 2px;
|
39
|
+
}
|
40
|
+
|
41
|
+
#dc-forum .forum-title {
|
42
|
+
background-color: #ddd;
|
43
|
+
border: 1px solid #d8d8d8;
|
44
|
+
border-top-left-radius: 3px;
|
45
|
+
border-top-right-radius: 3px;
|
46
|
+
padding: 4px;
|
47
|
+
}
|
48
|
+
|
49
|
+
#dc-forum .topic-odd, #dc-forum .topic-even {
|
50
|
+
padding: 4px;
|
51
|
+
border: 1px solid #ddd;
|
52
|
+
border-top: none;
|
53
|
+
font-size: 0.9em;
|
54
|
+
}
|
55
|
+
|
56
|
+
#dc-forum .topic-odd a, #dc-forum .topic-even a {
|
57
|
+
font-size: 1.5em;
|
58
|
+
}
|
59
|
+
|
60
|
+
#dc-forum .topic-odd{
|
61
|
+
background-color: #f8f8f8;
|
62
|
+
}
|
63
|
+
|
64
|
+
#dc-forum .topic-even{
|
65
|
+
background-color: #eee;
|
66
|
+
}
|
67
|
+
|
68
|
+
.forum-topics .topic {
|
69
|
+
padding: 4px;
|
70
|
+
background-color: #eee;
|
71
|
+
border: 1px solid #ddd;
|
72
|
+
border-top: none;
|
73
|
+
}
|
74
|
+
|
75
|
+
#dc-forum .reply-top-odd, #dc-forum .reply-top-even {
|
76
|
+
margin-top: 10px;
|
77
|
+
padding: 4px;
|
78
|
+
background: #eee;
|
79
|
+
border: 1px solid #ddd;
|
80
|
+
border-top-left-radius: 3px;
|
81
|
+
border-top-right-radius: 3px;
|
82
|
+
}
|
83
|
+
|
84
|
+
#dc-forum .reply-body-odd, #dc-forum .reply-body-even {
|
85
|
+
padding: 4px;
|
86
|
+
background: #f8f8f8;
|
87
|
+
border: 1px solid #ddd;
|
88
|
+
border-top: none;
|
89
|
+
border-bottom-left-radius: 3px;
|
90
|
+
border-bottom-right-radius: 3px;
|
91
|
+
}
|
92
|
+
|
93
|
+
#dc-forum .topic-top {
|
94
|
+
padding: 4px;
|
95
|
+
background: #eee;
|
96
|
+
border: 1px solid #ddd;
|
97
|
+
border-top: none;
|
98
|
+
}
|
99
|
+
|
100
|
+
#dc-forum .topic-body {
|
101
|
+
padding: 4px;
|
102
|
+
background: #f8f8f8;
|
103
|
+
border: 1px solid #ddd;
|
104
|
+
border-top: none;
|
105
|
+
}
|
106
|
+
|
107
|
+
.dc-forum-quote {
|
108
|
+
border-left: 2px solid #01b;
|
109
|
+
padding-left: 4px;
|
110
|
+
color: #01b;
|
111
|
+
}
|
112
|
+
|
113
|
+
#dc-forum-menu {
|
114
|
+
width: 100%;
|
115
|
+
margin-bottom: 3px;
|
116
|
+
margin-top: 3px;
|
117
|
+
}
|
118
|
+
|
119
|
+
#dc-forum .pagination {
|
120
|
+
}
|
121
|
+
|
122
|
+
#dc-forum .pagination span {
|
123
|
+
font-size: 1.6em;
|
124
|
+
padding: 2px 0px 2px 6px;
|
125
|
+
margin: 2px;
|
126
|
+
font-weight: bold;
|
127
|
+
border: 1px solid #eee;
|
128
|
+
background: linear-gradient(#eee 5%, #fff 100%);
|
129
|
+
border-radius: 2px;
|
130
|
+
}
|
131
|
+
|
132
|
+
/******* dc_blog *******/
|
133
|
+
|
134
|
+
.blog-subject {
|
135
|
+
font-size: 1.4em;
|
136
|
+
font-weight: bold;
|
137
|
+
}
|
138
|
+
.blog-date {
|
139
|
+
font-size: 1em;
|
140
|
+
color: #aaa;
|
141
|
+
}
|
142
|
+
.blog-body {
|
143
|
+
}
|
144
|
+
.blog-replies {
|
145
|
+
margin: 5px;
|
146
|
+
}
|
147
|
+
.reply-top-even {
|
148
|
+
padding:5px;
|
149
|
+
background-color: #ddd;
|
150
|
+
}
|
151
|
+
.reply-top-odd {
|
152
|
+
padding:5px;
|
153
|
+
background-color: #eee;
|
154
|
+
}
|
155
|
+
.blog-entry {
|
156
|
+
margin-top: 10px;
|
157
|
+
|
158
|
+
}
|
159
|
+
.blog-entry a:link {
|
160
|
+
font-size: 1.6em;
|
161
|
+
font-weight: bold;
|
162
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
#encoding: utf-8
|
2
|
+
#--
|
3
|
+
# Copyright (c) 2014+ Damjan Rems
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
# a copy of this software and associated documentation files (the
|
7
|
+
# "Software"), to deal in the Software without restriction, including
|
8
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
# the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be
|
14
|
+
# included in all copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
23
|
+
#++
|
24
|
+
|
25
|
+
######################################################################
|
26
|
+
# DrgcmsControls for DcBlog.DcReply form
|
27
|
+
######################################################################
|
28
|
+
module DrgcmsControls::DcBlogDcReplyControl
|
29
|
+
|
30
|
+
######################################################################
|
31
|
+
# Called when new empty record is created
|
32
|
+
######################################################################
|
33
|
+
def dc_new_record()
|
34
|
+
# fill with quote when reply_to is present
|
35
|
+
if params[:reply_to]
|
36
|
+
replyto = @record._parent.dc_replies.find(params[:reply_to])
|
37
|
+
@record.subject = "Re: #{replyto.subject}"
|
38
|
+
@record.body = "<div class='dc-forum-quote'>#{replyto.body}</div><br>"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
######################################################################
|
43
|
+
# Called before save. Reloads browser.
|
44
|
+
######################################################################
|
45
|
+
def dc_before_save()
|
46
|
+
@record.created_by_name = session[:user_name]
|
47
|
+
params[:return_to] = 'parent.reload'
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
#encoding: utf-8
|
2
|
+
#--
|
3
|
+
# Copyright (c) 2014+ Damjan Rems
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
# a copy of this software and associated documentation files (the
|
7
|
+
# "Software"), to deal in the Software without restriction, including
|
8
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
# the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be
|
14
|
+
# included in all copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
23
|
+
#++
|
24
|
+
|
25
|
+
######################################################################
|
26
|
+
# DrgcmsControls for DcForumTopic form
|
27
|
+
######################################################################
|
28
|
+
module DrgcmsControls::DcForumTopicControl
|
29
|
+
######################################################################
|
30
|
+
# Called when new empty record is created
|
31
|
+
######################################################################
|
32
|
+
def dc_new_record()
|
33
|
+
@record.dc_forum_id = params[:forum]
|
34
|
+
@record.created_by_name = session[:user_name]
|
35
|
+
end
|
36
|
+
|
37
|
+
######################################################################
|
38
|
+
# Called after succesfull save.
|
39
|
+
######################################################################
|
40
|
+
def dc_after_save()
|
41
|
+
# update forum statistics
|
42
|
+
forum = DcForum.find(@record.dc_forum_id).inc(topics: 1)
|
43
|
+
forum.topics += 1
|
44
|
+
forum.updated_by = session[:user_id]
|
45
|
+
forum.updated_by_name = session[:user_name]
|
46
|
+
forum.save
|
47
|
+
params[:return_to] = 'parent.reload'
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
#encoding: utf-8
|
2
|
+
#--
|
3
|
+
# Copyright (c) 2014+ Damjan Rems
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
# a copy of this software and associated documentation files (the
|
7
|
+
# "Software"), to deal in the Software without restriction, including
|
8
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
# the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be
|
14
|
+
# included in all copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
23
|
+
#++
|
24
|
+
|
25
|
+
######################################################################
|
26
|
+
# DrgcmsControls for DcForum.DcReply form
|
27
|
+
######################################################################
|
28
|
+
module DrgcmsControls::DcForumTopicDcReplyControl
|
29
|
+
|
30
|
+
######################################################################
|
31
|
+
# Called when new empty record is created
|
32
|
+
######################################################################
|
33
|
+
def dc_new_record()
|
34
|
+
# fill with quote when reply_to is present
|
35
|
+
if params[:reply_to]
|
36
|
+
replyto = @record._parent.dc_replies.find(params[:reply_to])
|
37
|
+
@record.subject = "Re: #{replyto.subject}"
|
38
|
+
@record.body = "<div class='dc-forum-quote'>#{replyto.body}</div><br>"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
######################################################################
|
43
|
+
# Called after succesfull save.
|
44
|
+
######################################################################
|
45
|
+
def dc_after_save()
|
46
|
+
# @record._parent.inc(replies: 1)
|
47
|
+
# update topic document
|
48
|
+
@record._parent.replies += 1
|
49
|
+
@record._parent.updated_by = session[:user_id]
|
50
|
+
@record._parent.updated_by_name = session[:user_name]
|
51
|
+
@record._parent.save
|
52
|
+
# update forum document
|
53
|
+
forum = DcForum.find(@record._parent.dc_forum_id)
|
54
|
+
forum.replies += 1
|
55
|
+
forum.updated_by_name = session[:user_name]
|
56
|
+
forum.save
|
57
|
+
#
|
58
|
+
params[:return_to] = 'parent.reload'
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2014+ Damjan Rems
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
# a copy of this software and associated documentation files (the
|
6
|
+
# "Software"), to deal in the Software without restriction, including
|
7
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
# the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be
|
13
|
+
# included in all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
#++
|
23
|
+
menu:
|
24
|
+
80_dc_forum_menu:
|
25
|
+
caption: dc_forum.menu_caption
|
26
|
+
items:
|
27
|
+
10:
|
28
|
+
caption: helpers.label.dc_forum.tabletitle
|
29
|
+
controller: cmsedit
|
30
|
+
picture: partner.png
|
31
|
+
params:
|
32
|
+
table: dc_forum
|
33
|
+
|
@@ -0,0 +1,42 @@
|
|
1
|
+
## YAML Template for Blog
|
2
|
+
---
|
3
|
+
table: dc_blog
|
4
|
+
|
5
|
+
index:
|
6
|
+
filter: subject, :created_by_name
|
7
|
+
actions: standard
|
8
|
+
|
9
|
+
result_set:
|
10
|
+
actions: standard
|
11
|
+
|
12
|
+
columns:
|
13
|
+
1:
|
14
|
+
name: subject
|
15
|
+
2:
|
16
|
+
name: created_by_name
|
17
|
+
4:
|
18
|
+
name: created_at
|
19
|
+
|
20
|
+
edit_title: subject
|
21
|
+
|
22
|
+
form:
|
23
|
+
actions: standard
|
24
|
+
|
25
|
+
fields:
|
26
|
+
10:
|
27
|
+
name: subject
|
28
|
+
type: text_field
|
29
|
+
html:
|
30
|
+
size: 50
|
31
|
+
|
32
|
+
20:
|
33
|
+
name: link
|
34
|
+
type: text_field
|
35
|
+
html:
|
36
|
+
size: 50
|
37
|
+
|
38
|
+
30:
|
39
|
+
name: body
|
40
|
+
type: html_field
|
41
|
+
options: 'height: 500'
|
42
|
+
|
@@ -0,0 +1,59 @@
|
|
1
|
+
## YAML Template for Polls
|
2
|
+
---
|
3
|
+
table: dc_forum
|
4
|
+
|
5
|
+
index:
|
6
|
+
filter: name, description
|
7
|
+
actions: standard
|
8
|
+
|
9
|
+
result_set:
|
10
|
+
actions: standard
|
11
|
+
|
12
|
+
columns:
|
13
|
+
1:
|
14
|
+
name: name
|
15
|
+
2:
|
16
|
+
name: site_id
|
17
|
+
eval: dc_name4_id,dc_site,name
|
18
|
+
3:
|
19
|
+
name: order
|
20
|
+
4:
|
21
|
+
name: active
|
22
|
+
eval: dc_icon4_boolean
|
23
|
+
|
24
|
+
edit_title: name
|
25
|
+
|
26
|
+
form:
|
27
|
+
actions: standard
|
28
|
+
|
29
|
+
fields:
|
30
|
+
10:
|
31
|
+
name: name
|
32
|
+
type: text_field
|
33
|
+
html:
|
34
|
+
size: 50
|
35
|
+
|
36
|
+
20:
|
37
|
+
name: description
|
38
|
+
type: text_area
|
39
|
+
html:
|
40
|
+
size: 80x10
|
41
|
+
|
42
|
+
30:
|
43
|
+
name: site_id
|
44
|
+
type: select
|
45
|
+
eval: DcSite.choices4_site
|
46
|
+
html:
|
47
|
+
include_blank: true
|
48
|
+
40:
|
49
|
+
name: order
|
50
|
+
type: text_field
|
51
|
+
html:
|
52
|
+
size: 3
|
53
|
+
|
54
|
+
50:
|
55
|
+
name: dc_policy_rules
|
56
|
+
type: embedded
|
57
|
+
formname: dc_policy_rule
|
58
|
+
html:
|
59
|
+
height: 400
|
@@ -0,0 +1,30 @@
|
|
1
|
+
## YAML Template for Polls
|
2
|
+
---
|
3
|
+
table: dc_forum_topic
|
4
|
+
|
5
|
+
|
6
|
+
form:
|
7
|
+
height: 600
|
8
|
+
labels_pos: top
|
9
|
+
actions:
|
10
|
+
1: save
|
11
|
+
|
12
|
+
fields:
|
13
|
+
10:
|
14
|
+
name: subject
|
15
|
+
type: text_field
|
16
|
+
html:
|
17
|
+
size: 80
|
18
|
+
|
19
|
+
20:
|
20
|
+
name: body
|
21
|
+
type: html_field
|
22
|
+
options: "height: 420, toolbar: 'basic'"
|
23
|
+
|
24
|
+
100:
|
25
|
+
name: dc_forum_id
|
26
|
+
type: hidden_field
|
27
|
+
110:
|
28
|
+
name: created_by_name
|
29
|
+
type: hidden_field
|
30
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
## YAML Template for Polls
|
2
|
+
---
|
3
|
+
table: dc_reply
|
4
|
+
|
5
|
+
form:
|
6
|
+
height: 600
|
7
|
+
labels_pos: top
|
8
|
+
actions:
|
9
|
+
1: save
|
10
|
+
|
11
|
+
fields:
|
12
|
+
10:
|
13
|
+
name: subject
|
14
|
+
type: text_field
|
15
|
+
html:
|
16
|
+
size: 80
|
17
|
+
|
18
|
+
20:
|
19
|
+
name: body
|
20
|
+
type: html_field
|
21
|
+
options: "height: 420, toolbar: 'basic'"
|
22
|
+
|
23
|
+
110:
|
24
|
+
name: created_by_name
|
25
|
+
type: hidden_field
|