drg_blog_news_forum 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/dc_blog.rb +4 -3
- data/app/models/dc_news.rb +1 -0
- data/app/renderers/dc_blog_renderer.rb +11 -4
- 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 +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a6ee97f5e6a504d5a73e26cd89139540a69aed9afaf9fa920653d978a9c6231
|
4
|
+
data.tar.gz: ffaa7785803e8fbec870aa86197e021ba306d331f78f685c9e8a8efbaf5ea370
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 172373b43d2cde7ee76864c97b0a3a1c291d12dbe6c563a765f42df024f3f3c476d235f3af9940be98f0f2579fedb9249f870fd2b6bbb924828a469c8c8934a8
|
7
|
+
data.tar.gz: 83d52cd7d5bac8dc2d5a0a9bb229112a7fad12bdb99e219761469173e3f0bd33e2e570009dd76872f9fb3c665b04fa14bafd1b1e974f25161512aca783188eb2
|
data/app/models/dc_blog.rb
CHANGED
@@ -48,6 +48,7 @@ included do
|
|
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 :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
@@ -49,10 +49,17 @@ end
|
|
49
49
|
########################################################################
|
50
50
|
def list(path)
|
51
51
|
# get blogger id from document path
|
52
|
-
blogger_id = path.last.split('-').last
|
53
|
-
documents =
|
54
|
-
|
55
|
-
|
52
|
+
blogger_id = path.last.split('-').last
|
53
|
+
documents = if BSON::ObjectId.legal?(blogger_id)
|
54
|
+
DcBlog.only(:created_by, :link, :subject, :created_at)
|
55
|
+
.where(created_by: blogger_id, active: true).order_by(created_at: -1)
|
56
|
+
.page(@parent.params[:page]).per(10)
|
57
|
+
else
|
58
|
+
blogger_name = path.last
|
59
|
+
DcBlog.only(:created_by, :link, :subject, :created_at)
|
60
|
+
.where(created_by_name: blogger_name, active: true).order_by(created_at: -1)
|
61
|
+
.page(@parent.params[:page]).per(10)
|
62
|
+
end
|
56
63
|
|
57
64
|
@parent.render partial: 'dc_blog/list', formats: [:html], locals: { documents: documents }
|
58
65
|
end
|
@@ -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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Damjan Rems
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|