thredded 0.15.2 → 0.15.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb521ffdf8a0e754e7e55a856a649913e79295cd33799f29efeab2311f7f0f12
4
- data.tar.gz: 0c40013b94c70655bb7de0edcb84bae86a6c4a8d66dc9e84a95682f82e568293
3
+ metadata.gz: 3b352700d9047e3e225b310dfc168d67b67ae3159da12baa88893b1185f89b46
4
+ data.tar.gz: 8301bfe7de537c66eac09594ec89371490b5770b7dbaae223f268c41db2bcb98
5
5
  SHA512:
6
- metadata.gz: bf907ac1caa92e8d6362369c13eb0be750f95237c8a4670426f7973346de420bf6e17fa5bbd54ece98a06acad5522eb601838ea0b0c97e4799d926039be3b95d
7
- data.tar.gz: 626752cbba2144434a985f4af447dcf174dd33bf1dbc8e93a28124d34be5177ddcbae74a7232dbbb821419a49e82da2af670f0dc4de4dad8514fdac06213557e
6
+ metadata.gz: 95cf96447f824d72a3260f9a27ce35aa3827d1d6e64419a184bf8c76e50382a6ed759d46914f72c3680e7553fd25cd6235246b4864bc8dc85ac6e84c3c6bba79
7
+ data.tar.gz: db8e6876bab1e834633aff07da90cde4b0a6e90b3469615bb21c62f00c8c57ce9b7e47dc148c5e319cf0ce2371c30d33f7e51f95d2e55ba0265f37956ac76c3b
data/README.md CHANGED
@@ -95,7 +95,7 @@ Then, see the rest of this Readme for more information about using and customizi
95
95
  Add the gem to your Gemfile:
96
96
 
97
97
  ```ruby
98
- gem 'thredded', '~> 0.15.2'
98
+ gem 'thredded', '~> 0.15.3'
99
99
  ```
100
100
 
101
101
  Add the Thredded [initializer] to your parent app by running the install generator.
@@ -20,6 +20,7 @@
20
20
  margin-bottom: $thredded-small-spacing;
21
21
  padding: $thredded-small-spacing;
22
22
  text-decoration: none;
23
+ width: 100%;
23
24
 
24
25
  @include thredded-media-desktop-and-up {
25
26
  margin-bottom: $thredded-base-spacing;
@@ -23,7 +23,6 @@
23
23
 
24
24
  %thredded--nav-tabs {
25
25
  @extend %thredded--list-unstyled;
26
- @include thredded--clearfix;
27
26
  border-bottom: $thredded-base-border;
28
27
  font-size: $thredded-font-size-small;
29
28
  margin-left: 0;
@@ -1,6 +1,4 @@
1
1
  .thredded--navigation {
2
- display: flex;
3
- flex-direction: column;
4
2
  position: relative;
5
3
  .thredded--icon {
6
4
  display: none;
@@ -35,10 +33,6 @@
35
33
  position: relative;
36
34
  width: 100%;
37
35
  }
38
- .thredded--main-navigation {
39
- position: relative;
40
- border: none;
41
- }
42
36
  .thredded--navigation-breadcrumbs {
43
37
  font-size: $thredded-font-size-small;
44
38
  padding-right: $icon-nav-item-width * 1;
@@ -127,14 +127,10 @@ module Thredded
127
127
  nil
128
128
  end
129
129
 
130
- def in_messageboard?
131
- params.key?(:messageboard_id)
132
- end
133
-
134
130
  # @return [ActiveRecord::Relation]
135
131
  def topics_scope
136
132
  @topics_scope ||=
137
- if in_messageboard?
133
+ if messageboard_or_nil
138
134
  policy_scope(messageboard.topics)
139
135
  else
140
136
  policy_scope(Thredded::Topic.all).joins(:messageboard).merge(policy_scope(Thredded::Messageboard.all))
@@ -157,7 +153,7 @@ module Thredded
157
153
  @unread_followed_topics_count ||=
158
154
  if thredded_signed_in?
159
155
  scope = topics_scope
160
- scope = topics_scope.where(messageboard_id: messageboard.id) if in_messageboard?
156
+ scope = topics_scope.where(messageboard_id: messageboard.id) if messageboard_or_nil
161
157
  scope.unread_followed_by(thredded_current_user).count
162
158
  else
163
159
  0
@@ -168,7 +164,7 @@ module Thredded
168
164
  @unread_topics_count ||=
169
165
  if thredded_signed_in?
170
166
  scope = topics_scope
171
- scope = topics_scope.where(messageboard_id: messageboard.id) if in_messageboard?
167
+ scope = topics_scope.where(messageboard_id: messageboard.id) if messageboard_or_nil
172
168
  scope.unread(thredded_current_user).count
173
169
  else
174
170
  0
@@ -141,6 +141,10 @@ module Thredded
141
141
 
142
142
  private
143
143
 
144
+ def in_messageboard?
145
+ params.key?(:messageboard_id)
146
+ end
147
+
144
148
  def init_new_topic
145
149
  return unless in_messageboard?
146
150
  form = Thredded::TopicForm.new(messageboard: messageboard, user: thredded_current_user)
@@ -32,7 +32,7 @@ module Thredded
32
32
  friendly_id :slug_candidates,
33
33
  use: %i[history reserved],
34
34
  # Avoid route conflicts
35
- reserved_words: ::Thredded::FriendlyIdReservedWordsAndPagination.new(%w[topics])
35
+ reserved_words: ::Thredded::FriendlyIdReservedWordsAndPagination.new(%w[topics unread])
36
36
 
37
37
  belongs_to :user,
38
38
  class_name: Thredded.user_class_name,
@@ -1,3 +1,3 @@
1
- <header>
1
+ <header class="thredded--main-header">
2
2
  <%= render 'thredded/shared/nav' %>
3
3
  </header>
@@ -16,9 +16,9 @@
16
16
  <%= yield :thredded_breadcrumbs %>
17
17
  <%= render 'thredded/search/form', messageboard: messageboard_or_nil %>
18
18
  <div class="thredded--spacer"></div>
19
- <div class="thredded--scoped-navigation">
19
+ <ul class="thredded--scoped-navigation">
20
20
  <%= render 'thredded/shared/nav/unread_topics', messageboard: messageboard_or_nil %>
21
- </div>
21
+ </ul>
22
22
  </div>
23
23
  <% end %>
24
24
  </nav>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Thredded
4
- VERSION = '0.15.2'
4
+ VERSION = '0.15.3'
5
5
  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.15.2
4
+ version: 0.15.3
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: 2018-06-09 00:00:00.000000000 Z
12
+ date: 2018-06-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pundit