drg_blog_news_forum 0.5.52.3 → 0.6.0

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
- SHA1:
3
- metadata.gz: a6bb9dc40b9a207b65a6fe1a20e66c3da166d148
4
- data.tar.gz: c44f57540098d50a8ce8a655c8da98b4d7dd8f7c
2
+ SHA256:
3
+ metadata.gz: e307b17051749b2428f07d7615dd33737f23f600ae71c753dccab91cd11ea180
4
+ data.tar.gz: f90a7aa381787ce561f8936b9ba018af524755392dc45cdaa48328d73bebb432
5
5
  SHA512:
6
- metadata.gz: 47fc095be02c9f29f21fb3e6e3a9a593e5848129a90305eafadb45981d550fd16c0422cbd1c21e76e39e1daece6b5ada8cfc2c5018a5930fa5221cafbac9d078
7
- data.tar.gz: e6d49af74ae0e8bc84c4e7a4f9949d3fb8e4759c61d5bfb69cb5e03e864b982afa208ff23a7a299f5715080f2d16b92f7185b0439ac87fa611f2403b3078b981
6
+ metadata.gz: 7c8626aa7bb8a48b97a3ec7a04f8d09341082cce69980ba373e29091dd431b69d0d9cc95603f6358095423a5fc77aff03c2c55a55fa7e6b9696eb526137e6355
7
+ data.tar.gz: dd9b14a931d2720ac83d51fb1d0bacd91eac54e852d693028e1557f3d0d24516a9a7d6fefe84f77b64daa7e05a0ee70414cccb20ebd33aed53ba01e5f3a595dc
@@ -135,23 +135,32 @@ border-radius: 2px;
135
135
  }
136
136
 
137
137
  /******* dc_blog *******/
138
+
138
139
  #blogs .title {
139
140
  font-size: 1.4em;
140
141
  padding-bottom: 5px;
141
142
  }
142
- .blog-subject {
143
- font-size: 1.4em;
143
+
144
+ #blogs h1 {
145
+ font-size: 2.2em;
146
+ font-weight: 600;
147
+ }
148
+
149
+
150
+ .blog-subject h1 {
151
+ font-size: 2.2em;
144
152
  font-weight: bold;
145
153
  }
146
154
  .blog-date {
147
- font-size: 1em;
155
+ font-size: 1.2em;
148
156
  color: #aaa;
149
157
  margin-bottom: 20px;
150
158
  }
151
159
  .blog-body {
152
160
  font-size: 1.2em;
153
161
  }
