thredded 0.8.4 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +48 -9
- data/app/assets/images/thredded/breadcrumb-chevron.svg +1 -1
- data/app/assets/images/thredded/follow.svg +1 -1
- data/app/assets/images/thredded/moderation.svg +1 -4
- data/app/assets/images/thredded/private-messages.svg +1 -4
- data/app/assets/images/thredded/settings.svg +1 -4
- data/app/assets/images/thredded/unfollow.svg +1 -1
- data/app/assets/javascripts/thredded/components/time_stamps.es6 +1 -1
- data/app/assets/javascripts/thredded/components/user_preferences_form.es6 +26 -49
- data/app/assets/javascripts/thredded/dependencies.js +2 -1
- data/app/assets/stylesheets/thredded/base/_grid.scss +4 -4
- data/app/assets/stylesheets/thredded/base/_typography.scss +18 -0
- data/app/assets/stylesheets/thredded/components/_base.scss +4 -0
- data/app/assets/stylesheets/thredded/components/_currently-online.scss +4 -0
- data/app/assets/stylesheets/thredded/components/_form-list.scss +5 -0
- data/app/assets/stylesheets/thredded/components/_messageboard.scss +3 -0
- data/app/assets/stylesheets/thredded/components/_post-form.scss +7 -4
- data/app/assets/stylesheets/thredded/components/_post.scss +3 -0
- data/app/assets/stylesheets/thredded/components/_topic-delete.scss +3 -0
- data/app/assets/stylesheets/thredded/components/_topic-header.scss +20 -0
- data/app/assets/stylesheets/thredded/components/_topics.scss +13 -1
- data/app/assets/stylesheets/thredded/layout/_main-navigation.scss +1 -1
- data/app/assets/stylesheets/thredded/layout/_navigation.scss +3 -1
- data/app/assets/stylesheets/thredded/layout/_search-navigation.scss +4 -0
- data/app/assets/stylesheets/thredded/layout/_user-navigation.scss +3 -0
- data/app/commands/thredded/at_notification_extractor.rb +1 -2
- data/app/commands/thredded/autofollow_mentioned_users.rb +0 -1
- data/app/commands/thredded/notify_following_users.rb +20 -11
- data/app/commands/thredded/notify_private_topic_users.rb +12 -28
- data/app/controllers/thredded/application_controller.rb +8 -4
- data/app/controllers/thredded/messageboards_controller.rb +2 -2
- data/app/controllers/thredded/moderation_controller.rb +12 -13
- data/app/controllers/thredded/posts_controller.rb +1 -1
- data/app/controllers/thredded/preferences_controller.rb +11 -7
- data/app/controllers/thredded/private_topics_controller.rb +13 -9
- data/app/controllers/thredded/topics_controller.rb +20 -12
- data/app/forms/thredded/user_preferences_form.rb +23 -4
- data/app/helpers/thredded/application_helper.rb +11 -1
- data/app/mailers/thredded/post_mailer.rb +2 -3
- data/app/mailers/thredded/private_topic_mailer.rb +2 -3
- data/app/models/concerns/thredded/content_moderation_state.rb +1 -1
- data/app/models/concerns/thredded/notifier_preference.rb +18 -0
- data/app/models/concerns/thredded/post_common.rb +5 -1
- data/{lib → app/models/concerns}/thredded/search_parser.rb +0 -0
- data/app/models/concerns/thredded/topic_common.rb +3 -3
- data/{lib → app/models/concerns}/thredded/topics_search.rb +2 -3
- data/app/models/thredded/messageboard.rb +11 -0
- data/app/models/thredded/messageboard_notifications_for_followed_topics.rb +29 -0
- data/app/models/thredded/notifications_for_followed_topics.rb +22 -0
- data/app/models/thredded/notifications_for_private_topics.rb +21 -0
- data/app/models/thredded/post.rb +5 -3
- data/app/models/thredded/post_moderation_record.rb +1 -1
- data/app/models/thredded/private_post.rb +1 -1
- data/app/models/thredded/private_topic.rb +8 -4
- data/app/models/thredded/stats.rb +1 -1
- data/app/models/thredded/topic.rb +10 -7
- data/app/models/thredded/user_detail.rb +1 -1
- data/app/models/thredded/user_extender.rb +3 -1
- data/app/models/thredded/user_preference.rb +16 -5
- data/app/models/thredded/user_private_topic_read_state.rb +1 -1
- data/app/models/thredded/user_topic_read_state.rb +1 -1
- data/app/notifiers/thredded/base_notifier.rb +28 -0
- data/app/notifiers/thredded/email_notifier.rb +34 -0
- data/app/policies/thredded/post_policy.rb +3 -4
- data/app/policies/thredded/private_post_policy.rb +2 -3
- data/app/policies/thredded/topic_policy.rb +1 -2
- data/app/view_hooks/thredded/all_view_hooks.rb +0 -3
- data/app/view_models/thredded/base_topic_view.rb +0 -1
- data/app/view_models/thredded/post_view.rb +0 -1
- data/app/view_models/thredded/posts_page_view.rb +1 -4
- data/app/view_models/thredded/private_topic_view.rb +3 -1
- data/app/view_models/thredded/private_topics_page_view.rb +8 -3
- data/app/view_models/thredded/topic_posts_page_view.rb +1 -2
- data/app/view_models/thredded/topic_view.rb +3 -3
- data/app/view_models/thredded/topics_page_view.rb +0 -1
- data/app/views/thredded/messageboard_groups/new.html.erb +5 -1
- data/app/views/thredded/messageboards/_form.html.erb +7 -2
- data/app/views/thredded/posts/_form.html.erb +2 -1
- data/app/views/thredded/posts/edit.html.erb +3 -2
- data/app/views/thredded/posts_common/_form.html.erb +6 -2
- data/app/views/thredded/preferences/_form.html.erb +41 -29
- data/app/views/thredded/private_posts/_form.html.erb +1 -0
- data/app/views/thredded/private_topics/_form.html.erb +3 -2
- data/app/views/thredded/private_topics/_header.html.erb +4 -0
- data/app/views/thredded/private_topics/_no_private_topics.html.erb +1 -1
- data/app/views/thredded/private_topics/_private_topic.html.erb +5 -2
- data/app/views/thredded/private_topics/edit.html.erb +2 -1
- data/app/views/thredded/private_topics/header/_participant.html.erb +1 -0
- data/app/views/thredded/private_topics/index.html.erb +6 -5
- data/app/views/thredded/private_topics/new.html.erb +0 -1
- data/app/views/thredded/private_topics/private_topic/_participant.html.erb +1 -0
- data/app/views/thredded/private_topics/show.html.erb +1 -3
- data/app/views/thredded/topics/_form.html.erb +1 -1
- data/app/views/thredded/topics/show.html.erb +4 -5
- data/config/locales/en.yml +22 -9
- data/config/locales/pt-BR.yml +22 -10
- data/config/routes.rb +1 -1
- data/db/migrate/20160329231848_create_thredded.rb +23 -3
- data/db/upgrade_migrations/20160410111522_upgrade_v0_2_to_v0_3.rb +1 -1
- data/db/upgrade_migrations/20161113161801_upgrade_v0_8_to_v0_9.rb +56 -0
- data/lib/generators/thredded/install/templates/initializer.rb +28 -0
- data/lib/thredded.rb +32 -8
- data/lib/thredded/content_formatter.rb +3 -2
- data/lib/thredded/database_seeder.rb +11 -8
- data/lib/thredded/db_tools.rb +82 -0
- data/lib/thredded/html_pipeline/wrap_iframes_filter.rb +12 -0
- data/lib/thredded/version.rb +1 -1
- metadata +18 -8
- data/app/models/thredded/null_preference.rb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 279e815e52564fc440a5495e4952aaf8ab84a5fb
|
4
|
+
data.tar.gz: 5907233bce4511abeb29d7d6a9ce01fdb30c1d11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6dc5895f37044bc4da48f31065ecb5a6b42360c56cba3ced82d9ff6723d014c79d249065857dcacaa315803b817515459ac42c4a270cc7281d897d7bc70af67
|
7
|
+
data.tar.gz: be64c3bae2cef65b90988c9473ca1b003fae0fbffa464b717622d982f93a18d4420c695d50d3fd53bef115150d8697b7b474cfdcd70de31a2edfc003bd907328
|
data/README.md
CHANGED
@@ -56,7 +56,7 @@ Then, see the rest of this Readme for more information about using and customizi
|
|
56
56
|
Add the gem to your Gemfile:
|
57
57
|
|
58
58
|
```ruby
|
59
|
-
gem 'thredded', '~> 0.
|
59
|
+
gem 'thredded', '~> 0.9.1'
|
60
60
|
```
|
61
61
|
|
62
62
|
Add the Thredded [initializer] to your parent app by running the install generator.
|
@@ -105,14 +105,26 @@ rails g thredded:install
|
|
105
105
|
|
106
106
|
But then compare this with the previous version to decide what to keep.
|
107
107
|
|
108
|
-
2) To upgrade the database
|
108
|
+
2) To upgrade the database:
|
109
|
+
|
110
|
+
Latest version (in this example from v0.6 to v0.7):
|
109
111
|
|
110
112
|
```console
|
111
|
-
|
113
|
+
# Note that for guaranteed best results you will want to run this with the gem checked out with v0.7.0
|
114
|
+
cp `bundle show thredded`/db/upgrade_migrations/20160723012349_upgrade_v0_6_to_v0_7.rb db/migrate
|
112
115
|
rake db:migrate
|
113
116
|
```
|
114
117
|
|
115
|
-
|
118
|
+
|
119
|
+
To upgrade the database (in this example from v0.7 to v0.8):
|
120
|
+
|
121
|
+
```console
|
122
|
+
# Note that for guaranteed best results you will want to run this with the gem checked out with v0.8.0.
|
123
|
+
cp `bundle show thredded`/db/upgrade_migrations/20161019150201_upgrade_v0_7_to_v0_8.rb db/migrate
|
124
|
+
rake db:migrate
|
125
|
+
```
|
126
|
+
|
127
|
+
|
116
128
|
|
117
129
|
### Migrating from Forem
|
118
130
|
|
@@ -145,30 +157,54 @@ You can also use Thredded with your application (or other) layout by by setting
|
|
145
157
|
|
146
158
|
In this case, you will need to reference your paths/routes carefully and pull in thredded assets (styles and javascript):
|
147
159
|
|
148
|
-
####
|
160
|
+
#### Reference your paths so that Thredded can find them
|
149
161
|
|
150
162
|
In your layout you will probably have links to other paths in your app (e.g. navigation links).
|
151
|
-
For any url helpers (like `users_path` or `projects_path` or whatever) will need to have `main_app.`
|
163
|
+
For any url helpers (like `users_path` or `projects_path` or whatever) will need to have `main_app.`
|
164
|
+
prefixed to them so that they can be found from thredded (`main_app.users_path` will work from both thredded and your app).
|
152
165
|
|
153
166
|
However if you don't want to update your layouts and partials, you can define methods automatically to delegate to the main_app's routes:
|
154
167
|
See https://gist.github.com/timdiggins/bf6d09b28828a392198562c93554ad07.
|
155
168
|
|
156
|
-
####
|
169
|
+
#### Add Thredded styles
|
157
170
|
|
158
171
|
In this case, you will also need to include Thredded styles and JavaScript into the application styles and JavaScript.
|
159
172
|
|
160
|
-
Add thredded styles to your `application.scss
|
173
|
+
Add thredded styles to your `application.scss`:
|
161
174
|
|
162
175
|
```scss
|
163
176
|
@import "thredded";
|
164
177
|
```
|
165
178
|
|
179
|
+
Thredded wraps the views in a container element that has a `max-width` and paddings by default.
|
180
|
+
If your app layout already has a container element that handles these, you can remove the `max-width` and paddings
|
181
|
+
from the Thredded one by adding this Sass snippet after `@import "thredded";`:
|
182
|
+
|
183
|
+
```scss
|
184
|
+
.thredded--main-container {
|
185
|
+
// The padding and max-width are handled by the app's container.
|
186
|
+
max-width: none;
|
187
|
+
padding: 0;
|
188
|
+
@include thredded-media-tablet-and-up {
|
189
|
+
padding: 0;
|
190
|
+
}
|
191
|
+
}
|
192
|
+
```
|
193
|
+
|
194
|
+
See [below](#styles) for customizing the styles via Sass variables.
|
195
|
+
|
196
|
+
#### Add Thredded JavaScripts
|
197
|
+
|
166
198
|
Include thredded JavaScripts in your `application.js`:
|
167
199
|
|
168
200
|
```js
|
169
201
|
//= require thredded
|
170
202
|
```
|
171
203
|
|
204
|
+
Thredded is fully compatible with deferred and async script loading.
|
205
|
+
|
206
|
+
##### jQuery version
|
207
|
+
|
172
208
|
To use thredded with your application layout, you also need to ensure that your layout and thredded don't load different
|
173
209
|
versions of jQuery. By default, Thredded loads jQuery v3 (via `//= require jquery3` from [jquery-rails]),
|
174
210
|
but if you want to use jQuery v1 or v2, then you need to create a file at
|
@@ -274,7 +310,7 @@ any duplicate CSS.
|
|
274
310
|
[select2-rails]: https://github.com/argerim/select2-rails
|
275
311
|
[thredded-scss-base]: https://github.com/thredded/thredded/blob/master/app/assets/stylesheets/thredded/_base.scss
|
276
312
|
|
277
|
-
###
|
313
|
+
### Email and other notifications
|
278
314
|
|
279
315
|
Thredded sends several notification emails to the users. You can override in the same way as the views.
|
280
316
|
If you use [Rails Email Preview], you can include Thredded emails into the list of previews by adding
|
@@ -282,6 +318,9 @@ If you use [Rails Email Preview], you can include Thredded emails into the list
|
|
282
318
|
|
283
319
|
[Rails Email Preview]: https://github.com/glebm/rails_email_preview
|
284
320
|
|
321
|
+
You can also turn off the email notifier totally, or add other notifiers (e.g. Pushover, possibly Slack) by adjusting the
|
322
|
+
`Thredded.notifiers` configuration in your initializer. See the default initializer for examples.
|
323
|
+
|
285
324
|
## I18n
|
286
325
|
|
287
326
|
Thredded is mostly internationalized. It is currently available in English and Brazilian Portuguese. We welcome PRs
|
@@ -1 +1 @@
|
|
1
|
-
<svg
|
1
|
+
<svg viewBox="0 0 7 11" xmlns="http://www.w3.org/2000/svg"><path d="M1.96.19a.47.47 0 0 0-.685 0L.592.91a.52.52 0 0 0 0 .715L3.887 5.03.564 8.462a.52.52 0 0 0 0 .716l.684.717a.47.47 0 0 0 .684 0l4.35-4.508a.528.528 0 0 0 0-.717L1.958.19" fill="#B0AEBC" fill-rule="evenodd"/></svg>
|
@@ -1 +1 @@
|
|
1
|
-
<svg
|
1
|
+
<svg viewBox="0 0 116 121" xmlns="http://www.w3.org/2000/svg"><path d="M57.071 113.714c0-.714-.357-1.071-1.071-1.071-2.634 0-4.9-.949-6.797-2.846-1.897-1.897-2.846-4.163-2.846-6.797 0-.714-.357-1.071-1.071-1.071-.715 0-1.072.357-1.072 1.071 0 3.259 1.15 6.038 3.449 8.337 2.3 2.3 5.078 3.449 8.337 3.449.714 0 1.071-.357 1.071-1.072zM12.473 94.43h87.054C87.652 81.036 81.714 62.464 81.714 38.714c0-2.277-.535-4.62-1.607-7.031-1.071-2.41-2.611-4.71-4.62-6.897-2.01-2.188-4.721-3.985-8.137-5.39-3.415-1.407-7.198-2.11-11.35-2.11-4.152 0-7.935.703-11.35 2.11-3.416 1.405-6.128 3.202-8.137 5.39-2.009 2.187-3.549 4.486-4.62 6.897-1.072 2.41-1.607 4.754-1.607 7.031 0 23.75-5.938 42.322-17.813 55.715zm99.241 0c0 2.321-.848 4.33-2.544 6.026-1.697 1.697-3.706 2.545-6.027 2.545h-30c0 4.732-1.674 8.772-5.022 12.12-3.349 3.349-7.389 5.023-12.121 5.023s-8.772-1.674-12.12-5.022c-3.349-3.349-5.023-7.389-5.023-12.121h-30c-2.321 0-4.33-.848-6.027-2.545C1.134 98.76.286 96.75.286 94.43a58.82 58.82 0 0 0 6.093-5.893c1.83-2.054 3.728-4.721 5.692-8.003 1.965-3.28 3.628-6.819 4.99-10.613 1.36-3.795 2.477-8.393 3.347-13.795.871-5.402 1.306-11.205 1.306-17.41 0-6.786 2.612-13.092 7.835-18.918 5.223-5.826 12.076-9.364 20.558-10.614a6.67 6.67 0 0 1-.536-2.612c0-1.785.625-3.303 1.875-4.553S54.214.143 56 .143c1.786 0 3.304.625 4.554 1.875 1.25 1.25 1.875 2.768 1.875 4.553a6.67 6.67 0 0 1-.536 2.612c8.482 1.25 15.335 4.788 20.558 10.614 5.223 5.826 7.835 12.132 7.835 18.917 0 6.206.435 12.01 1.306 17.411.87 5.402 1.986 10 3.348 13.795 1.361 3.794 3.024 7.332 4.989 10.613 1.964 3.282 3.861 5.95 5.692 8.003a58.82 58.82 0 0 0 6.093 5.893z" fill-rule="evenodd"/></svg>
|
@@ -1,4 +1 @@
|
|
1
|
-
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
2
|
-
<path d="M12 6c0-.55-.45-1-1-1H5.82l.66-3.18.02-.23c0-.31-.13-.59-.33-.8L5.38 0 .44 4.94C.17 5.21 0 5.59 0 6v6.5c0 .83.67 1.5 1.5 1.5h6.75c.62 0 1.15-.38 1.38-.91l2.26-5.29c.07-.17.11-.36.11-.55V6zm10.5 4h-6.75c-.62 0-1.15.38-1.38.91l-2.26 5.29c-.07.17-.11.36-.11.55V18c0 .55.45 1 1 1h5.18l-.66 3.18-.02.24c0 .31.13.59.33.8l.79.78 4.94-4.94c.27-.27.44-.65.44-1.06v-6.5c0-.83-.67-1.5-1.5-1.5z"/>
|
3
|
-
<path d="M0 0h24v24H0z" fill="none"/>
|
4
|
-
</svg>
|
1
|
+
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 6c0-.55-.45-1-1-1H5.82l.66-3.18.02-.23c0-.31-.13-.59-.33-.8L5.38 0 .44 4.94C.17 5.21 0 5.59 0 6v6.5c0 .83.67 1.5 1.5 1.5h6.75c.62 0 1.15-.38 1.38-.91l2.26-5.29c.07-.17.11-.36.11-.55V6zm10.5 4h-6.75c-.62 0-1.15.38-1.38.91l-2.26 5.29c-.07.17-.11.36-.11.55V18c0 .55.45 1 1 1h5.18l-.66 3.18-.02.24c0 .31.13.59.33.8l.79.78 4.94-4.94c.27-.27.44-.65.44-1.06v-6.5c0-.83-.67-1.5-1.5-1.5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
|
@@ -1,4 +1 @@
|
|
1
|
-
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
2
|
-
<path d="M0 0h24v24H0z" fill="none"/>
|
3
|
-
<path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V8l8 5 8-5v10zm-8-7L4 6h16l-8 5z"/>
|
4
|
-
</svg>
|
1
|
+
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"/><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V8l8 5 8-5v10zm-8-7L4 6h16l-8 5z"/></svg>
|
@@ -1,4 +1 @@
|
|
1
|
-
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
2
|
-
<path d="M0 0h24v24H0z" fill="none"/>
|
3
|
-
<path d="M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"/>
|
4
|
-
</svg>
|
1
|
+
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"/><path d="M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65A.488.488 0 0 0 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"/></svg>
|
@@ -1 +1 @@
|
|
1
|
-
<svg
|
1
|
+
<svg viewBox="0 0 138 121" xmlns="http://www.w3.org/2000/svg"><path d="M69.643 113.714c0-.714-.357-1.071-1.072-1.071-2.634 0-4.9-.949-6.796-2.846-1.898-1.897-2.846-4.163-2.846-6.797 0-.714-.358-1.071-1.072-1.071-.714 0-1.071.357-1.071 1.071 0 3.259 1.15 6.038 3.448 8.337 2.3 2.3 5.078 3.449 8.337 3.449.715 0 1.072-.357 1.072-1.072zm-35.96-31.808l58.728-50.893c-1.875-3.928-4.833-7.198-8.873-9.81-4.04-2.611-9.029-3.917-14.967-3.917-4.151 0-7.935.703-11.35 2.11-3.415 1.405-6.127 3.202-8.136 5.39-2.01 2.187-3.55 4.486-4.62 6.897-1.072 2.41-1.608 4.754-1.608 7.031 0 17.143-3.058 31.54-9.174 43.192zm90.603 12.523c0 2.321-.848 4.33-2.545 6.026-1.696 1.697-3.705 2.545-6.027 2.545h-30c0 4.732-1.674 8.772-5.022 12.12-3.348 3.349-7.388 5.023-12.12 5.023-4.733 0-8.762-1.663-12.088-4.989-3.326-3.326-5.01-7.355-5.055-12.087l9.977-8.638h50.692c-7.41-8.349-12.477-18.594-15.2-30.737l7.432-6.496c2.724 15.893 9.375 28.304 19.956 37.233zm5.759-93.215l5.625 6.429c.357.446.524.97.502 1.574a2.052 2.052 0 0 1-.703 1.506L10.112 119.34c-.447.357-.971.514-1.574.469-.603-.045-1.083-.29-1.44-.737l-5.625-6.428c-.357-.447-.524-.971-.502-1.574.022-.602.257-1.082.703-1.44L14.13 98.85c-.848-1.43-1.272-2.903-1.272-4.42a58.82 58.82 0 0 0 6.094-5.893c1.83-2.054 3.728-4.721 5.692-8.003 1.964-3.28 3.627-6.819 4.989-10.613 1.361-3.795 2.477-8.393 3.348-13.795.87-5.402 1.306-11.205 1.306-17.41 0-6.786 2.611-13.092 7.835-18.918 5.223-5.826 12.075-9.364 20.558-10.614a6.67 6.67 0 0 1-.536-2.612c0-1.785.625-3.303 1.875-4.553S66.786.143 68.57.143c1.786 0 3.304.625 4.554 1.875C74.375 3.268 75 4.786 75 6.57a6.67 6.67 0 0 1-.536 2.612c5.536.804 10.424 2.645 14.665 5.525 4.242 2.88 7.545 6.395 9.911 10.546L127.031.946c.447-.357.971-.513 1.574-.468.603.044 1.082.29 1.44.736z" fill-rule="evenodd"/></svg>
|
@@ -1,63 +1,40 @@
|
|
1
1
|
(($) => {
|
2
2
|
const COMPONENT_SELECTOR = '[data-thredded-user-preferences-form]';
|
3
|
-
const
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
this.$followTopicsOnMention = this.$form.find(FOLLOW_TOPICS_ON_MENTION_SELECTOR);
|
12
|
-
this.$messageboardFollowTopicsOnMention = this.$form.find(MESSAGEBOARD_FOLLOW_TOPICS_ON_MENTION_SELECTOR);
|
13
|
-
this.$followedTopicEmails = this.$form.find(FOLLOWED_TOPIC_EMAILS_SELECTOR);
|
14
|
-
this.$messageboardFollowedTopicEmails = this.$form.find(MESSAGEBOARD_FOLLOWED_TOPIC_EMAILS_SELECTOR);
|
15
|
-
|
16
|
-
this.messageboardFollowTopicsOnMentionCheckedWas = this.$messageboardFollowTopicsOnMention.prop('checked');
|
17
|
-
this.$messageboardFollowTopicsOnMention.on('change', () => {
|
18
|
-
this.rememberMessageboardAutofollowTopicsChecked();
|
3
|
+
const BOUND_MESSAGEBOARD_NAME = 'data-thredded-bound-messageboard-pref';
|
4
|
+
|
5
|
+
class MessageboardPreferenceBinding {
|
6
|
+
constructor($form, genericCheckboxName, messageboardCheckboxName) {
|
7
|
+
this.$genericCheckbox = $form.find(`:checkbox[name="${genericCheckboxName}"]`);
|
8
|
+
this.$messageboardCheckbox = $form.find(`:checkbox[name="${messageboardCheckboxName}"]`);
|
9
|
+
this.$messageboardCheckbox.on('change', () => {
|
10
|
+
this.rememberMessageboardChecked();
|
19
11
|
});
|
20
|
-
this.
|
21
|
-
|
22
|
-
|
23
|
-
this.updateMessageboardAutofollowTopics();
|
24
|
-
});
|
25
|
-
this.updateMessageboardAutofollowTopics();
|
26
|
-
|
27
|
-
this.messageboardFollowedTopicEmailsCheckedWas = this.$messageboardFollowedTopicEmails.prop('checked');
|
28
|
-
this.$messageboardFollowedTopicEmails.on('change', () => {
|
29
|
-
this.rememberMessageboardFollowedTopicEmailsChecked();
|
12
|
+
this.rememberMessageboardChecked();
|
13
|
+
this.$genericCheckbox.on('change', () => {
|
14
|
+
this.updateMessageboardCheckbox();
|
30
15
|
});
|
31
|
-
this.
|
32
|
-
|
33
|
-
this.$followedTopicEmails.on('change', () => {
|
34
|
-
this.updateMessageboardFollowedTopicEmails();
|
35
|
-
});
|
36
|
-
this.updateMessageboardFollowedTopicEmails();
|
16
|
+
this.updateMessageboardCheckbox();
|
37
17
|
}
|
38
18
|
|
39
|
-
|
40
|
-
this.
|
41
|
-
this.$messageboardFollowTopicsOnMention.filter(':checkbox').prop('checked');
|
19
|
+
rememberMessageboardChecked() {
|
20
|
+
this.messageboardCheckedWas = this.$messageboardCheckbox.filter(':checkbox').prop('checked');
|
42
21
|
}
|
43
22
|
|
44
|
-
|
45
|
-
const enabled = this.$
|
46
|
-
this.$
|
23
|
+
updateMessageboardCheckbox() {
|
24
|
+
const enabled = this.$genericCheckbox.prop('checked');
|
25
|
+
this.$messageboardCheckbox
|
47
26
|
.prop('disabled', !enabled)
|
48
|
-
.filter(':checkbox').prop('checked', enabled ? this.
|
49
|
-
}
|
50
|
-
|
51
|
-
rememberMessageboardFollowedTopicEmailsChecked() {
|
52
|
-
this.messageboardFollowedTopicEmailsCheckedWas =
|
53
|
-
this.$messageboardFollowedTopicEmails.filter(':checkbox').prop('checked');
|
27
|
+
.filter(':checkbox').prop('checked', enabled ? this.messageboardCheckedWas : false);
|
54
28
|
}
|
55
29
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
30
|
+
}
|
31
|
+
class UserPreferencesForm {
|
32
|
+
constructor(form) {
|
33
|
+
const $form = $(form);
|
34
|
+
$form.find(`input[${BOUND_MESSAGEBOARD_NAME}]`).each((index, element) => {
|
35
|
+
const $elem = $(element);
|
36
|
+
new MessageboardPreferenceBinding($form, $elem.attr('name'), $elem.attr(BOUND_MESSAGEBOARD_NAME));
|
37
|
+
})
|
61
38
|
}
|
62
39
|
}
|
63
40
|
|
@@ -1,8 +1,9 @@
|
|
1
1
|
//= require thredded/dependencies/jquery
|
2
|
+
// Require jquery.timeago instead of rails-timeago so that we can control the initialization.
|
3
|
+
//= require jquery.timeago
|
2
4
|
//= require jquery_ujs
|
3
5
|
//= require jquery.autosize
|
4
6
|
//= require jquery.textcomplete
|
5
|
-
//= require rails-timeago
|
6
7
|
//= require select2
|
7
8
|
|
8
9
|
// We are not currently using any features that require the Babel polyfill
|
@@ -1,17 +1,17 @@
|
|
1
1
|
@mixin thredded-media-mobile {
|
2
|
-
@media
|
2
|
+
@media (max-width: map-get($thredded-grid-breakpoint-max-widths, mobile)) {
|
3
3
|
@content;
|
4
4
|
}
|
5
5
|
}
|
6
6
|
|
7
7
|
@mixin thredded-media-tablet-and-down {
|
8
|
-
@media
|
8
|
+
@media (max-width: map-get($thredded-grid-breakpoint-max-widths, tablet)) {
|
9
9
|
@content;
|
10
10
|
}
|
11
11
|
}
|
12
12
|
|
13
13
|
@mixin thredded-media-tablet-and-up {
|
14
|
-
@media
|
14
|
+
@media (min-width: map-get($thredded-grid-breakpoint-max-widths, mobile) + 0.00001rem) {
|
15
15
|
@content;
|
16
16
|
}
|
17
17
|
}
|
@@ -25,7 +25,7 @@
|
|
25
25
|
}
|
26
26
|
|
27
27
|
@mixin thredded-media-desktop-and-up {
|
28
|
-
@media
|
28
|
+
@media (min-width: map-get($thredded-grid-breakpoint-max-widths, tablet) + 0.00001rem) {
|
29
29
|
@content;
|
30
30
|
}
|
31
31
|
}
|
@@ -48,3 +48,21 @@
|
|
48
48
|
margin-bottom: 0;
|
49
49
|
}
|
50
50
|
}
|
51
|
+
|
52
|
+
%thredded--embed-16-by-9 {
|
53
|
+
display: block;
|
54
|
+
position: relative;
|
55
|
+
// 16 by 9
|
56
|
+
padding-bottom: 56.25%;
|
57
|
+
// Account for the video player chrome
|
58
|
+
padding-top: 35px;
|
59
|
+
height: 0;
|
60
|
+
overflow: hidden;
|
61
|
+
> iframe {
|
62
|
+
position: absolute;
|
63
|
+
top: 0;
|
64
|
+
left: 0;
|
65
|
+
width: 100%;
|
66
|
+
height: 100%;
|
67
|
+
}
|
68
|
+
}
|
@@ -6,10 +6,7 @@
|
|
6
6
|
&--wrapper {
|
7
7
|
border-top: $thredded-base-border;
|
8
8
|
margin-top: $thredded-base-spacing;
|
9
|
-
padding-top: $thredded-
|
10
|
-
@include thredded-media-mobile {
|
11
|
-
padding-top: $thredded-base-spacing;
|
12
|
-
}
|
9
|
+
padding-top: $thredded-base-spacing;
|
13
10
|
}
|
14
11
|
|
15
12
|
&--title {
|
@@ -22,3 +19,9 @@
|
|
22
19
|
margin-top: $thredded-small-spacing;
|
23
20
|
}
|
24
21
|
}
|
22
|
+
|
23
|
+
.thredded--post-form--wrapper {
|
24
|
+
@media print {
|
25
|
+
display: none;
|
26
|
+
}
|
27
|
+
}
|
@@ -18,6 +18,20 @@
|
|
18
18
|
}
|
19
19
|
}
|
20
20
|
|
21
|
+
.thredded--topic-header--participants {
|
22
|
+
color: $thredded-secondary-text-color;
|
23
|
+
|
24
|
+
&--participant {
|
25
|
+
> a {
|
26
|
+
@extend %thredded--link;
|
27
|
+
font-size: $thredded-font-size-small;
|
28
|
+
}
|
29
|
+
&::before {
|
30
|
+
content: '\2022\00A0'; // • and a non-breaking space
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
21
35
|
.thredded--topic-header--started-by {
|
22
36
|
font-size: $thredded-font-size-small;
|
23
37
|
color: $thredded-secondary-text-color;
|
@@ -31,6 +45,9 @@
|
|
31
45
|
@extend %thredded--link;
|
32
46
|
font-size: $thredded-font-size-small;
|
33
47
|
margin-left: 0.4rem;
|
48
|
+
@media print {
|
49
|
+
display: none;
|
50
|
+
}
|
34
51
|
}
|
35
52
|
|
36
53
|
.thredded--topic-header--follow-info {
|
@@ -72,6 +89,9 @@
|
|
72
89
|
cursor: pointer;
|
73
90
|
@extend %thredded--link;
|
74
91
|
}
|
92
|
+
@media print {
|
93
|
+
display: none;
|
94
|
+
}
|
75
95
|
}
|
76
96
|
}
|
77
97
|
|
@@ -60,7 +60,6 @@
|
|
60
60
|
color: lighten($thredded-text-color, 20%);
|
61
61
|
|
62
62
|
&:hover {
|
63
|
-
|
64
63
|
color: $thredded-action-color;
|
65
64
|
}
|
66
65
|
}
|
@@ -82,6 +81,12 @@
|
|
82
81
|
}
|
83
82
|
}
|
84
83
|
|
84
|
+
.thredded--topics--participants--participant {
|
85
|
+
& + &::before {
|
86
|
+
content: '\2022\00A0'; // • and a non-breaking space
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
85
90
|
.thredded--topics--started-by {
|
86
91
|
display: none;
|
87
92
|
|
@@ -154,3 +159,10 @@
|
|
154
159
|
@extend %thredded--not-following-icon;
|
155
160
|
}
|
156
161
|
}
|
162
|
+
|
163
|
+
.thredded--new-topic-form,
|
164
|
+
.thredded--new-private-topic-form {
|
165
|
+
@media print {
|
166
|
+
display: none;
|
167
|
+
}
|
168
|
+
}
|