thredded 0.6.3 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -12
- data/app/assets/images/thredded/follow.svg +1 -0
- data/app/assets/images/thredded/unfollow.svg +1 -0
- data/app/assets/stylesheets/thredded/_thredded.scss +27 -28
- data/app/assets/stylesheets/thredded/components/_alerts.scss +5 -5
- data/app/assets/stylesheets/thredded/components/_base.scss +5 -5
- data/app/assets/stylesheets/thredded/components/_currently-online.scss +1 -1
- data/app/assets/stylesheets/thredded/components/_empty.scss +2 -2
- data/app/assets/stylesheets/thredded/components/_flash-message.scss +5 -5
- data/app/assets/stylesheets/thredded/components/_following.scss +17 -0
- data/app/assets/stylesheets/thredded/components/_form-list.scss +3 -3
- data/app/assets/stylesheets/thredded/components/_icons.scss +1 -1
- data/app/assets/stylesheets/thredded/components/_main-section.scss +1 -1
- data/app/assets/stylesheets/thredded/components/_messageboard.scss +6 -6
- data/app/assets/stylesheets/thredded/components/_pagination.scss +1 -1
- data/app/assets/stylesheets/thredded/components/_post-form.scss +1 -1
- data/app/assets/stylesheets/thredded/components/_post.scss +12 -11
- data/app/assets/stylesheets/thredded/components/_preferences.scss +1 -1
- data/app/assets/stylesheets/thredded/components/_select2.scss +4 -4
- data/app/assets/stylesheets/thredded/components/_topic-delete.scss +4 -8
- data/app/assets/stylesheets/thredded/components/_topic-header.scss +25 -11
- data/app/assets/stylesheets/thredded/components/_topics.scss +37 -15
- data/app/assets/stylesheets/thredded/layout/_main-container.scss +1 -1
- data/app/assets/stylesheets/thredded/layout/_main-navigation.scss +2 -2
- data/app/assets/stylesheets/thredded/layout/_moderation.scss +16 -15
- data/app/assets/stylesheets/thredded/layout/_navigation.scss +6 -6
- data/app/assets/stylesheets/thredded/layout/_search-navigation.scss +1 -1
- data/app/assets/stylesheets/thredded/layout/_user-navigation.scss +13 -13
- data/app/assets/stylesheets/thredded/layout/_user.scss +1 -1
- data/app/assets/stylesheets/thredded/utilities/_is-compact.scss +1 -1
- data/app/assets/stylesheets/thredded/utilities/_is-expanded.scss +1 -1
- data/app/commands/thredded/notify_following_users.rb +1 -1
- data/app/controllers/thredded/messageboard_groups_controller.rb +3 -1
- data/app/controllers/thredded/messageboards_controller.rb +1 -3
- data/app/controllers/thredded/private_topics_controller.rb +1 -1
- data/app/controllers/thredded/topics_controller.rb +16 -9
- data/app/helpers/thredded/application_helper.rb +36 -0
- data/app/models/concerns/thredded/topic_common.rb +2 -2
- data/app/models/concerns/thredded/user_topic_read_state_common.rb +1 -1
- data/app/models/thredded/messageboard.rb +34 -7
- data/app/models/thredded/messageboard_group.rb +8 -1
- data/app/models/thredded/null_user.rb +4 -0
- data/app/models/thredded/post_moderation_record.rb +1 -1
- data/app/models/thredded/private_post.rb +5 -1
- data/app/models/thredded/stats.rb +1 -1
- data/app/models/thredded/topic.rb +5 -3
- data/app/models/thredded/user_detail.rb +2 -0
- data/app/models/thredded/user_extender.rb +4 -2
- data/app/models/thredded/user_topic_follow.rb +12 -1
- data/app/view_models/thredded/base_topic_view.rb +1 -1
- data/app/view_models/thredded/messageboard_group_view.rb +11 -0
- data/app/view_models/thredded/topic_view.rb +15 -2
- data/app/views/thredded/messageboards/_messageboard.html.erb +2 -2
- data/app/views/thredded/moderation/_post.html.erb +1 -1
- data/app/views/thredded/moderation/_post_moderation_record.html.erb +1 -1
- data/app/views/thredded/moderation/user.html.erb +1 -1
- data/app/views/thredded/moderation/users.html.erb +1 -1
- data/app/views/thredded/private_topic_mailer/message_notification.html.erb +1 -1
- data/app/views/thredded/private_topic_mailer/message_notification.text.erb +1 -1
- data/app/views/thredded/private_topics/_private_topic.html.erb +1 -1
- data/app/views/thredded/shared/_currently_online.html.erb +1 -1
- data/app/views/thredded/shared/_nav.html.erb +1 -1
- data/app/views/thredded/shared/_page.html.erb +2 -2
- data/app/views/thredded/topics/_followers.html.erb +12 -0
- data/app/views/thredded/topics/_header.html.erb +10 -9
- data/app/views/thredded/topics/_topic.html.erb +13 -2
- data/app/views/thredded/topics/index.html.erb +5 -0
- data/app/views/thredded/users/_link.html.erb +2 -2
- data/config/locales/en.yml +20 -18
- data/config/locales/pt-BR.yml +14 -9
- data/db/migrate/20160329231848_create_thredded.rb +4 -0
- data/db/upgrade_migrations/20160611094616_upgrade_v0_5_to_v0_6.rb +1 -1
- data/db/upgrade_migrations/20160723012349_upgrade_v0_6_to_v0_7.rb +43 -0
- data/lib/generators/thredded/install/templates/initializer.rb +15 -0
- data/lib/html/pipeline/at_mention_filter.rb +1 -1
- data/lib/thredded.rb +24 -0
- data/lib/thredded/database_seeder.rb +15 -5
- data/lib/thredded/version.rb +1 -1
- metadata +8 -9
- data/CHANGELOG.md +0 -399
- data/Procfile +0 -1
- data/config.ru +0 -3
- data/heroku.gemfile +0 -28
- data/heroku.gemfile.lock +0 -268
- data/thredded.gemspec +0 -78
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
.thredded--topic-header {
|
2
2
|
margin-bottom: $thredded-large-spacing;
|
3
3
|
margin-top: $thredded-base-spacing;
|
4
4
|
@include thredded-media-mobile {
|
@@ -7,14 +7,14 @@
|
|
7
7
|
}
|
8
8
|
}
|
9
9
|
|
10
|
-
|
10
|
+
.thredded--topic-header--title {
|
11
11
|
@extend %thredded--heading;
|
12
12
|
font-size: 1.5rem; // 24px
|
13
13
|
line-height: 1.2;
|
14
14
|
margin-bottom: $thredded-small-spacing / 2;
|
15
15
|
}
|
16
16
|
|
17
|
-
|
17
|
+
.thredded--topic-header--started-by {
|
18
18
|
font-size: $thredded-font-size-small;
|
19
19
|
color: $thredded-secondary-text-color;
|
20
20
|
font-style: normal;
|
@@ -23,20 +23,16 @@
|
|
23
23
|
}
|
24
24
|
}
|
25
25
|
|
26
|
-
|
26
|
+
.thredded--topic-header--edit-topic {
|
27
27
|
@extend %thredded--link;
|
28
28
|
font-size: $thredded-font-size-small;
|
29
29
|
margin-left: 0.4rem;
|
30
30
|
}
|
31
|
-
|
31
|
+
|
32
|
+
.thredded--topic-header--follow-info {
|
32
33
|
float: right;
|
33
34
|
color: $thredded-secondary-text-color;
|
34
|
-
|
35
|
-
font-size: 0.65rem;
|
36
|
-
}
|
37
|
-
&.thredded--notfollowing {
|
38
|
-
font-size: $thredded-font-size-small;
|
39
|
-
}
|
35
|
+
font-size: $thredded-font-size-small;
|
40
36
|
font-style: normal;
|
41
37
|
max-width: 60%;
|
42
38
|
text-align: right;
|
@@ -55,3 +51,21 @@
|
|
55
51
|
}
|
56
52
|
}
|
57
53
|
}
|
54
|
+
|
55
|
+
.thredded--topic-following {
|
56
|
+
.thredded--topic-header--follow-info {
|
57
|
+
position: relative;
|
58
|
+
}
|
59
|
+
.thredded--topic-header--follow-icon {
|
60
|
+
@extend %thredded--following-icon;
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
.thredded--topic-followers {
|
65
|
+
font-size: $thredded-font-size-small;
|
66
|
+
color: $thredded-secondary-text-color;
|
67
|
+
}
|
68
|
+
|
69
|
+
.thredded--svg-definitions {
|
70
|
+
display: none;
|
71
|
+
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
.thredded--topics--topic {
|
2
2
|
margin-bottom: $thredded-base-spacing;
|
3
3
|
position: relative;
|
4
4
|
|
@@ -7,7 +7,7 @@
|
|
7
7
|
}
|
8
8
|
}
|
9
9
|
|
10
|
-
|
10
|
+
.thredded--topics--title {
|
11
11
|
@extend %thredded--heading;
|
12
12
|
display: inline;
|
13
13
|
font-size: 1.125rem; // 18px
|
@@ -24,7 +24,7 @@
|
|
24
24
|
}
|
25
25
|
}
|
26
26
|
|
27
|
-
|
27
|
+
.thredded--topics--categories {
|
28
28
|
list-style-type: none;
|
29
29
|
margin: 0;
|
30
30
|
padding: 0;
|
@@ -45,8 +45,8 @@
|
|
45
45
|
}
|
46
46
|
}
|
47
47
|
|
48
|
-
|
49
|
-
|
48
|
+
.thredded--topics--started-by,
|
49
|
+
.thredded--topics--updated-by {
|
50
50
|
color: $thredded-secondary-text-color;
|
51
51
|
font-size: $thredded-font-size-small;
|
52
52
|
font-style: normal;
|
@@ -68,7 +68,7 @@
|
|
68
68
|
}
|
69
69
|
}
|
70
70
|
|
71
|
-
|
71
|
+
.thredded--topics--updated-by {
|
72
72
|
margin-right: $thredded-small-spacing;
|
73
73
|
|
74
74
|
abbr {
|
@@ -78,7 +78,7 @@
|
|
78
78
|
}
|
79
79
|
}
|
80
80
|
|
81
|
-
|
81
|
+
.thredded--topics--started-by {
|
82
82
|
display: none;
|
83
83
|
|
84
84
|
abbr {
|
@@ -88,13 +88,13 @@
|
|
88
88
|
}
|
89
89
|
}
|
90
90
|
|
91
|
-
|
91
|
+
.thredded--topics--moderation-state {
|
92
92
|
padding: 0.3em 0.5em;
|
93
93
|
font-size: $thredded-font-size-small;
|
94
94
|
font-style: normal;
|
95
95
|
}
|
96
96
|
|
97
|
-
|
97
|
+
.thredded--topics--posts-count {
|
98
98
|
border-radius: 50%;
|
99
99
|
display: inline-block;
|
100
100
|
font-weight: 900;
|
@@ -110,12 +110,34 @@
|
|
110
110
|
transition: background 0.1s linear, color 0.1s linear;
|
111
111
|
}
|
112
112
|
|
113
|
-
|
114
|
-
|
115
|
-
|
113
|
+
.thredded--topic-read {
|
114
|
+
> .thredded--topics--title a {
|
115
|
+
font-weight: lighter;
|
116
|
+
}
|
117
|
+
> .thredded--topics--posts-count {
|
118
|
+
background: $thredded-badge-inactive-background;
|
119
|
+
color: $thredded-badge-inactive-color;
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
.thredded--topic-unread {
|
124
|
+
> .thredded--topics--title a {
|
125
|
+
font-weight: bold;
|
126
|
+
}
|
127
|
+
> .thredded--topics--posts-count {
|
128
|
+
background: $thredded-badge-active-background;
|
129
|
+
color: $thredded-badge-active-color;
|
130
|
+
}
|
116
131
|
}
|
117
132
|
|
118
|
-
|
119
|
-
|
120
|
-
|
133
|
+
.thredded--topic-following {
|
134
|
+
.thredded--topics--follow-icon {
|
135
|
+
@extend %thredded--following-icon;
|
136
|
+
}
|
137
|
+
}
|
138
|
+
|
139
|
+
.thredded--topic-notfollowing {
|
140
|
+
.thredded--topics--follow-icon {
|
141
|
+
@extend %thredded--not-following-icon;
|
142
|
+
}
|
121
143
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
.thredded--main-navigation {
|
2
2
|
@extend %thredded--list-unstyled;
|
3
3
|
@include thredded--clearfix;
|
4
4
|
display: block;
|
@@ -7,7 +7,7 @@
|
|
7
7
|
}
|
8
8
|
}
|
9
9
|
|
10
|
-
|
10
|
+
.thredded--navigation-breadcrumbs {
|
11
11
|
@extend %thredded--list-unstyled;
|
12
12
|
|
13
13
|
li {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
.thredded--moderation-navigation {
|
2
2
|
position: relative;
|
3
3
|
&--items {
|
4
4
|
@extend %thredded--nav-tabs;
|
@@ -8,31 +8,32 @@
|
|
8
8
|
}
|
9
9
|
}
|
10
10
|
|
11
|
-
.thredded--pending-moderation
|
12
|
-
.thredded--moderation-history
|
13
|
-
.thredded--moderation-users
|
14
|
-
.thredded--moderation-user
|
15
|
-
.thredded--moderation-activity
|
11
|
+
.thredded--pending-moderation .thredded--moderation-navigation--pending,
|
12
|
+
.thredded--moderation-history .thredded--moderation-navigation--history,
|
13
|
+
.thredded--moderation-users .thredded--moderation-navigation--users,
|
14
|
+
.thredded--moderation-user .thredded--moderation-navigation--users,
|
15
|
+
.thredded--moderation-activity .thredded--moderation-navigation--activity {
|
16
16
|
@extend %thredded--nav-tabs--item-current;
|
17
17
|
}
|
18
18
|
|
19
|
-
|
19
|
+
.thredded--post-moderation-actions {
|
20
20
|
@extend %thredded--buttons-list;
|
21
21
|
}
|
22
22
|
|
23
|
-
|
23
|
+
.thredded--moderated-notice {
|
24
24
|
margin-bottom: $thredded-base-spacing;
|
25
25
|
padding: $thredded-small-spacing $thredded-base-spacing;
|
26
26
|
background: $thredded-light-gray;
|
27
27
|
}
|
28
28
|
|
29
|
-
|
29
|
+
.thredded--post-moderation,
|
30
|
+
.thredded--post-moderation-record {
|
30
31
|
.thredded--post--user a {
|
31
32
|
color: $thredded-action-color;
|
32
33
|
}
|
33
34
|
}
|
34
35
|
|
35
|
-
|
36
|
+
.thredded--post-moderation-record {
|
36
37
|
.thredded--post {
|
37
38
|
margin-bottom: 0;
|
38
39
|
margin-left: 1rem;
|
@@ -60,26 +61,26 @@
|
|
60
61
|
}
|
61
62
|
}
|
62
63
|
|
63
|
-
|
64
|
+
.thredded--post-moderation-record + .thredded--post-moderation-record {
|
64
65
|
margin-top: $thredded-large-spacing;
|
65
66
|
}
|
66
67
|
|
67
|
-
|
68
|
+
.thredded--moderation--users-table {
|
68
69
|
width: 100%;
|
69
70
|
a {
|
70
71
|
display: block;
|
71
72
|
}
|
72
73
|
}
|
73
74
|
|
74
|
-
|
75
|
+
.thredded--moderation--user--title {
|
75
76
|
margin: 0;
|
76
77
|
}
|
77
78
|
|
78
|
-
|
79
|
+
.thredded--moderation--user--info {
|
79
80
|
margin-left: 2rem;
|
80
81
|
}
|
81
82
|
|
82
|
-
|
83
|
+
.thredded--user--moderation-actions {
|
83
84
|
text-align: left;
|
84
85
|
margin-left: 4rem;
|
85
86
|
.button_to {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
.thredded--navigation {
|
2
2
|
margin-bottom: $thredded-small-spacing;
|
3
3
|
position: relative;
|
4
4
|
.thredded--icon {
|
@@ -8,23 +8,23 @@
|
|
8
8
|
|
9
9
|
@include thredded-media-tablet-and-down {
|
10
10
|
$icon-nav-item-width: 2.625rem;
|
11
|
-
|
11
|
+
.thredded--navigation {
|
12
12
|
display: table;
|
13
13
|
position: relative;
|
14
14
|
width: 100%;
|
15
15
|
}
|
16
|
-
|
16
|
+
.thredded--main-navigation {
|
17
17
|
position: relative;
|
18
18
|
border: none;
|
19
19
|
}
|
20
|
-
|
20
|
+
.thredded--navigation-breadcrumbs {
|
21
21
|
font-size: $thredded-font-size-small;
|
22
22
|
padding-right: $icon-nav-item-width * 2;
|
23
23
|
.thredded--is-moderator & {
|
24
24
|
padding-right: $icon-nav-item-width * 3;
|
25
25
|
}
|
26
26
|
}
|
27
|
-
|
27
|
+
.thredded--navigation--search-topics {
|
28
28
|
display: none;
|
29
29
|
.thredded--messageboards-index &,
|
30
30
|
.thredded--topics-index &,
|
@@ -32,7 +32,7 @@
|
|
32
32
|
display: block;
|
33
33
|
}
|
34
34
|
}
|
35
|
-
|
35
|
+
.thredded--user-navigation {
|
36
36
|
display: table-footer-group;
|
37
37
|
&-standalone {
|
38
38
|
display: block;
|
@@ -1,24 +1,24 @@
|
|
1
|
-
|
1
|
+
.thredded--user-navigation {
|
2
2
|
@extend %thredded--nav-tabs;
|
3
3
|
}
|
4
4
|
|
5
|
-
|
5
|
+
.thredded--user-navigation--item {
|
6
6
|
@extend %thredded--nav-tabs--item;
|
7
7
|
}
|
8
8
|
|
9
|
-
.thredded--preferences
|
10
|
-
.thredded--new-private-topic
|
11
|
-
.thredded--private-topics-index
|
12
|
-
.thredded--private-topic-show
|
13
|
-
.thredded--pending-moderation
|
14
|
-
.thredded--moderation-history
|
15
|
-
.thredded--moderation-users
|
16
|
-
.thredded--moderation-user
|
17
|
-
.thredded--moderation-activity
|
9
|
+
.thredded--preferences .thredded--user-navigation--settings,
|
10
|
+
.thredded--new-private-topic .thredded--user-navigation--private-topics,
|
11
|
+
.thredded--private-topics-index .thredded--user-navigation--private-topics,
|
12
|
+
.thredded--private-topic-show .thredded--user-navigation--private-topics,
|
13
|
+
.thredded--pending-moderation .thredded--user-navigation--moderation,
|
14
|
+
.thredded--moderation-history .thredded--user-navigation--moderation,
|
15
|
+
.thredded--moderation-users .thredded--user-navigation--moderation,
|
16
|
+
.thredded--moderation-user .thredded--user-navigation--moderation,
|
17
|
+
.thredded--moderation-activity .thredded--user-navigation--moderation {
|
18
18
|
@extend %thredded--nav-tabs--item-current;
|
19
19
|
}
|
20
20
|
|
21
|
-
|
22
|
-
|
21
|
+
.thredded--user-navigation--private-topics--unread,
|
22
|
+
.thredded--user-navigation--moderation--pending-count {
|
23
23
|
@extend %thredded--nav-tabs--item--badge;
|
24
24
|
}
|
@@ -12,8 +12,10 @@ module Thredded
|
|
12
12
|
authorize @messageboard_group, :create?
|
13
13
|
|
14
14
|
if @messageboard_group.save
|
15
|
-
redirect_to root_path, notice: I18n.t('thredded.messageboard_group.
|
15
|
+
redirect_to root_path, notice: I18n.t('thredded.messageboard_group.saved', name: @messageboard_group.name)
|
16
16
|
else
|
17
|
+
flash.now[:notice] = @messageboard_group.errors.full_messages.to_sentence
|
18
|
+
|
17
19
|
render action: :new
|
18
20
|
end
|
19
21
|
end
|
@@ -7,9 +7,7 @@ module Thredded
|
|
7
7
|
after_action :verify_policy_scoped, except: %i(new create edit update)
|
8
8
|
|
9
9
|
def index
|
10
|
-
@groups = policy_scope(Messageboard.all)
|
11
|
-
.preload(:group, last_topic: [:last_user]).group_by(&:group)
|
12
|
-
.map { |(group, messageboards)| MessageboardGroupView.new(group, messageboards) }
|
10
|
+
@groups = MessageboardGroupView.grouped(policy_scope(Messageboard.all))
|
13
11
|
end
|
14
12
|
|
15
13
|
def new
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
require_dependency 'thredded/posts_page_view'
|
3
3
|
require_dependency 'thredded/topics_page_view'
|
4
|
+
# rubocop:disable Metrics/ClassLength
|
4
5
|
module Thredded
|
5
6
|
class TopicsController < Thredded::ApplicationController
|
6
7
|
before_action :thredded_require_login!,
|
@@ -16,7 +17,7 @@ module Thredded
|
|
16
17
|
@topics = Thredded::TopicsPageView.new(
|
17
18
|
thredded_current_user,
|
18
19
|
policy_scope(messageboard.topics)
|
19
|
-
.order_sticky_first.
|
20
|
+
.order_sticky_first.order_recently_posted_first
|
20
21
|
.includes(:categories, :last_user, :user)
|
21
22
|
.page(current_page)
|
22
23
|
)
|
@@ -52,7 +53,7 @@ module Thredded
|
|
52
53
|
thredded_current_user,
|
53
54
|
topics_scope
|
54
55
|
.search_query(@query)
|
55
|
-
.
|
56
|
+
.order_recently_posted_first
|
56
57
|
.includes(:categories, :last_user, :user)
|
57
58
|
.page(current_page)
|
58
59
|
)
|
@@ -70,7 +71,7 @@ module Thredded
|
|
70
71
|
thredded_current_user,
|
71
72
|
policy_scope(@category.topics)
|
72
73
|
.unstuck
|
73
|
-
.
|
74
|
+
.order_recently_posted_first
|
74
75
|
.page(current_page)
|
75
76
|
)
|
76
77
|
render :index
|
@@ -110,20 +111,25 @@ module Thredded
|
|
110
111
|
def follow
|
111
112
|
authorize topic, :read?
|
112
113
|
UserTopicFollow.create_unless_exists(thredded_current_user.id, topic.id)
|
113
|
-
|
114
|
-
notice: t('thredded.topics.followed_notice')
|
114
|
+
follow_change_response(following: true)
|
115
115
|
end
|
116
116
|
|
117
117
|
def unfollow
|
118
118
|
authorize topic, :read?
|
119
|
-
|
120
|
-
|
121
|
-
redirect_to messageboard_topic_url(messageboard, topic),
|
122
|
-
notice: t('thredded.topics.unfollowed_notice')
|
119
|
+
UserTopicFollow.find_by(topic_id: topic.id, user_id: thredded_current_user.id).try(:destroy)
|
120
|
+
follow_change_response(following: false)
|
123
121
|
end
|
124
122
|
|
125
123
|
private
|
126
124
|
|
125
|
+
def follow_change_response(following:)
|
126
|
+
notice = following ? t('thredded.topics.followed_notice') : t('thredded.topics.unfollowed_notice')
|
127
|
+
respond_to do |format|
|
128
|
+
format.html { redirect_to messageboard_topic_url(messageboard, topic), notice: notice }
|
129
|
+
format.json { render(json: { follow: following }) }
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
127
133
|
def topic
|
128
134
|
@topic ||= messageboard.topics.find_by_slug!(params[:id])
|
129
135
|
end
|
@@ -150,3 +156,4 @@ module Thredded
|
|
150
156
|
end
|
151
157
|
end
|
152
158
|
end
|
159
|
+
# rubocop:enable Metrics/ClassLength
|