talkie 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/PULL_REQUEST_TEMPLATE.md +7 -0
- data/app/helpers/talkie/application_helper.rb +10 -0
- data/app/views/talkie/comments/_comment.html.erb +6 -2
- data/lib/generators/talkie/templates/create_talkie_comments.rb +0 -1
- data/lib/talkie/comments_renderer.rb +4 -0
- data/lib/talkie/renderer_helper.rb +3 -1
- data/lib/talkie/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 515c6dccadc7671d553437edfa87bfc7eb191c87c912c41ef3c66e3a4a543240
|
4
|
+
data.tar.gz: 001e9c2acb8fadc073c36143e3c239b0511893e8783ff492b0353f01c86d596f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c8b1bbd9ea4f991622db621ddbac930432a2e7e2525f2dd2d2a67aa9de7b7e78730962b804f39c6340ec03111c923a69b16736c8771f519e18368f8897d3c0c
|
7
|
+
data.tar.gz: c12375bdec3f5f319981b93088b797c1bf6b8d0fd408c03cfd99d6a82f114eeda827399313855d28d073c7ad3f5c9b8fe8a5b9fd9fa737fb99e0d83fbb0e828a
|
@@ -16,5 +16,15 @@ module Talkie
|
|
16
16
|
def avatar_url(creator)
|
17
17
|
Talkie.creator_avatar_url.call(creator)
|
18
18
|
end
|
19
|
+
|
20
|
+
def deletable_and_allowed?(comment)
|
21
|
+
deletable? && allow?(:destroy, comment)
|
22
|
+
end
|
23
|
+
|
24
|
+
def link_to_delete_comment(comment)
|
25
|
+
link_to t('talkie.comment.delete'), [talkie, comment],
|
26
|
+
method: :delete,
|
27
|
+
class: 'talkie-comment-delete'
|
28
|
+
end
|
19
29
|
end
|
20
30
|
end
|
@@ -20,11 +20,15 @@
|
|
20
20
|
</p>
|
21
21
|
|
22
22
|
<div class="talkie-comment-footer">
|
23
|
+
<% if !nested_enabled? && deletable_and_allowed?(comment) %>
|
24
|
+
<%= link_to_delete_comment comment %>
|
25
|
+
<% end %>
|
26
|
+
|
23
27
|
<% if nested_enabled? %>
|
24
28
|
<div class="talkie-comment-reply">
|
25
29
|
<a href="#" class="talkie-comment-reply-link"><%= t("talkie.comment.reply") %></a>
|
26
|
-
<% if
|
27
|
-
<%=
|
30
|
+
<% if deletable_and_allowed? comment %>
|
31
|
+
<%= link_to_delete_comment comment %>
|
28
32
|
<% end %>
|
29
33
|
</div>
|
30
34
|
<div class="talkie-comments-reply-form-container" style="display:none">
|
@@ -10,12 +10,14 @@ module Talkie
|
|
10
10
|
root_comments
|
11
11
|
nested_enabled?
|
12
12
|
display_user_handler?
|
13
|
-
display_user_avatar?
|
13
|
+
display_user_avatar?
|
14
|
+
deletable?].freeze
|
14
15
|
|
15
16
|
HELPER_METHODS = %i[talkie_on
|
16
17
|
nested_enabled?
|
17
18
|
display_user_handler?
|
18
19
|
display_user_avatar?
|
20
|
+
deletable?
|
19
21
|
root_comments
|
20
22
|
commentable].freeze
|
21
23
|
|
data/lib/talkie/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: talkie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abraham Kuri
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ammeter
|
@@ -186,6 +186,7 @@ executables: []
|
|
186
186
|
extensions: []
|
187
187
|
extra_rdoc_files: []
|
188
188
|
files:
|
189
|
+
- ".github/PULL_REQUEST_TEMPLATE.md"
|
189
190
|
- ".gitignore"
|
190
191
|
- ".rspec"
|
191
192
|
- ".travis.yml"
|