thredded 0.12.0 → 0.12.1

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
2
  SHA1:
3
- metadata.gz: 9da3f257731b6397128563a35788225046e8a589
4
- data.tar.gz: fc0b9d0117acd6de8c6d21fa1d3ff629e3e463e3
3
+ metadata.gz: 72449d853f031c774bc914127754b165c39212e9
4
+ data.tar.gz: 16594c731eba3115e424cf58d3fe687945b0750e
5
5
  SHA512:
6
- metadata.gz: d811130638a892c28e07b2065f05b0c8e6edd8d2aabea59691dd0f5653424818978fd4bb2d0676875aa85110e9b58bacda911efc60c26ce4dd5bb53fefa306c6
7
- data.tar.gz: b78b12a3e681153c4b82363b6334a5c09648e86910f17f8d997e4f53dac0cd84555a3141c83d7da20f885b4b532a385913703ad6ff8a36982cc7c4ecc91636d1
6
+ metadata.gz: 32b007d694cc9c51a8262afdf59a92e5d2369ba6e4632e113eba8190cca34e286aa400a667e99b62534625b7e0e6cf51d5ea23afb54d628a7b1218f6e6e6e390
7
+ data.tar.gz: fdb3249473023e280f11fd05e00dcc9f21f6b39029bb296377d7da580df00fe8e91a288e94e27ed2cee1663967a589a1fb43f786baa0282684e06eaf709019a2
data/README.md CHANGED
@@ -99,7 +99,7 @@ Then, see the rest of this Readme for more information about using and customizi
99
99
  Add the gem to your Gemfile:
100
100
 
101
101
  ```ruby
102
- gem 'thredded', '~> 0.12.0'
102
+ gem 'thredded', '~> 0.12.1'
103
103
  ```
104
104
 
105
105
  Add the Thredded [initializer] to your parent app by running the install generator.
@@ -148,11 +148,11 @@ rails g thredded:install
148
148
 
149
149
  But then compare this with the previous version to decide what to keep.
150
150
 
151
- 2) To upgrade the database (in this example from v0.10 to v0.11):
151
+ 2) To upgrade the database (in this example from v0.11 to v0.12):
152
152
 
153
153
  ```console
154
- # Note that for guaranteed best results you will want to run this with the gem checked out with v0.11
155
- cp `bundle show thredded`/db/upgrade_migrations/20170312131417_upgrade_thredded_v0_10_to_v0_11.rb db/migrate
154
+ # Note that for guaranteed best results you will want to run this with the thredded gem at v0.12
155
+ cp "$(bundle show thredded)"/db/upgrade_migrations/20170420163138_upgrade_thredded_v0_11_to_v0_12.rb db/migrate
156
156
  rake db:migrate
157
157
  ```
158
158
 
@@ -72,11 +72,11 @@ module Thredded
72
72
  # @param posts [Thredded::PostsPageView, Array<Thredded::PostView>]
73
73
  # @param partial [String]
74
74
  # @param content_partial [String]
75
- def render_posts(posts, partial: 'thredded/posts/post', content_partial: 'thredded/posts/content')
75
+ def render_posts(posts, partial: 'thredded/posts/post', content_partial: 'thredded/posts/content', locals: {})
76
76
  posts_with_contents = render_collection_to_strings_with_cache(
77
77
  partial: content_partial, collection: posts, as: :post, expires_in: 1.week
78
78
  )
79
- render partial: partial, collection: posts_with_contents, as: :post_and_content
79
+ render partial: partial, collection: posts_with_contents, as: :post_and_content, locals: locals
80
80
  end
81
81
 
82
82
  def paginate(collection, args = {})
@@ -1,6 +1,6 @@
1
1
  <% post, content = post_and_content if local_assigns.key?(:post_and_content) %>
2
2
  <%= content_tag :article, id: dom_id(post), class: "thredded--post thredded--#{post.read_state}--post" do %>
