polyblock 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/polyblock/application_helper.rb +18 -1
- data/lib/polyblock/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66e4cade17cdc3aee262380e99f8e62889d41968
|
4
|
+
data.tar.gz: 18f162bcbd919fdbb263d401120ae8118536821b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9ff55efa794027c2d4e88c47b966dd75b4e481f59e87674adda84994e9d419152590a2ee69cad047c421ea0a0b40ca564339cb9a4ffe8a1b01da0883a7ec4ab
|
7
|
+
data.tar.gz: 0f2379b17229975e6e953ff4990156d9d0b679cb985621b954e598cce70512b583f6496af0899ed87ee2e231550531f43a9df213b73fefd0a050546e5a0b2ae4
|
@@ -32,12 +32,29 @@ module Polyblock
|
|
32
32
|
# Build output tag
|
33
33
|
content = pb_exists ? pb.content : "<p>This block is content managed by Polyblock!<br />Click to edit me!</p>"
|
34
34
|
tag_options = options[:tag_options].deep_merge({:id => "pb-#{pb_id}", :data => {:pbid => pb_id, :pbname => name}})
|
35
|
-
tag_options[:contenteditable] =
|
35
|
+
tag_options[:contenteditable] = if options[:condensed]
|
36
|
+
"false"
|
37
|
+
elsif respond_to?(:can?) && can?(:manage, pb)
|
38
|
+
"true"
|
39
|
+
elsif respond_to?(:user_signed_in?) && user_signed_in?
|
40
|
+
if current_user.respond_to?(:admin?) && current_user.admin?
|
41
|
+
"true"
|
42
|
+
elsif pb.contentable.present? &&
|
43
|
+
pb.contentable.respond_to?(:user_id) &&
|
44
|
+
pb.contentable.user_id == current_user.id
|
45
|
+
"true"
|
46
|
+
else
|
47
|
+
"false"
|
48
|
+
end
|
49
|
+
else
|
50
|
+
"false"
|
51
|
+
end
|
36
52
|
tag_options[:class] = (tag_options.has_key?(:class) ? "#{tag_options[:class]} ":"") + "polyblock"
|
37
53
|
tag_options[:data][:pb_exists] = pb_exists
|
38
54
|
|
39
55
|
# Truncation
|
40
56
|
if options[:condensed]
|
57
|
+
tag_options[:class] += " polyblock-condensed"
|
41
58
|
content = CGI.unescapeHTML(content.gsub("<br><br>", "<br>").gsub(' ', ' '))
|
42
59
|
content = truncate(sanitize(strip_tags(content)), :length => options[:length], :omission => options[:omission]).html_safe
|
43
60
|
end
|
data/lib/polyblock/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polyblock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MacKinley Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|