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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e307b17051749b2428f07d7615dd33737f23f600ae71c753dccab91cd11ea180
4
- data.tar.gz: f90a7aa381787ce561f8936b9ba018af524755392dc45cdaa48328d73bebb432
3
+ metadata.gz: d7c8446ea001f5ab43f8a72b31734c3d47a6bb91c4e20a2d7809637955c46f24
4
+ data.tar.gz: f0611acafe1e371e2a0f7ed22ca0fa7ab56b1fb3f0479af95ac0c4bbf66377be
5
5
  SHA512:
6
- metadata.gz: 7c8626aa7bb8a48b97a3ec7a04f8d09341082cce69980ba373e29091dd431b69d0d9cc95603f6358095423a5fc77aff03c2c55a55fa7e6b9696eb526137e6355
7
- data.tar.gz: dd9b14a931d2720ac83d51fb1d0bacd91eac54e852d693028e1557f3d0d24516a9a7d6fefe84f77b64daa7e05a0ee70414cccb20ebd33aed53ba01e5f3a595dc
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-2018 Damjan Rems
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 DrgcmsControls::DcBlogDcReplyControl
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 DrgcmsControls::DcForumTopicControl
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 DrgcmsControls::DcForumTopicDcReplyControl
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 DrgcmsControls::DcNewsDcReplyControl
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 DrgcmsControls::ReplyControl
28
+ module ReplyControl
29
29
 
30
30
  ######################################################################
31
31
  # Called when new empty record is created
@@ -23,26 +23,26 @@
23
23
  menu:
24
24
  80_dc_forum_menu:
25
25
  caption: dc_forum.menu_caption
26
- icon: cubes lg
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 lg
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 lg
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: server lg
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: commenting-o lg
46
+ icon: comment-o
47
47
  table: dc_reply
48
48
 
@@ -1,2 +1,2 @@
1
1
  module ApplicationHelper
2
- end
2
+ end
@@ -22,7 +22,7 @@
22
22
  #++
23
23
 
24
24
  module DcBnfHelper
25
- #include DcApplicationHelper
25
+ include CmsCommonHelper
26
26
 
27
27
  ########################################################################
28
28
  #
@@ -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
  ########################################################################
@@ -48,6 +48,7 @@ class DcNews
48
48
  field :body, type: String, default: ''
49
49
  field :active, type: Boolean, default: true
50
50
  field :link, type: String
51
+ field :replies, type: Integer, default: 0
51
52
 
52
53
  field :valid_from, type: Date
53
54
  field :valid_to, type: Date
@@ -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 = DcBlog.only(:created_by, :link, :subject, :created_at)
54
- .where(created_by: blogger_id, active: true).order_by(created_at: -1)
55
- .page(@parent.params[:page]).per(10)
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,7 +26,7 @@
26
26
  ########################################################################
27
27
  class DcForumRenderer < DcRenderer
28
28
  include DcApplicationHelper
29
-
29
+ include CmsCommonHelper
30
30
 
31
31
  ########################################################################
32
32
  #
@@ -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(' ','-')}-#{blogger.id}" } )%>
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] << document.link).join('/')}" ) do %>
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
- <%= pp opts; "<div id=\"#{opts[:div_id]}\">".html_safe if opts[:div_id] %>
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.created_by_name %> <%= dc_pretty_date(topic.created_at) %>
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) %> &nbsp;|&nbsp;
25
+ &nbsp;|&nbsp; <%= dc_pretty_date(topic.created_at) %> &nbsp;|&nbsp;
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
- &nbsp;|&nbsp; <b><%= t('dc_forum.last') %>:</b>
31
+ &nbsp;|&nbsp; <b><%= t('dc_forum.last') %>:</b>
32
32
  <%= topic.updated_by_name %>
33
- <%= dc_pretty_date(topic.updated_at) %>
33
+ &nbsp;|&nbsp; <%= 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.created_by_name %>,
13
- <%= dc_pretty_date(reply.created_at) %>&nbsp;&nbsp;<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 %>
@@ -52,6 +52,7 @@ sl:
52
52
  body: Vsebina
53
53
  created_at: Ustvarjeno
54
54
  dc_user_id: Ustvaril
55
+ created_by_name: Ustvaril
55
56
  dc_forum_id: Forum
56
57
  active: Aktiven
57
58
  replies: Odgovorov
@@ -1,3 +1,3 @@
1
1
  module DrgBlogNewsForum
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.4"
3
3
  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.0
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: 2019-12-27 00:00:00.000000000 Z
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/controllers/drgcms_controls/dc_blog_dc_reply_control.rb
54
- - app/controllers/drgcms_controls/dc_forum_topic_control.rb
55
- - app/controllers/drgcms_controls/dc_forum_topic_dc_reply_control.rb
56
- - app/controllers/drgcms_controls/dc_news_dc_reply_control.rb
57
- - app/controllers/drgcms_controls/reply_control.rb
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.0.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