drg_blog_news_forum 0.6.0 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/{controllers/drgcms_controls → controls}/dc_blog_dc_reply_control.rb +1 -1
- data/app/{controllers/drgcms_controls → controls}/dc_forum_topic_control.rb +1 -1
- data/app/{controllers/drgcms_controls → controls}/dc_forum_topic_dc_reply_control.rb +1 -1
- data/app/{controllers/drgcms_controls → controls}/dc_news_dc_reply_control.rb +1 -1
- data/app/{controllers/drgcms_controls → controls}/reply_control.rb +1 -1
- data/app/forms/cms_menu.yml +5 -5
- data/app/helpers/application_helper.rb +1 -1
- data/app/helpers/dc_bnf_helper.rb +1 -1
- data/app/models/dc_blog.rb +5 -4
- data/app/models/dc_news.rb +1 -0
- data/app/renderers/dc_blog_renderer.rb +12 -4
- data/app/renderers/dc_forum_renderer.rb +1 -1
- data/app/renderers/dc_news_renderer.rb +1 -0
- data/app/views/dc_blog/_bloggers.html.erb +1 -1
- data/app/views/dc_blog/_list.html.erb +1 -1
- data/app/views/dc_forum/_forums.html.erb +3 -1
- data/app/views/dc_forum/_topic.html.erb +1 -1
- data/app/views/dc_forum/_topics.html.erb +3 -3
- data/app/views/dc_replay/_reply.html.erb +1 -2
- data/config/locales/models_sl.yml +1 -0
- data/lib/drg_blog_news_forum/version.rb +1 -1
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7c8446ea001f5ab43f8a72b31734c3d47a6bb91c4e20a2d7809637955c46f24
|
4
|
+
data.tar.gz: f0611acafe1e371e2a0f7ed22ca0fa7ab56b1fb3f0479af95ac0c4bbf66377be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88a6ad9c75a57da86b02a2d6a7d7822fbd3793e206f04896d5ade42055c943e7d66b5b3f80c9fb653c247b61bd2b0cf36e3717c226191528cb32e109b15bb3d3
|
7
|
+
data.tar.gz: b3f17504472c9aaf4644727a32a3dde78e5c31181bd47aaa4a62050e6d1210574f8c8c82c804845f5f88c404ca03d489e5241abe241dd25c2b044fa86048924a
|
data/README.md
CHANGED
@@ -30,7 +30,7 @@ Please see the DRG CMS website for up-to-date documentation:
|
|
30
30
|
License
|
31
31
|
-------
|
32
32
|
|
33
|
-
Copyright (c) 2014-
|
33
|
+
Copyright (c) 2014-2022 Damjan Rems
|
34
34
|
|
35
35
|
Permission is hereby granted, free of charge, to any person obtaining
|
36
36
|
a copy of this software and associated documentation files (the
|
@@ -25,7 +25,7 @@
|
|
25
25
|
######################################################################
|
26
26
|
# DrgcmsControls for DcBlog.DcReply form
|
27
27
|
######################################################################
|
28
|
-
module
|
28
|
+
module DcBlogDcReplyControl
|
29
29
|
|
30
30
|
######################################################################
|
31
31
|
# Called when new empty record is created
|
@@ -25,7 +25,7 @@
|
|
25
25
|
######################################################################
|
26
26
|
# DrgcmsControls for DcForumTopic form
|
27
27
|
######################################################################
|
28
|
-
module
|
28
|
+
module DcForumTopicControl
|
29
29
|
######################################################################
|
30
30
|
# Called when new empty record is created
|
31
31
|
######################################################################
|
@@ -25,7 +25,7 @@
|
|
25
25
|
######################################################################
|
26
26
|
# DrgcmsControls for DcForum.DcReply form
|
27
27
|
######################################################################
|
28
|
-
module
|
28
|
+
module DcForumTopicDcReplyControl
|
29
29
|
|
30
30
|
######################################################################
|
31
31
|
# Called when new empty record is created
|
@@ -25,7 +25,7 @@
|
|
25
25
|
######################################################################
|
26
26
|
# DrgcmsControls for DcBlog.DcReply form
|
27
27
|
######################################################################
|
28
|
-
module
|
28
|
+
module DcNewsDcReplyControl
|
29
29
|
|
30
30
|
######################################################################
|
31
31
|
# Called when new empty record is created
|
@@ -25,7 +25,7 @@
|
|
25
25
|
######################################################################
|
26
26
|
# DrgcmsControls for DcBlog.DcReply form
|
27
27
|
######################################################################
|
28
|
-
module
|
28
|
+
module ReplyControl
|
29
29
|
|
30
30
|
######################################################################
|
31
31
|
# Called when new empty record is created
|
data/app/forms/cms_menu.yml
CHANGED
@@ -23,26 +23,26 @@
|
|
23
23
|
menu:
|
24
24
|
80_dc_forum_menu:
|
25
25
|
caption: dc_forum.menu_caption
|
26
|
-
icon:
|
26
|
+
icon: forum
|
27
27
|
items:
|
28
28
|
10:
|
29
29
|
caption: helpers.label.dc_blog.tabletitle
|
30
30
|
controller: cmsedit
|
31
|
-
icon: comment-o
|
31
|
+
icon: comment-o
|
32
32
|
table: dc_blog
|
33
33
|
20:
|
34
34
|
caption: helpers.label.dc_news.tabletitle
|
35
35
|
controller: cmsedit
|
36
|
-
icon: info
|
36
|
+
icon: info-o
|
37
37
|
table: dc_news
|
38
38
|
30:
|
39
39
|
caption: helpers.label.dc_forum.tabletitle
|
40
40
|
controller: cmsedit
|
41
|
-
icon:
|
41
|
+
icon: forum-o
|
42
42
|
table: dc_forum
|
43
43
|
40:
|
44
44
|
caption: helpers.label.dc_reply.tabletitle
|
45
45
|
controller: cmsedit
|
46
|
-
icon:
|
46
|
+
icon: comment-o
|
47
47
|
table: dc_reply
|
48
48
|
|
@@ -1,2 +1,2 @@
|
|
1
1
|
module ApplicationHelper
|
2
|
-
end
|
2
|
+
end
|
data/app/models/dc_blog.rb
CHANGED
@@ -46,8 +46,9 @@ included do
|
|
46
46
|
|
47
47
|
field :subject, type: String, default: ''
|
48
48
|
field :body, type: String, default: ''
|
49
|
-
field :active, type: Boolean, default: true
|
49
|
+
field :active, type: Mongoid::Boolean, default: true
|
50
50
|
field :link, type: String
|
51
|
+
field :replies, type: Integer, default: 0
|
51
52
|
|
52
53
|
field :created_by, type: BSON::ObjectId
|
53
54
|
field :created_by_name, type: String
|
@@ -71,9 +72,9 @@ def do_before_save
|
|
71
72
|
if self.link.size < 5
|
72
73
|
self.link = UnicodeUtils.downcase(DcPage.clear_link(self.subject)) + Time.now.strftime('-%Y-%m-%d')
|
73
74
|
end
|
74
|
-
if self.created_by_name.nil?
|
75
|
-
self.created_by_name = DcUser.find(self.created_by).name
|
76
|
-
end
|
75
|
+
#if self.created_by_name.nil?
|
76
|
+
self.created_by_name = DcUser.find(self.created_by).name.downcase.gsub(' ','-')
|
77
|
+
#end
|
77
78
|
end
|
78
79
|
|
79
80
|
########################################################################
|
data/app/models/dc_news.rb
CHANGED
@@ -26,6 +26,7 @@
|
|
26
26
|
########################################################################
|
27
27
|
class DcBlogRenderer < DcRenderer
|
28
28
|
include DcApplicationHelper
|
29
|
+
include CmsCommonHelper
|
29
30
|
|
30
31
|
########################################################################
|
31
32
|
# Show one blog entry
|
@@ -49,10 +50,17 @@ end
|
|
49
50
|
########################################################################
|
50
51
|
def list(path)
|
51
52
|
# get blogger id from document path
|
52
|
-
blogger_id = path.last.split('-').last
|
53
|
-
documents =
|
54
|
-
|
55
|
-
|
53
|
+
blogger_id = path.last.split('-').last
|
54
|
+
documents = if BSON::ObjectId.legal?(blogger_id)
|
55
|
+
DcBlog.only(:created_by, :link, :subject, :created_at)
|
56
|
+
.where(created_by: blogger_id, active: true).order_by(created_at: -1)
|
57
|
+
.page(@parent.params[:page]).per(10)
|
58
|
+
else
|
59
|
+
blogger_name = path.last
|
60
|
+
DcBlog.only(:created_by, :link, :subject, :created_at)
|
61
|
+
.where(created_by_name: blogger_name, active: true).order_by(created_at: -1)
|
62
|
+
.page(@parent.params[:page]).per(10)
|
63
|
+
end
|
56
64
|
|
57
65
|
@parent.render partial: 'dc_blog/list', formats: [:html], locals: { documents: documents }
|
58
66
|
end
|
@@ -26,6 +26,7 @@
|
|
26
26
|
########################################################################
|
27
27
|
class DcNewsRenderer < DcRenderer
|
28
28
|
include DcApplicationHelper
|
29
|
+
include CmsCommonHelper
|
29
30
|
|
30
31
|
########################################################################
|
31
32
|
# Collects documents for list
|
@@ -9,6 +9,6 @@
|
|
9
9
|
|
10
10
|
<% for blogger in bloggers %>
|
11
11
|
<div class="blog-entry">
|
12
|
-
<%= link_to( blogger.name, { path: "blog/#{blogger.name.downcase.gsub(' ','-')}
|
12
|
+
<%= link_to( blogger.name, { path: "blog/#{blogger.name.downcase.gsub(' ','-')}" } )%>
|
13
13
|
</div>
|
14
14
|
<% end %>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<div class="entry">
|
7
7
|
<div class="date"><%= dc_pretty_date(document.created_at) %></div>
|
8
8
|
<div class="title">
|
9
|
-
<%= link_to( path: "#{(@options[:path]
|
9
|
+
<%= link_to( path: "#{(@options[:path] + [document.link]).join('/')}" ) do %>
|
10
10
|
<h2><%= document.subject %> </h2>
|
11
11
|
<% end %>
|
12
12
|
</div>
|
@@ -1,5 +1,6 @@
|
|
1
1
|
|
2
|
-
<%=
|
2
|
+
<%= "<div id=\"#{opts[:div_id]}\">".html_safe if opts[:div_id] %>
|
3
|
+
|
3
4
|
<%= if session[:edit_mode] > 1
|
4
5
|
dc_link_for_create(controller: 'cmsedit', table: 'dc_forum', title: 'dc_forum.add_new_forum' )
|
5
6
|
end %>
|
@@ -40,4 +41,5 @@
|
|
40
41
|
</div>
|
41
42
|
<% end %>
|
42
43
|
</div>
|
44
|
+
|
43
45
|
<%= "</div>".html_safe if opts[:div_id] %>
|
@@ -28,7 +28,7 @@
|
|
28
28
|
<h2><%= forum.name %></h2>
|
29
29
|
|
30
30
|
<div class="topic-top"><h3><%= topic.subject %></h3>
|
31
|
-
<%= t('dc_forum.created_by') %>: <%= topic.
|
31
|
+
<%= t('dc_forum.created_by') %>: <%= dc_pretty_date(topic.created_at) %>, <%= topic.created_by_name %>
|
32
32
|
</div>
|
33
33
|
<div class="topic-body"><%= topic.body.html_safe %></div>
|
34
34
|
|
@@ -22,15 +22,15 @@
|
|
22
22
|
<%= link_to(topic.subject, { path: params[:path], forum: params[:forum], topic: topic._id } ) %><br>
|
23
23
|
|
24
24
|
<b><%= t('dc_forum.created_by') %>:</b> <%= topic.created_by_name %>
|
25
|
-
<%= dc_pretty_date(topic.created_at) %> |
|
25
|
+
| <%= dc_pretty_date(topic.created_at) %> |
|
26
26
|
|
27
27
|
<b><%= t('dc_forum.replies') %>:</b>
|
28
28
|
<%= topic.replies %>
|
29
29
|
|
30
30
|
<% if topic.updated_at != topic.created_at %>
|
31
|
-
|
31
|
+
| <b><%= t('dc_forum.last') %>:</b>
|
32
32
|
<%= topic.updated_by_name %>
|
33
|
-
<%= dc_pretty_date(topic.updated_at) %>
|
33
|
+
| <%= dc_pretty_date(topic.updated_at) %>
|
34
34
|
<% end %>
|
35
35
|
</div>
|
36
36
|
<% end %>
|
@@ -9,8 +9,7 @@
|
|
9
9
|
target: 'iframe_edit', ref: 'nofollow') %>
|
10
10
|
</span>
|
11
11
|
<b><%= reply.subject %></b><br>
|
12
|
-
<%= t('dc_forum.replied_by') %>: <%= reply.
|
13
|
-
<%= dc_pretty_date(reply.created_at) %> <br>
|
12
|
+
<%= t('dc_forum.replied_by') %>: <%= dc_pretty_date(reply.created_at) %>, <%= reply.created_by_name %> <br>
|
14
13
|
</div>
|
15
14
|
<div class="reply-body <%= oddeven %>"><%= reply.body.html_safe %></div>
|
16
15
|
<% end %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: drg_blog_news_forum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Damjan Rems
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -50,11 +50,11 @@ files:
|
|
50
50
|
- README.md
|
51
51
|
- Rakefile
|
52
52
|
- app/assets/stylesheets/drg_blog_news_forum.css
|
53
|
-
- app/
|
54
|
-
- app/
|
55
|
-
- app/
|
56
|
-
- app/
|
57
|
-
- app/
|
53
|
+
- app/controls/dc_blog_dc_reply_control.rb
|
54
|
+
- app/controls/dc_forum_topic_control.rb
|
55
|
+
- app/controls/dc_forum_topic_dc_reply_control.rb
|
56
|
+
- app/controls/dc_news_dc_reply_control.rb
|
57
|
+
- app/controls/reply_control.rb
|
58
58
|
- app/forms/cms_menu.yml
|
59
59
|
- app/forms/dc_blog.yml
|
60
60
|
- app/forms/dc_forum.yml
|
@@ -103,7 +103,7 @@ homepage: http://www.drgcms.org
|
|
103
103
|
licenses:
|
104
104
|
- MIT
|
105
105
|
metadata: {}
|
106
|
-
post_install_message:
|
106
|
+
post_install_message:
|
107
107
|
rdoc_options: []
|
108
108
|
require_paths:
|
109
109
|
- lib
|
@@ -118,11 +118,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
118
|
- !ruby/object:Gem::Version
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
|
-
rubygems_version: 3.
|
122
|
-
signing_key:
|
121
|
+
rubygems_version: 3.2.22
|
122
|
+
signing_key:
|
123
123
|
specification_version: 4
|
124
124
|
summary: 'DRG CMS: Blog, news and forum plugin for DRG CMS'
|
125
125
|
test_files:
|
126
|
-
- test/test_helper.rb
|
127
|
-
- test/integration/navigation_test.rb
|
128
126
|
- test/drg_blog_news_forum_test.rb
|
127
|
+
- test/integration/navigation_test.rb
|
128
|
+
- test/test_helper.rb
|