154
- .blog-replies {
162
+ .blog-replies h2 {
163
+ font-size: 2em;
155
164
  }
156
165
  .reply-top.even {
157
166
  padding:5px;
@@ -170,8 +179,8 @@ margin-bottom: 0em;
170
179
  margin-top: 10px;
171
180
  }
172
181
  .blog-entry a {
173
- font-size: 1.6em;
174
- font-weight: bold;
182
+ font-size: 1.4em;
183
+ font-weight: 600;
175
184
  }
176
185
 
177
186
  .social-sites {
@@ -184,4 +193,16 @@ padding-bottom: 5px;
184
193
  /**** news ****/
185
194
  .news.one .author {
186
195
  font-size: 1.2em;
196
+ font-weight: 600;
187
197
  }
198
+
199
+ .news .body {
200
+ font-size: 1.2em;
201
+ }
202
+ .news .document {
203
+ font-size: 1.2em;
204
+ }
205
+
206
+ .news h2 {
207
+ font-size: 1.4em;
208
+ }
@@ -37,6 +37,9 @@ def dc_new_record()
37
37
  @record.subject = "Re: #{replyto.subject}"
38
38
  @record.body = "<div class='dc-forum-quote'>#{replyto.body}</div><br>"
39
39
  end
40
+ @record.created_by_name = session[:user_name] if session[:user_name]
41
+ @record.doc_id = params[:parent_doc]
42
+ @record.doc_class = 'DcForum'
40
43
  end
41
44
 
42
45
  ######################################################################
@@ -35,7 +35,12 @@ def dc_new_record()
35
35
  if params[:reply_to]
36
36
  replyto = DcReply.find(params[:reply_to])
37
37
  @record.subject = (replyto.subject.match('Re:') ? '' : 'Re: ') + replyto.subject
38
- @record.body = "<div class='dc-forum-quote'>#{replyto.body}</div><br>"
38
+ @record.body = "<div class='dc-forum-quote'>[#{replyto.created_by_name}]#{replyto.body}</div><p><br></p>"
39
+ elsif params[:p_doc_id]
40
+ model = params[:p_doc_class].classify.constantize
41
+ doc = model.find(params[:p_doc_id])
42
+ @record.subject = "Re: #{doc.subject}"
43
+
39
44
  end
40
45
  @record.created_by_name = session[:user_name] if session[:user_name]
41
46
  end
@@ -49,4 +54,16 @@ def dc_before_save()
49
54
  return false unless params[:_record][:_honey].blank?
50
55
  end
51
56
 
57
+ ######################################################################
58
+ # Called after succesfull save.
59
+ ######################################################################
60
+ def dc_after_save()
61
+ replies = DcReply.where(doc_id: @record.doc_id, active: true).count
62
+ parent = @record.doc_class.constantize
63
+ doc = parent.find_by(id: @record.doc_id)
64
+ doc.replies = replies
65
+ doc.updated_by_name = @record.created_by_name
66
+ doc.save
67
+ end
68
+
52
69
  end
@@ -1,4 +1,5 @@
1
1
  table: dc_blog
2
+ include: dc_seo
2
3
 
3
4
  index:
4
5
  filter: subject, created_by_name
@@ -10,6 +11,7 @@ result_set:
10
11
  columns:
11
12
  1:
12
13
  name: subject
14
+ width: 30%
13
15
  2:
14
16
  name: created_by_name
15
17
  4:
@@ -20,32 +22,33 @@ edit_title: subject
20
22
  form:
21
23
  actions: standard
22
24
 
23
- fields:
24
- 10:
25
- name: subject
26
- type: text_field
27
- html:
28
- size: 80
29
-
30
- 20:
31
- name: link
32
- type: text_field
33
- html:
34
- size: 80
35
-
36
- 30:
37
- name: created_at
38
- type: datetime_picker
39
-
40
- 40:
41
- name: body
42
- type: html_field
43
- options: 'height: 500'
44
-
45
- 50:
46
- name: dc_replies
47
- type: embedded
48
- form_name: dc_reply
49
- table: dc_reply
50
- html:
51
- height: 400
25
+ tabs:
26
+ 1base:
27
+ 10:
28
+ name: subject
29
+ type: text_field
30
+ html:
31
+ size: 80
32
+
33
+ 20:
34
+ name: link
35
+ type: text_field
36
+ html:
37
+ size: 80
38
+
39
+ 30:
40
+ name: created_at
41
+ type: datetime_picker
42
+
43
+ 40:
44
+ name: body
45
+ type: html_field
46
+ options: 'height: 500'
47
+
48
+ # 50:
49
+ # name: dc_replies
50
+ # type: embedded
51
+ # form_name: dc_reply
52
+ # table: dc_reply
53
+ # html:
54
+ # height: 400
@@ -2,10 +2,16 @@ table: dc_forum_topic
2
2
 
3
3
 
4
4
  form:
5
- height: 600
5
+ height: 625
6
6
  labels_pos: top
7
7
  actions:
8
- 1: save
8
+ 5: save
9
+
10
+ 1:
11
+ type: script
12
+ caption: drgcms.back
13
+ icon: arrow-left
14
+ js: parent.location.reload();
9
15
 
10
16
  fields:
11
17
  10:
@@ -20,7 +26,7 @@ form:
20
26
  30:
21
27
  name: body
22
28
  type: html_field
23
- options: "height: 420, toolbar: 'basic'"
29
+ options: "height: 420, width: 700, toolbar: 'basic'"
24
30
 
25
31
  100:
26
32
  name: dc_forum_id
@@ -1,4 +1,5 @@
1
1
  table: dc_news
2
+ include: dc_seo
2
3
 
3
4
  index:
4
5
  filter: subject, created_by_name
@@ -10,6 +11,8 @@ result_set:
10
11
  columns:
11
12
  1:
12
13
  name: subject
14
+ width: 30%
15
+
13
16
  2:
14
17
  name: created_by_name
15
18
  4:
@@ -20,33 +23,31 @@ edit_title: subject
20
23
  form:
21
24
  actions: standard
22
25
 
23
- fields:
24
- 10:
25
- name: subject
26
- type: text_field
27
- html:
26
+ tabs:
27
+ 1base:
28
+ 10:
29
+ name: subject
30
+ type: text_field
28
31
  size: 80
29
32
 
30
- 20:
31
- name: link
32
- type: text_field
33
- html:
33
+ 20:
34
+ name: link
35
+ type: text_field
34
36
  size: 80
35
37
 
36
- 30:
37
- name: created_at
38
- type: datetime_picker
39
-
40
- 40:
41
- name: categories
42
- type: select
43
- multiple: true
44
- eval: dc_big_table 'news-categories'
45
- html:
46
- include_blank: true
47
-
48
- 50:
49
- name: body
50
- type: html_field
51
- options: 'height: 500'
52
-
38
+ 30:
39
+ name: created_at
40
+ type: datetime_picker
41
+
42
+ 40:
43
+ name: categories
44
+ type: select
45
+ multiple: true
46
+ eval: dc_big_table 'news-categories'
47
+ html:
48
+ include_blank: true
49
+
50
+ 50:
51
+ name: body
52
+ type: html_field
53
+ options: 'height: 500'
@@ -39,4 +39,4 @@ form:
39
39
  50:
40
40
  name: body
41
41
  type: html_field
42
- options: "height: 420, toolbar: 'basic', allowedContent: false"
42
+ options: "height: 420, width: 800, toolbar: 'basic', allowedContent: false"
@@ -0,0 +1,37 @@
1
+ table: dc_reply
2
+
3
+ form:
4
+ actions:
5
+ 1:
6
+ type: save
7
+ 5:
8
+ type: script
9
+ caption: Cancle
10
+ js: parent.reload();
11
+
12
+ height: 750
13
+ actions: standard
14
+
15
+ fields:
16
+ 10:
17
+ name: doc_id
18
+ type: hidden_field
19
+
20
+ 20:
21
+ name: doc_class
22
+ type: hidden_field
23
+
24
+ 30:
25
+ name: created_by_name
26
+ type: text_field
27
+ size: 30
28
+
29
+ 40:
30
+ name: subject
31
+ type: text_field
32
+ size: 80
33
+
34
+ 50:
35
+ name: body
36
+ type: html_field
37
+ options: "height: 420, width: 800, toolbar: 'basic', allowedContent: false"
data/app/forms/reply.yml CHANGED
@@ -4,28 +4,32 @@ title: Reply
4
4
  controls: reply
5
5
 
6
6
  form:
7
- height: 750
7
+ height: 650
8
8
  labels_pos: top
9
9
  actions:
10
- 1: save
10
+ 1:
11
+ type: script
12
+ caption: drgcms.back
13
+ icon: arrow-left
14
+ js: parent.location.reload();
15
+
16
+ 5: save
11
17
 
12
18
  fields:
13
19
  10:
14
20
  name: created_by_name
15
21
  type: text_field
16
- html:
17
- size: 30
22
+ size: 30
18
23
 
19
24
  20:
20
25
  name: subject
21
26
  type: text_field
22
- html:
23
- size: 80
27
+ size: 80
24
28
 
25
29
  30:
26
30
  name: body
27
31
  type: html_field
28
- options: "height: 420, toolbar: 'basic', allowedContent: false"
32
+ options: "height: 420, width: 700, toolbar: 'basic', allowedContent: false"
29
33
  40:
30
34
  name: _honey
31
35
  type: text_field
@@ -51,6 +51,9 @@ included do
51
51
 
52
52
  field :created_by, type: BSON::ObjectId
53
53
  field :created_by_name, type: String
54
+
55
+ # SEO
56
+ include DcSeoConcern
54
57
 
55
58
  embeds_many :dc_replies, as: :replies
56
59
 
@@ -66,7 +69,7 @@ included do
66
69
  ########################################################################
67
70
  def do_before_save
68
71
  if self.link.size < 5
69
- self.link = UnicodeUtils.downcase(self.subject).gsub(' ','-') + Time.now.strftime('-%Y-%m-%d')
72
+ self.link = UnicodeUtils.downcase(DcPage.clear_link(self.subject)) + Time.now.strftime('-%Y-%m-%d')
70
73
  end
71
74
  if self.created_by_name.nil?
72
75
  self.created_by_name = DcUser.find(self.created_by).name
@@ -56,6 +56,7 @@ class DcForum
56
56
  field :active, type: Boolean, default: true
57
57
  field :created_by, type: BSON::ObjectId
58
58
  field :updated_by, type: BSON::ObjectId
59
+ field :updated_by_name, type: String
59
60
 
60
61
  embeds_many :dc_policy_rules, as: :policy_rules
61
62
 
@@ -57,8 +57,7 @@ class DcForumTopic
57
57
  field :created_by, type: BSON::ObjectId
58
58
  field :updated_by, type: BSON::ObjectId
59
59
  field :created_by_name, type: String
60
- field :updated_by_name, type: String
61
-
60
+ field :updated_by_name, type: String
62
61
 
63
62
  index( { dc_forum_id: 1 } )
64
63
 
@@ -52,6 +52,9 @@ class DcNews
52
52
  field :valid_from, type: Date
53
53
  field :valid_to, type: Date
54
54
  field :categories, type: Array
55
+
56
+ # SEO
57
+ include DcSeoConcern
55
58
 
56
59
  field :created_by, type: BSON::ObjectId
57
60
  field :created_by_name, type: String
@@ -67,8 +70,8 @@ class DcNews
67
70
  # Update link when left blank.
68
71
  ########################################################################
69
72
  def do_before_save
70
- if self.link.size < 5
71
- self.link = UnicodeUtils.downcase(self.subject).gsub(' ','-') + Time.now.strftime('-%Y-%m-%d')
73
+ if self.link.blank?
74
+ self.link = UnicodeUtils.downcase(DcPage.clear_link(self.subject)) + Time.now.strftime('-%Y-%m-%d')
72
75
  end
73
76
  if self.created_by_name.nil?
74
77
  self.created_by_name = DcUser.find(self.created_by).name
@@ -49,8 +49,10 @@ class DcReply
49
49
 
50
50
  field :created_by, type: BSON::ObjectId
51
51
  field :created_by_name, type: String
52
+
53
+ index( { doc_id: 1 } )
52
54
 
53
- validates_length_of :subject, minimum: 4
54
- validates_length_of :body, minimum: 10
55
+ validates_length_of :subject, minimum: 5
56
+ validates_length_of :body, minimum: 5
55
57
  validates_length_of :created_by_name, minimum: 5
56
58
  end
@@ -33,6 +33,11 @@ include DcApplicationHelper
33
33
  def show(link)
34
34
  entry = DcBlog.find_by(link: link)
35
35
  return t('dc_blog.entry_not_found') if entry.nil?
36
+ # SEO
37
+ @parent.page_title = entry.title.blank? ? entry.subject : entry.title
38
+ @parent.page.canonical_link = nil
39
+ @parent.dc_add_meta_tag(:name, 'description', entry.meta_description) unless entry.meta_description.blank?
40
+ @parent.dc_add_json_ld(entry.get_json_ld)
36
41
 
37
42
  replies = DcReply.where(doc_id: entry.id, active: true).order(created_at: 1)
38
43
  @parent.render partial: 'dc_blog/show', formats: [:html],
@@ -42,10 +47,13 @@ end
42
47
  ########################################################################
43
48
  # List all blogs from single blogger
44
49
  ########################################################################
45
- def list(blogger)
46
- documents = DcBlog.only(:created_by_name, :link, :subject, :created_at)
47
- .where(created_by_name: blogger, active: true).order_by(created_at: -1)
48
- .page(@parent.params[:page]).per(10)
50
+ def list(path)
51
+ # 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)
56
+
49
57
  @parent.render partial: 'dc_blog/list', formats: [:html], locals: { documents: documents }
50
58
  end
51
59
 
@@ -53,7 +61,8 @@ end
53
61
  # List all bloggers
54
62
  ########################################################################
55
63
  def list_bloggers
56
- bloggers = DcBlog.all.distinct(:created_by_name)
64
+ bloggers = DcBlog.distinct(:created_by)
65
+ bloggers = DcUser.only(:id, :name).where(:_id.in => bloggers).to_a
57
66
  @parent.render partial: 'dc_blog/bloggers', formats: [:html], locals: { bloggers: bloggers }
58
67
  end
59
68
 
@@ -65,16 +74,14 @@ def last_blogs
65
74
  entries = DcBlog.only(:created_by_name, :link, :subject, :created_at).where(active: true)
66
75
  entries = entries.and(created_by_name: @opts[:blogger]) if @opts[:blogger]
67
76
  entries = entries.order_by(created_at: -1).limit(limit).to_a
68
-
69
77
  entries.inject('') do |result, document|
70
78
  result << @parent.link_to("/blog/#{document.created_by_name}/#{document.link}") do
71
- %Q[
79
+ %Q[<div>
72
80
  <span class="date">#{@parent.dc_pretty_date(document.created_at)} : </span>
73
- <span class="title">#{document.subject}</span><br><br>
74
- ].html_safe
81
+ <span class="title">#{document.subject}</span><br>
82
+ </div>].html_safe
75
83
  end
76
84
  end
77
-
78
85
  end
79
86
 
80
87
 
@@ -86,7 +93,7 @@ def default
86
93
  if @opts[:path].size == 1 or document_link == 'bloggers'
87
94
  list_bloggers
88
95
  elsif @opts[:path].size == 2
89
- list(document_link)
96
+ list(@opts[:path])
90
97
  else
91
98
  show(document_link)
92
99
  end
@@ -49,9 +49,9 @@ def topic
49
49
  forum = DcForum.find(@parent.params[:forum])
50
50
  topic = DcForumTopic.find(@parent.params[:topic])
51
51
  replies = DcReply.where(doc_id: topic.id, active: true).order(created_at: 1)
52
- .page(@parent.params[:page]).per(10)
52
+ .page(@parent.params[:page]).per(15)
53
53
  @parent.render partial: 'dc_forum/topic', formats: [:html],
54
- locals: { forum: forum, topic: topic, replies: replies }
54
+ locals: { forum: forum, topic: topic, replies: replies, opts: @opts }
55
55
  end
56
56
 
57
57
  ########################################################################
@@ -64,7 +64,7 @@ def topics
64
64
  topics = DcForumTopic.only(:id, :created_by_name, :updated_by_name, :subject, :created_at, :updated_at, :replies)
65
65
  .where(dc_forum_id: forum._id, active: true).order(updated_at: -1)
66
66
  .page(@parent.params[:page]).per(10)
67
- @parent.render partial: 'dc_forum/topics', formats: [:html], locals: { forum: forum, topics: topics }
67
+ @parent.render partial: 'dc_forum/topics', formats: [:html], locals: { forum: forum, topics: topics, opts: @opts }
68
68
  end
69
69
 
70
70
  ########################################################################
@@ -84,10 +84,10 @@ def last_news
84
84
 
85
85
  entries.inject('') do |result, element|
86
86
  result << @parent.link_to("/news/#{element.link}") do
87
- %Q[
87
+ %Q[<div>
88
88
  <span class="date">#{@parent.dc_pretty_date(element.created_at)} : </span>
89
- <span class="title">#{element.subject}</span><br><br>
90
- ].html_safe
89
+ <span class="title">#{element.subject}</span>
90
+ </div>].html_safe
91
91
  end
92
92
  end
93
93
  end
@@ -2,12 +2,13 @@
2
2
  <% if session[:edit_mode] > 1 %>
3
3
  <%= dc_link_for_create(controller: 'cmsedit', table: 'dc_blog', title: 'dc_blog.new_entry' ) %>
4
4
  <% end %>
5
+
5
6
  <div class="blog-title">
6
7
  <h1><%= t('dc_blog.bloggers') %></h1>
7
8
  </div>
8
9
 
9
10
  <% for blogger in bloggers %>
10
11
  <div class="blog-entry">
11
- <%= link_to( blogger, { path: "blog/#{blogger}"} )%>
12
+ <%= link_to( blogger.name, { path: "blog/#{blogger.name.downcase.gsub(' ','-')}-#{blogger.id}" } )%>
12
13
  </div>
13
14
  <% end %>
@@ -1,11 +1,15 @@
1
1
 
2
2
  <div id="blogs">
3
- <h3><%= t('dc_blog.blogs') %></h3>
3
+ <h1><%= t('dc_blog.blogs') %></h1>
4
4
 
5
5
  <% for document in documents %>
6
6
  <div class="entry">
7
7
  <div class="date"><%= dc_pretty_date(document.created_at) %></div>
8
- <div class="title"><%= link_to( document.subject, path: "#{@page.link}/#{document.created_by_name}/#{document.link}" )%></div>
8
+ <div class="title">
9
+ <%= link_to( path: "#{(@options[:path] << document.link).join('/')}" ) do %>
10
+ <h2><%= document.subject %> </h2>
11
+ <% end %>
12
+ </div>
9
13
  </div>
10
14
  <% end %>
11
15
  </div>
@@ -7,11 +7,11 @@
7
7
  <%= dc_link_for_edit(controller: 'cmsedit', table: 'dc_blog', title: 'dc_blog.edit_document', id: document.id ) %>
8
8
  <% end %>
9
9
 
10
- <div class="blog-subject"><h2><%= document.subject %></h2></div>
11
- <div class="blog-date"><h4><%= t('dc_blog.published') + ' ' + dc_pretty_date(document.created_at) %></h4></div>
10
+ <div class="blog-subject"><h1><%= document.subject %></h1></div>
11
+ <div class="blog-date"><%= t('dc_blog.published') + ' ' + dc_pretty_date(document.created_at) %></div>
12
12
 
13
13
  <div class="blog-body"><%= document.body.html_safe %></div>
14
- <div class="social-sites"><%= social_sites %></div>
14
+ <div class="social-sites"><%= social_sites %></div>
15
15
 
16
16
  <div class="blog-replies">
17
17
  <h2><%= t('dc_blog.comments') %></h2>
@@ -23,7 +23,7 @@
23
23
  </div>
24
24
 
25
25
  <div class="column small-12 medium-3 more-blogs">
26
- <h5>More blogs by<br><%= document.created_by_name %></h5>
26
+ <h2>More blogs by<br><%= document.created_by_name %></h2>
27
27
  <%= dc_render(:dc_blog, method: 'last_blogs', limit: 10, blogger: document.created_by_name) %>
28
28
  </div>
29
29
 
@@ -1,11 +1,12 @@
1
- <div class="wrap">
1
+
2
+ <%= pp opts; "<div id=\"#{opts[:div_id]}\">".html_safe if opts[:div_id] %>
2
3
  <%= if session[:edit_mode] > 1
3
4
  dc_link_for_create(controller: 'cmsedit', table: 'dc_forum', title: 'dc_forum.add_new_forum' )
4
5
  end %>
5
6
 
6
7
  <div class="forum-topics">
7
8
  <div class="forum-title">
8
- <h1><%= t 'dc_forum.forums_list' %></h1>
9
+ <h3><%= t 'dc_forum.forums_list' %></h3>
9
10
  </div>
10
11
 
11
12
  <% for forum in forums %>
@@ -15,20 +16,28 @@
15
16
  <div class="name">
16
17
  <%= link_to(forum.name,{ path: params[:path], forum: forum.id} ) %>
17
18
  </div>
18
- <div class='description'>
19
- <%= forum.description %><hr>
20
- <b><%= t('dc_forum.topics') %>:</b>
21
- <%= forum.topics %> &nbsp;|&nbsp;
22
19
 
20
+ <div class='description'>
21
+ <%= forum.description %><br>
22
+ <b><%= t('dc_forum.topics') %>:</b>
23
+ <%= forum.topics %> &nbsp;|&nbsp;
24
+
25
+ <% zadnja_sprememba = DcForumTopic.where(dc_forum_id: forum.id).order_by(updated_at: -1).first; if zadnja_sprememba %>
26
+ <b><%= t('dc_forum.last_change') %>:</b>
27
+ <%= dc_pretty_date(zadnja_sprememba.updated_at) %> &nbsp;|&nbsp;
28
+ <%= link_to(zadnja_sprememba.subject, { path: params[:path], forum: forum.id, topic: zadnja_sprememba._id } ) %>
29
+ <% end %>
30
+
31
+ <% if false %>
23
32
  <b><%= t('dc_forum.replies') %>:</b>
24
33
  <%= forum.replies %> &nbsp;|&nbsp;
25
34
 
26
35
  <b><%= t('dc_forum.last') %>:</b>
27
36
  <%= forum.updated_by_name %>
28
37
  <%= dc_pretty_date(forum.updated_at) %>
29
-
38
+ <% end %>
30
39
  </div>
31
40
  </div>
32
41
  <% end %>
33
- </div>
34
42
  </div>
43
+ <%= "</div>".html_safe if opts[:div_id] %>
@@ -1,53 +1,43 @@
1
- <div class="wrap">
1
+
2
+ <%= "<div id=\"#{opts[:div_id]}\">".html_safe if opts[:div_id] %>
3
+
2
4
  <div class="forum-topics">
3
5
  <div id="back-list">
4
6
  <%= link_to( t('dc_forum.forums_list'), {path: params[:path]} ) %> /
5
7
  <%= link_to( forum.name, {path: params[:path], forum: forum.id} ) %>
6
8
  </div>
7
- <table id="dc-forum-menu"><tr>
8
- <td class="dc-link dc-animate" style="white-space: nowrap;">
9
- <%= link_to( t('dc_forum.new_reply'), { controller: 'cmsedit', table: 'dc_forum_topic;dc_reply',
10
- form_name: 'dc_reply', action: 'new', ids: topic.id, forum: forum._id},
11
- target: 'iframe_edit') %>
12
- </td>
13
- <td style="text-align: right; width: 100%;"><%= paginate replies %></td>
14
- </tr></table>
15
9
 
16
- <div class="forum-title">
17
- <h1><%= forum.name %></h1></div>
10
+ <div id="dc-forum-menu">
11
+ <div class="dc-link">
12
+ <%= link_to( 'Nazaj', {path: params[:path], forum: forum.id}, class: 'dc-animate' ) %>
13
+ </div>
14
+ <div class="dc-link">
15
+ <%= link_to( t('dc_forum.new_reply'), { table: 'dc_reply', form_name: 'reply',
16
+ controller: :cmsedit, action: 'new',
17
+ p_doc_id: topic.id, p_doc_class: topic.class.to_s },
18
+ target: 'iframe_edit', class: 'dc-animate', ref: 'nofollow') %>
19
+ </div>
20
+ <div class="dc-link">
21
+ <%= link_to( t('dc_forum.new_topic'),
22
+ {controller: 'cmsedit', table: 'dc_forum_topic', form_name: 'dc_forum_topic',
23
+ action: 'new', forum: forum._id}, target: 'iframe_edit', class: 'dc-animate', ref: 'nofollow') %>
24
+ </div>
25
+ <div style="text-align: right; width: 100%;"><%= paginate replies %></div>
26
+ </div>
27
+
28
+ <h2><%= forum.name %></h2>
18
29
 
19
- <div class="topic-top"><h2><%= topic.subject %></h2>
30
+ <div class="topic-top"><h3><%= topic.subject %></h3>
20
31
  <%= t('dc_forum.created_by') %>: <%= topic.created_by_name %> <%= dc_pretty_date(topic.created_at) %>
21
32
  </div>
22
-
23
33
  <div class="topic-body"><%= topic.body.html_safe %></div>
24
34
 
25
- <% for reply in replies %>
26
- <% oddeven = cycle("odd", "even") %>
27
-
28
- <div class="reply-top-<%= oddeven %>">
29
- <span style="float: right; top-margin: 5px;">
30
- <%= link_to( t('dc_forum.new_reply'), { controller: 'cmsedit', table: 'dc_forum_topic;dc_reply',
31
- form_name: 'dc_reply', action: 'new', ids: topic.id,
32
- forum: forum._id, reply_to: reply.id}, target: 'iframe_edit') %>
33
- </span>
34
- <b><%= reply.subject %></b><br>
35
- <%= t('dc_forum.replied_by') %>:
36
- <%= reply.created_by_name %>,
37
- <%= dc_pretty_date(reply.created_at) %>&nbsp;&nbsp;
38
- </div>
39
- <div class="reply-body-<%= oddeven %>"><%= reply.body.html_safe %></div>
40
- <% end %>
41
-
42
- <table id="dc-forum-menu"><tr>
43
- <td class="dc-link dc-animate" style="white-space: nowrap;">
44
- <%= link_to( t('dc_forum.new_reply'), { controller: 'cmsedit', table: 'dc_forum_topic;dc_reply',
45
- form_name: 'dc_reply', action: 'new', ids: topic.id, forum: forum._id},
46
- target: 'iframe_edit') %>
47
- </td>
48
- <td style="text-align: right; width: 100%;"><%= paginate replies %></td>
49
- </tr></table>
35
+ <div class="news-replies">
36
+ <h4>Odgovori</h4>
37
+ <%= render partial: 'dc_replay/reply', formats: [:html],
38
+ locals: { replies: replies, parent_doc: topic } %>
39
+ </div>
50
40
  </div>
51
-
41
+
52
42
  <iframe id="iframe_edit" name="iframe_edit" scrolling="no"></iframe>
53
- </div>
43
+ <%= "</div>".html_safe if opts[:div_id] %>
@@ -1,23 +1,26 @@
1
- <div class="wrap">
1
+
2
+ <%= "<div id=\"#{opts[:div_id]}\">".html_safe if opts[:div_id] %>
3
+
2
4
  <div class="forum-topics">
3
5
  <div id="back-list"><%= link_to( t('dc_forum.forums_list'), { path: params[:path] }) %> </div>
4
-
5
- <table id="dc-forum-menu"><tr>
6
- <td class="dc-link dc-animate" style="white-space: nowrap;">
6
+
7
+ <div id="dc-forum-menu">
8
+ <div class="dc-link" style="white-space: nowrap;">
7
9
  <%= link_to( t('dc_forum.new_topic'),
8
10
  {controller: 'cmsedit', table: 'dc_forum_topic', form_name: 'dc_forum_topic',
9
- action: 'new', forum: forum._id}, target: 'iframe_edit') %>
10
- </td>
11
- <td style="text-align: right; width: 100%;"><%= paginate topics %></td>
12
- </tr></table>
11
+ action: 'new', forum: forum._id}, target: 'iframe_edit', class: 'dc-animate', ref: 'nofollow') %>
12
+ </div>
13
+ <div style="text-align: right; width: 100%;"><%= paginate topics %></div>
14
+ </div>
13
15
 