3
- <%= render 'thredded/posts_common/actions', post: post %>
3
+ <%= render 'thredded/posts_common/actions', post: post, actions: local_assigns[:actions] %>
4
4
  <%= render 'thredded/posts_common/header', post: post %>
5
5
  <%= content || render('thredded/posts/content', post: post) %>
6
6
  <% if post.pending_moderation? && !Thredded.content_visible_while_pending_moderation %>
@@ -1,6 +1,7 @@
1
- <% actions = capture do %>
1
+ <% actions ||= {} %>
2
+ <% actions_html = capture do %>
2
3
  <%= view_hooks.post_common.actions.render self, post: post do %>
3
- <% if post.can_reply? %>
4
+ <% if actions[:quote] && post.can_reply? %>
4
5
  <%= render 'thredded/posts_common/actions/quote', post: post %>
5
6
  <% end %>
6
7
  <% if post.can_update? %>
@@ -17,11 +18,11 @@
17
18
  <% end %>
18
19
  <% end %>
19
20
 
20
- <%- if actions.present? %>
21
+ <%- if actions_html.present? %>
21
22
  <div class='thredded--post--dropdown'>
22
23
  <%= inline_svg 'thredded/three-dot-menu.svg', class: 'thredded--post--dropdown--toggle' %>
23
24
  <div class='thredded--post--dropdown--actions'>
24
- <%= actions %>
25
+ <%= actions_html %>
25
26
  </div>
26
27
  </div>
27
28
  <% end %>
@@ -1,6 +1,6 @@
1
1
  <% private_post, content = post_and_content if local_assigns.key?(:post_and_content) %>
2
2
  <%= content_tag :article, id: dom_id(private_post), class: 'thredded--post' do %>
3
- <%= render 'thredded/posts_common/actions', post: private_post %>
3
+ <%= render 'thredded/posts_common/actions', post: private_post, actions: local_assigns[:actions] %>
4
4
  <%= render 'thredded/posts_common/header', post: private_post %>
5
5
  <%= content || render('thredded/private_posts/content', post: post) %>
6
6
  <% end %>
@@ -13,7 +13,8 @@
13
13
  <% end %>
14
14
  <%= render_posts @posts,
15
15
  partial: 'thredded/private_posts/private_post',
16
- content_partial: 'thredded/private_posts/content' %>
16
+ content_partial: 'thredded/private_posts/content',
17
+ locals: { actions: { quote: true } } %>
17
18
  <%= view_hooks.posts_common.pagination_bottom.render(self, posts: @posts) do %>
18
19
  <footer class="thredded--pagination-bottom"><%= paginate @posts %></footer>
19
20
  <% end %>
@@ -12,7 +12,10 @@
12
12
  <%= view_hooks.posts_common.pagination_top.render(self, posts: @posts) do %>
13
13
  <footer class="thredded--pagination-top"><%= paginate @posts %></footer>
14
14
  <% end %>
15
- <%= render_posts @posts, partial: 'thredded/posts/post', content_partial: 'thredded/posts/content' %>
15
+ <%= render_posts @posts,
16
+ partial: 'thredded/posts/post',
17
+ content_partial: 'thredded/posts/content',
18
+ locals: { actions: { quote: true } } %>
16
19
  <%= view_hooks.posts_common.pagination_bottom.render(self, posts: @posts) do %>
17
20
  <footer class="thredded--pagination-bottom"><%= paginate @posts %></footer>
18
21
  <% end %>
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Thredded
3
- VERSION = '0.12.0'
3
+ VERSION = '0.12.1'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thredded
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Oliveira
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-05-03 00:00:00.000000000 Z
12
+ date: 2017-05-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pundit
@@ -1057,7 +1057,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1057
1057
  version: '0'
1058
1058
  requirements: []
1059
1059
  rubyforge_project:
1060
- rubygems_version: 2.6.11
1060
+ rubygems_version: 2.6.12
1061
1061
  signing_key:
1062
1062
  specification_version: 4
1063
1063
  summary: The best Rails forums engine ever.