talkie 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/views/talkie/comments/_comment.html.erb +1 -1
- data/app/views/talkie/comments/_template.html.erb +3 -1
- data/lib/talkie/controller.rb +2 -2
- data/lib/talkie/permission.rb +11 -1
- data/lib/talkie/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18c265fe490168c26b1f88b4d8ae41b4b87aca6b450a3eb1d96f6d8ab387ba84
|
4
|
+
data.tar.gz: 2c4d8fa7da2b3186f265e0e6ee86c37e4b0b55e0faf75178155d967b88488927
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3220ede1a388766d4b2f482d5530a0b71605bbb33744a34635438a1937460c6cb7c1a0ca11959c81d90ddeb716dbf9b9dd22cd5f0f66c54db9eedcc108fa6284
|
7
|
+
data.tar.gz: 6ad67be73a64f31c2b3cc7f98093f0c644df3cf6d4a8082aa3c77ba5c9e872c6cd6f5745772744041211c391e78543e1cdad13610a24b6367505912a5cef8b79
|
data/Gemfile.lock
CHANGED
@@ -24,7 +24,7 @@
|
|
24
24
|
<%= link_to_delete_comment comment %>
|
25
25
|
<% end %>
|
26
26
|
|
27
|
-
<% if nested_enabled? %>
|
27
|
+
<% if nested_enabled? && comment_form_displayable? %>
|
28
28
|
<div class="talkie-comment-reply">
|
29
29
|
<a href="#" class="talkie-comment-reply-link"><%= t("talkie.comment.reply") %></a>
|
30
30
|
<% if deletable_and_allowed? comment %>
|
data/lib/talkie/controller.rb
CHANGED
@@ -5,8 +5,8 @@ module Talkie
|
|
5
5
|
extend ActiveSupport::Concern
|
6
6
|
|
7
7
|
included do
|
8
|
-
delegate :allow?, to: :current_permission
|
9
|
-
helper_method :allow?
|
8
|
+
delegate :allow?, :comment_form_displayable?, to: :current_permission
|
9
|
+
helper_method :allow?, :comment_form_displayable?
|
10
10
|
end
|
11
11
|
|
12
12
|
protected
|
data/lib/talkie/permission.rb
CHANGED
@@ -1,7 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Talkie
|
4
|
-
class Permission
|
4
|
+
class Permission
|
5
|
+
attr_reader :user
|
6
|
+
|
7
|
+
def initialize(user)
|
8
|
+
@user = user
|
9
|
+
end
|
10
|
+
|
11
|
+
def comment_form_displayable?
|
12
|
+
user.present?
|
13
|
+
end
|
14
|
+
|
5
15
|
def allow?(action, comment = Talkie::Comment.new)
|
6
16
|
action = action.to_s
|
7
17
|
|
data/lib/talkie/version.rb
CHANGED