14
16
  <div class="forum-title">
15
- <h1><%= forum.name %></h1>
17
+ <h2><%= forum.name %></h2>
16
18
  </div>
17
19
 
18
20
  <% for topic in topics %>
19
21
  <div class="topic-<%= cycle("odd", "even") %>">
20
- <%= link_to(topic.subject, { path: params[:path], forum: params[:forum], topic: topic._id } ) %><hr>
22
+ <%= link_to(topic.subject, { path: params[:path], forum: params[:forum], topic: topic._id } ) %><br>
23
+
21
24
  <b><%= t('dc_forum.created_by') %>:</b> <%= topic.created_by_name %>
22
25
  <%= dc_pretty_date(topic.created_at) %> &nbsp;|&nbsp;
23
26
 
@@ -32,15 +35,8 @@
32
35
  </div>
33
36
  <% end %>
34
37
 
35
- <table id="dc-forum-menu"><tr>
36
- <td class="dc-link dc-animate" style="white-space: nowrap;">
37
- <%= link_to( t('dc_forum.new_topic'),
38
- {controller: 'cmsedit', table: 'dc_forum_topic', form_name: 'dc_forum_topic',
39
- action: 'new', forum: forum._id}, target: 'iframe_edit') %>
40
- </td>
41
- <td style="text-align: right; width: 100%;"><%= paginate topics %></td>
42
- </tr></table>
43
38
  </div>
