drg_books 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/controllers/drgcms_controls/dc_book_chapter_dc_reply_control.rb +50 -0
- data/app/forms/dc_book_chapter.yml +2 -4
- data/app/helpers/dc_book_renderer.rb +5 -2
- data/app/models/dc_book_chapter.rb +1 -0
- data/app/views/dc_book/_chapter.html.erb +10 -2
- data/lib/drg_books/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dce0e4e335d1c80fe9ae39259c8c859fc8873bab
|
4
|
+
data.tar.gz: b30fd324f9d06be71f032e2a4cb8bc47f4722c1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5e1f1e4c02eb565628a5f514a6cc9e86ee362f7390a9012764f80f1f88eec4442adb250532de482ec4782757305b7db12d621ca8609d6390ecf245f0c1b0a37
|
7
|
+
data.tar.gz: 57aee972ed68912d0557f27fdd62d1003aed52cc8ac84aa759aea7376b6a99adb03b2ae5ab7e270262eaf6a611af427a47919c5e9591ab30d193de2dc8d82e38
|
data/README.md
CHANGED
@@ -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::DcBookChapterDcReplyControl
|
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
|
+
@record.created_by_name = session[:user_name] if session[:user_name]
|
41
|
+
end
|
42
|
+
|
43
|
+
######################################################################
|
44
|
+
# Called before save. Reloads browser.
|
45
|
+
######################################################################
|
46
|
+
def dc_before_save()
|
47
|
+
params[:return_to] = 'parent.reload'
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
@@ -77,12 +77,15 @@ def chapter
|
|
77
77
|
if chapter
|
78
78
|
texts = chapter.dc_book_texts.where(active: true).to_a
|
79
79
|
if texts.size > 0
|
80
|
+
replies = chapter.dc_replies.where(active: true).order(created_at: 1).
|
81
|
+
page(@parent.params[:page]).per(20)
|
80
82
|
versions = texts.inject([]) {|r,e| r << [e.version, e._id] }
|
81
83
|
# display specific version when text_id is specified
|
82
84
|
text = @parent.params[:text_id] ? chapter.dc_book_texts.find(@parent.params[:text_id]) : texts.last
|
83
85
|
html << @parent.render( partial: 'dc_book/chapter',
|
84
|
-
locals: { chapter: chapter, text: text, versions: versions,
|
85
|
-
prev_chapter: prev_chapter, next_chapter: next_chapter},
|
86
|
+
locals: { chapter: chapter, replies: replies, text: text, versions: versions,
|
87
|
+
prev_chapter: prev_chapter, next_chapter: next_chapter},
|
88
|
+
formats: [:html] )
|
86
89
|
end
|
87
90
|
end
|
88
91
|
html
|
@@ -22,5 +22,13 @@
|
|
22
22
|
table: 'dc_book_chapter;dc_book_text', title: "#{t('drgcms.edit')}" })
|
23
23
|
end %>
|
24
24
|
|
25
|
-
<%= text.body.html_safe
|
26
|
-
|
25
|
+
<%= text.body.html_safe %>
|
26
|
+
</div>
|
27
|
+
|
28
|
+
<div class="book-replies">
|
29
|
+
<h2><%= t('dc_blog.comments') %></h2>
|
30
|
+
<%= render partial: 'dc_replay/reply', formats: [:html],
|
31
|
+
locals: { replies: replies, parent_id: chapter.id, parent_document: 'dc_book_chapter' } %>
|
32
|
+
</div>
|
33
|
+
|
34
|
+
<iframe id="iframe_edit" name="iframe_edit" scrolling="no"></iframe>
|
data/lib/drg_books/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: drg_books
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.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: 2015-
|
11
|
+
date: 2015-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: drg_cms
|
@@ -36,6 +36,7 @@ files:
|
|
36
36
|
- Rakefile
|
37
37
|
- app/assets/stylesheets/drg_books.css
|
38
38
|
- app/controllers/books_controller.rb
|
39
|
+
- app/controllers/drgcms_controls/dc_book_chapter_dc_reply_control.rb
|
39
40
|
- app/forms/cms_menu.yml
|
40
41
|
- app/forms/dc_book.yml
|
41
42
|
- app/forms/dc_book_chapter.yml
|
@@ -107,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
108
|
version: '0'
|
108
109
|
requirements: []
|
109
110
|
rubyforge_project:
|
110
|
-
rubygems_version: 2.2.
|
111
|
+
rubygems_version: 2.2.5
|
111
112
|
signing_key:
|
112
113
|
specification_version: 4
|
113
114
|
summary: 'DRG CMS: Documentation plugin'
|