thredded 0.15.2 → 0.15.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/assets/stylesheets/thredded/base/_alerts.scss +1 -0
- data/app/assets/stylesheets/thredded/base/_nav.scss +0 -1
- data/app/assets/stylesheets/thredded/layout/_navigation.scss +0 -6
- data/app/controllers/thredded/application_controller.rb +3 -7
- data/app/controllers/thredded/topics_controller.rb +4 -0
- data/app/models/thredded/topic.rb +1 -1
- data/app/views/thredded/shared/_header.html.erb +1 -1
- data/app/views/thredded/shared/_nav.html.erb +2 -2
- data/lib/thredded/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b352700d9047e3e225b310dfc168d67b67ae3159da12baa88893b1185f89b46
|
4
|
+
data.tar.gz: 8301bfe7de537c66eac09594ec89371490b5770b7dbaae223f268c41db2bcb98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
@@ -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
|
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
|
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
|
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,
|
@@ -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
|
-
<
|
19
|
+
<ul class="thredded--scoped-navigation">
|
20
20
|
<%= render 'thredded/shared/nav/unread_topics', messageboard: messageboard_or_nil %>
|
21
|
-
</
|
21
|
+
</ul>
|
22
22
|
</div>
|
23
23
|
<% end %>
|
24
24
|
</nav>
|
data/lib/thredded/version.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2018-06-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: pundit
|