44
39
 
45
40
  <iframe id="iframe_edit" name="iframe_edit" scrolling="no"></iframe>
46
- </div>
41
+ <%= "</div>".html_safe if opts[:div_id] %>
42
+
@@ -10,7 +10,7 @@ title = opts.dig(:settings, opts[:element], 'title') || t('dc_news.news')
10
10
 
11
11
  <div class="<%= clas %>">
12
12
  <%= news_settings(opts) %>
13
- <% unless title == '-' %><h2><%= title %></h2><% end %>
13
+ <% unless title == '-' %><h1><%= title %></h1><% end %>
14
14
  <%= if opts[:edit_mode] > 1
15
15
  dc_link_for_create(controller: 'cmsedit', table: 'dc_news', title: 'dc_blog.new_entry' )
16
16
  end %>
@@ -18,7 +18,9 @@ title = opts.dig(:settings, opts[:element], 'title') || t('dc_news.news')
18
18
  <% for document in documents %>
19
19
  <div class="document">
20
20
  <%= dc_pretty_date(document.created_at) %>
21
- <h4><%= link_to( document.subject, { path: "#{link}/#{document.link}" } )%></h4>
21
+ <%= link_to( { path: "#{link}/#{document.link}" } ) do %>
22
+ <h2><%= document.subject %></h2>
23
+ <% end %>
22
24
  </div>
23
25
  <% end %>
24
26
  </div>
@@ -8,9 +8,9 @@ clas = (opts.dig(:settings, opts[:element], 'clas') || 'news') + ' one'
8
8
  <%= dc_link_for_create( table: 'dc_news', title: 'dc_news.new_document' ) %>
9
9
  <% end %>
10
10
 
11
- <h2><%= document.subject %></h2>
11
+ <h1><%= document.subject %></h1>
12
12
  <div class="author">
13
- <%= "#{t('dc_blog.author')} #{document.created_by_name}, #{dc_pretty_date(document.created_at)}" %>
13
+ <%= "#{t('dc_blog.author')}: #{document.created_by_name}, #{dc_pretty_date(document.created_at)}" %>
14
14
  </div><br>
15
15
 
16
16
  <div class="body"><%= document.body.html_safe %></div>
@@ -2,25 +2,25 @@
2
2
  <% for reply in replies %>
3
3
  <% oddeven = cycle("odd", "even") %>
4
4
  <div class="reply-top <%= oddeven %>">
5
- <span style="float: right; top-margin: 5px;">
5
+ <span style="float:right;">
6
6
  <%= link_to( t('dc_forum.new_reply'), { table: 'dc_reply', form_name: 'reply',
7
7
  controller: :cmsedit, action: 'new', reply_to: reply.id,
8
8
  p_doc_id: parent_doc.id, p_doc_class: parent_doc.class.to_s },
9
- target: 'iframe_edit') %>
9
+ target: 'iframe_edit', ref: 'nofollow') %>
10
10
  </span>
11
11
  <b><%= reply.subject %></b><br>
12
12
  <%= t('dc_forum.replied_by') %>: <%= reply.created_by_name %>,
13
- <%= dc_pretty_date(reply.created_at) %>&nbsp;&nbsp;<br><br>
14
- <div class="reply-body <%= oddeven %>"><%= reply.body.html_safe %></div>
13
+ <%= dc_pretty_date(reply.created_at) %>&nbsp;&nbsp;<br>
15
14
  </div>
15
+ <div class="reply-body <%= oddeven %>"><%= reply.body.html_safe %></div>
16
16
  <% end %>
17
17
 
18
18
  <div id="dc-reply-menu">
19
19
  <div class="dc-link dc-animate" style="float: left;">
20
- <%= link_to( t('dc_forum.new_comment'), { controller: 'cmsedit', table: "dc_reply",
20
+ <%= link_to( t('dc_forum.new_reply'), { controller: 'cmsedit', table: "dc_reply",
21
21
  form_name: 'reply', action: 'new',
22
22
  p_doc_id: parent_doc.id, p_doc_class: parent_doc.class.to_s},
23
- {target: 'iframe_edit', class: 'dc-animate'}) %>
23
+ {target: 'iframe_edit', class: 'dc-animate', ref: 'nofollow'}) %>
24
24
  </div>
25
25
  <%# = paginate replies %>
26
26
  </div>
@@ -35,6 +35,7 @@ en:
35
35
  topics: Topics
36
36
  replies: Replies
37
37
  last: Last
38
+ last_change: Last change
38
39
 
39
40
  dc_blog:
40
41
  author: Author
@@ -35,6 +35,7 @@ sl:
35
35
  topics: Teme
36
36
  replies: Odgovorov
37
37
  last: Zadnji
38
+ last_change: Zadnja sprememba
38
39
 
39
40
  dc_blog:
40
41
  author: Avtor
@@ -70,6 +70,7 @@ en:
70
70
 
71
71
  dc_blog:
72
72
  tabletitle: Blogs
73
+ 1base: Base
73
74
 
74
75
  subject: Subject
75
76
  body: Body
@@ -82,6 +83,7 @@ en:
82
83
 
83
84
  dc_news:
84
85
  tabletitle: News
86
+ 1base: Base
85
87
 
86
88
  subject: Subject
87
89
  body: Body
@@ -68,6 +68,7 @@ sl:
68
68
 
69
69
  dc_blog:
70
70
  tabletitle: Blogi
71
+ 1base: Osnovno
71
72
 
72
73
  subject: Zadeva
73
74
  body: Vsebina
@@ -80,6 +81,7 @@ sl:
80
81
 
81
82
  dc_news:
82
83
  tabletitle: Novice
84
+ 1base: Osnovno
83
85
 
84
86
  subject: Zadeva
85
87
  body: Vsebina
@@ -1,3 +1,3 @@
1
1
  module DrgBlogNewsForum
2
- VERSION = "0.5.52.3"
2
+ VERSION = "0.6.0"
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.5.52.3
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damjan Rems
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-13 00:00:00.000000000 Z
11
+ date: 2019-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -61,20 +61,21 @@ files:
61
61
  - app/forms/dc_forum_topic.yml
62
62
  - app/forms/dc_news.yml
63
63
  - app/forms/dc_reply.yml
64
+ - app/forms/dc_reply_public.yml
64
65
  - app/forms/forum_settings.yml
65
66
  - app/forms/news_settings.yml
66
67
  - app/forms/reply.yml
67
68
  - app/helpers/application_helper.rb
68
- - app/helpers/dc_blog_renderer.rb
69
69
  - app/helpers/dc_bnf_helper.rb
70
- - app/helpers/dc_forum_renderer.rb
71
- - app/helpers/dc_news_renderer.rb
72
70
  - app/models/dc_blog.rb
73
71
  - app/models/dc_forum.rb
74
72
  - app/models/dc_forum_policy_rule.rb
75
73
  - app/models/dc_forum_topic.rb
76
74
  - app/models/dc_news.rb
77
75
  - app/models/dc_reply.rb
76
+ - app/renderers/dc_blog_renderer.rb
77
+ - app/renderers/dc_forum_renderer.rb
78
+ - app/renderers/dc_news_renderer.rb
78
79
  - app/views/dc_blog/_blog.html.erb
79
80
  - app/views/dc_blog/_bloggers.html.erb
80
81
  - app/views/dc_blog/_last_blogs.erb
@@ -117,8 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
118
  - !ruby/object:Gem::Version
118
119
  version: '0'
119
120
  requirements: []
120
- rubyforge_project:
121
- rubygems_version: 2.6.14.1
121
+ rubygems_version: 3.0.3
122
122
  signing_key:
123
123
  specification_version: 4
124
124
  summary: 'DRG CMS: Blog, news and forum plugin for DRG CMS'