thredded-workgroup 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +12 -4
- data/.rubocop_todo.yml +170 -0
- data/.travis.yml +3 -3
- data/CHANGELOG.md +9 -0
- data/Gemfile +1 -0
- data/Guardfile +16 -39
- data/README.md +27 -10
- data/Rakefile +1 -0
- data/app/assets/config/thredded_workgroup_manifest.js +3 -0
- data/app/assets/images/thredded/workgroup/envelope-o.svg +2 -0
- data/app/assets/images/thredded/workgroup/envelope-open-o.svg +2 -0
- data/app/assets/javascripts/thredded-workgroup.js +1 -13
- data/app/assets/javascripts/thredded/workgroup/components/followers.es6 +24 -0
- data/app/assets/javascripts/thredded/workgroup/components/overflow.es6 +60 -0
- data/app/assets/javascripts/thredded/workgroup/components/topics.es6 +151 -0
- data/app/assets/javascripts/thredded/workgroup/core/thredded_workgroup.js +1 -0
- data/app/assets/javascripts/thredded/workgroup/core/touch.es6 +16 -0
- data/app/assets/javascripts/thredded/workgroup/index.js +3 -0
- data/app/assets/stylesheets/thredded-workgroup.scss +2 -0
- data/app/assets/stylesheets/thredded/workgroup/_followers.scss +51 -0
- data/app/assets/stylesheets/thredded/workgroup/_navs.scss +29 -7
- data/app/assets/stylesheets/thredded/workgroup/_overflow.scss +71 -0
- data/app/assets/stylesheets/thredded/workgroup/_topics.scss +186 -16
- data/app/controllers/concerns/thredded/workgroup/all_unread_followed_topics.rb +31 -0
- data/app/controllers/thredded/application_controller.rb +23 -0
- data/app/controllers/thredded/posts_controller.rb +1 -0
- data/app/controllers/thredded/workgroup/application_controller.rb +1 -0
- data/app/controllers/thredded/workgroup/navs_controller.rb +1 -0
- data/app/controllers/thredded/workgroup/read_states_controller.rb +14 -0
- data/app/controllers/thredded/workgroup/topics_controller.rb +18 -0
- data/app/helpers/thredded/application_helper.rb +1 -0
- data/app/helpers/thredded/workgroup/application_helper.rb +1 -0
- data/app/jobs/thredded/workgroup/mark_all_topics_read_job.rb +13 -0
- data/app/view_hooks/thredded/all_view_hooks.rb +9 -0
- data/app/view_hooks/thredded/workgroup/view_hooks.rb +28 -0
- data/app/view_models/thredded/topic_view.rb +17 -0
- data/app/view_models/thredded/topics_page_view.rb +1 -0
- data/app/views/thredded/shared/nav/_unread_topics.html.erb +1 -0
- data/app/views/thredded/topics/_followers.html.erb +23 -0
- data/app/views/thredded/topics/_topic.html.erb +25 -28
- data/app/views/thredded/workgroup/navs/_personal_nav.html.erb +7 -1
- data/app/views/thredded/workgroup/navs/all_topics.html.erb +1 -1
- data/app/views/thredded/workgroup/navs/awaiting.html.erb +1 -1
- data/app/views/thredded/workgroup/navs/following.html.erb +1 -1
- data/app/views/thredded/workgroup/navs/unread.html.erb +1 -1
- data/app/views/thredded/workgroup/topics/_controls.html.erb +21 -0
- data/app/views/thredded/workgroup/topics/_last_post.html.erb +11 -0
- data/app/views/thredded/workgroup/topics/_last_post_with_controls.html.erb +12 -0
- data/app/views/thredded/workgroup/topics/_topics_with_last_post.html.erb +16 -0
- data/bin/rails.rb +1 -0
- data/bin/rspec +1 -0
- data/bin/update_from_thredded +1 -0
- data/config/locales/en.yml +11 -0
- data/config/routes.rb +9 -0
- data/docs/followers-above-post.png +0 -0
- data/docs/navbar.png +0 -0
- data/lib/thredded/workgroup.rb +1 -0
- data/lib/thredded/workgroup/engine.rb +11 -2
- data/lib/thredded/workgroup/thredded_route_delegator.rb +1 -0
- data/lib/thredded/workgroup/version.rb +2 -1
- data/shared.gemfile +4 -0
- data/thredded-workgroup.gemspec +6 -10
- metadata +62 -60
- data/app/assets/javascripts/thredded/workgroup/follow.js +0 -36
- data/app/assets/javascripts/thredded/workgroup/topics.js +0 -18
- data/app/views/thredded/topics/_topics_with_last_post.html.erb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a0ab82d41aae76941edf568459bf45471392759127d829d60888928533a4172
|
4
|
+
data.tar.gz: 403e83fd21a8474449b76603a2e5b440a31d9343342e49d5c1d6b73c4e453203
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22785389999e14d50d95690d6ee294eb42d3c4aed6a7b5178ac7c6bbd8b6dda2647cb1b2639ac53f6eef4ea087f6650288a9b7d1bb27f5955fa553e4f43ae067
|
7
|
+
data.tar.gz: d14a0f0b1462ee26104ec6159bfbea68de2495004754e99176b2cc8b9376a653d6dfaa04a037bf283771f64e79fd706dc0c57559a847768d6d5077f467d9517a
|
data/.rubocop.yml
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
inherit_from:
|
2
|
+
- .rubocop_todo.yml
|
1
3
|
AllCops:
|
2
4
|
TargetRubyVersion: 2.3
|
3
5
|
Exclude:
|
@@ -10,6 +12,9 @@ Metrics/AbcSize:
|
|
10
12
|
Metrics/ClassLength:
|
11
13
|
Max: 125
|
12
14
|
|
15
|
+
Metrics/BlockLength:
|
16
|
+
Exclude:
|
17
|
+
- 'spec/factories/*'
|
13
18
|
Metrics/LineLength:
|
14
19
|
Max: 120
|
15
20
|
|
@@ -29,10 +34,10 @@ Style/CollectionMethods:
|
|
29
34
|
Style/Documentation:
|
30
35
|
Enabled: false
|
31
36
|
|
32
|
-
|
37
|
+
Layout/MultilineMethodCallIndentation:
|
33
38
|
EnforcedStyle: indented
|
34
39
|
|
35
|
-
|
40
|
+
Naming/PredicateName:
|
36
41
|
Exclude:
|
37
42
|
- spec/**/*.rb
|
38
43
|
|
@@ -42,7 +47,10 @@ Style/SignalException:
|
|
42
47
|
Style/StringLiterals:
|
43
48
|
EnforcedStyle: double_quotes
|
44
49
|
|
45
|
-
Style/
|
50
|
+
Style/TrailingCommaInArrayLiteral:
|
51
|
+
Enabled: false
|
52
|
+
|
53
|
+
Style/TrailingCommaInHashLiteral:
|
46
54
|
Enabled: false
|
47
55
|
|
48
56
|
Style/TrailingCommaInArguments:
|
@@ -61,5 +69,5 @@ Rails/FindBy:
|
|
61
69
|
- app/models/**/*.rb
|
62
70
|
- app/view_models/**/*.rb
|
63
71
|
|
64
|
-
|
72
|
+
Layout/EndAlignment:
|
65
73
|
AutoCorrect: true
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,170 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2018-10-11 18:46:51 +0100 using RuboCop version 0.59.2.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 2
|
10
|
+
# Cop supports --auto-correct.
|
11
|
+
# Configuration parameters: Include, TreatCommentsAsGroupSeparators.
|
12
|
+
# Include: **/*.gemfile, **/Gemfile, **/gems.rb
|
13
|
+
Bundler/OrderedGems:
|
14
|
+
Exclude:
|
15
|
+
- 'shared.gemfile'
|
16
|
+
|
17
|
+
# Offense count: 5
|
18
|
+
# Cop supports --auto-correct.
|
19
|
+
# Configuration parameters: Include, TreatCommentsAsGroupSeparators.
|
20
|
+
# Include: **/*.gemspec
|
21
|
+
Gemspec/OrderedDependencies:
|
22
|
+
Exclude:
|
23
|
+
- 'thredded-workgroup.gemspec'
|
24
|
+
|
25
|
+
# Offense count: 3
|
26
|
+
# Cop supports --auto-correct.
|
27
|
+
Layout/EmptyLineAfterGuardClause:
|
28
|
+
Exclude:
|
29
|
+
- 'spec/dummy/app/controllers/application_controller.rb'
|
30
|
+
- 'spec/dummy/app/controllers/concerns/store_location_fullpath.rb'
|
31
|
+
- 'spec/support/features/fake_content.rb'
|
32
|
+
|
33
|
+
# Offense count: 1
|
34
|
+
# Cop supports --auto-correct.
|
35
|
+
Layout/LeadingCommentSpace:
|
36
|
+
Exclude:
|
37
|
+
- 'shared.gemfile'
|
38
|
+
|
39
|
+
# Offense count: 1
|
40
|
+
# Configuration parameters: MaximumRangeSize.
|
41
|
+
Lint/MissingCopEnableDirective:
|
42
|
+
Exclude:
|
43
|
+
- 'thredded-workgroup.gemspec'
|
44
|
+
|
45
|
+
# Offense count: 1
|
46
|
+
# Cop supports --auto-correct.
|
47
|
+
Lint/UnneededCopDisableDirective:
|
48
|
+
Exclude:
|
49
|
+
- 'thredded-workgroup.gemspec'
|
50
|
+
|
51
|
+
# Offense count: 11
|
52
|
+
# Configuration parameters: CountComments, ExcludedMethods.
|
53
|
+
# ExcludedMethods: refine
|
54
|
+
Metrics/BlockLength:
|
55
|
+
Max: 169
|
56
|
+
|
57
|
+
# Offense count: 1
|
58
|
+
# Cop supports --auto-correct.
|
59
|
+
Rails/ApplicationRecord:
|
60
|
+
Exclude:
|
61
|
+
- 'spec/dummy/app/models/user.rb'
|
62
|
+
|
63
|
+
# Offense count: 1
|
64
|
+
# Configuration parameters: EnforcedStyle.
|
65
|
+
# SupportedStyles: slashes, arguments
|
66
|
+
Rails/FilePath:
|
67
|
+
Exclude:
|
68
|
+
- 'spec/spec_helper.rb'
|
69
|
+
|
70
|
+
# Offense count: 1
|
71
|
+
# Configuration parameters: Include.
|
72
|
+
# Include: app/controllers/**/*.rb
|
73
|
+
Rails/LexicallyScopedActionFilter:
|
74
|
+
Exclude:
|
75
|
+
- 'app/controllers/thredded/workgroup/navs_controller.rb'
|
76
|
+
|
77
|
+
# Offense count: 1
|
78
|
+
# Cop supports --auto-correct.
|
79
|
+
# Configuration parameters: EnforcedStyle.
|
80
|
+
# SupportedStyles: compact, expanded
|
81
|
+
Style/EmptyMethod:
|
82
|
+
Exclude:
|
83
|
+
- 'spec/support/authentication_support.rb'
|
84
|
+
|
85
|
+
# Offense count: 1
|
86
|
+
# Cop supports --auto-correct.
|
87
|
+
Style/Encoding:
|
88
|
+
Exclude:
|
89
|
+
- 'thredded-workgroup.gemspec'
|
90
|
+
|
91
|
+
# Offense count: 10
|
92
|
+
# Cop supports --auto-correct.
|
93
|
+
Style/ExpandPathArguments:
|
94
|
+
Exclude:
|
95
|
+
- 'Rakefile'
|
96
|
+
- 'bin/rails.rb'
|
97
|
+
- 'spec/gemfiles/rails_5_0.gemfile'
|
98
|
+
- 'spec/gemfiles/rails_5_1.gemfile'
|
99
|
+
- 'spec/gemfiles/rails_5_2.gemfile'
|
100
|
+
- 'spec/spec_helper.rb'
|
101
|
+
- 'thredded-workgroup.gemspec'
|
102
|
+
|
103
|
+
# Offense count: 5
|
104
|
+
# Cop supports --auto-correct.
|
105
|
+
# Configuration parameters: EnforcedStyle.
|
106
|
+
# SupportedStyles: when_needed, always, never
|
107
|
+
Style/FrozenStringLiteralComment:
|
108
|
+
Exclude:
|
109
|
+
- 'shared.gemfile'
|
110
|
+
- 'spec/gemfiles/rails_5_0.gemfile'
|
111
|
+
- 'spec/gemfiles/rails_5_1.gemfile'
|
112
|
+
- 'spec/gemfiles/rails_5_2.gemfile'
|
113
|
+
|
114
|
+
# Offense count: 2
|
115
|
+
# Cop supports --auto-correct.
|
116
|
+
Style/IfUnlessModifier:
|
117
|
+
Exclude:
|
118
|
+
- 'spec/features/user_clicks_to_follow_unfollow_topic_spec.rb'
|
119
|
+
- 'spec/spec_helper.rb'
|
120
|
+
|
121
|
+
# Offense count: 14
|
122
|
+
# Cop supports --auto-correct.
|
123
|
+
# Configuration parameters: PreferredDelimiters.
|
124
|
+
Style/PercentLiteralDelimiters:
|
125
|
+
Exclude:
|
126
|
+
- 'Guardfile'
|
127
|
+
- 'Rakefile'
|
128
|
+
- 'lib/thredded/workgroup/engine.rb'
|
129
|
+
- 'spec/dummy/config/application.rb'
|
130
|
+
- 'spec/dummy/config/initializers/assets.rb'
|
131
|
+
- 'spec/dummy/config/routes.rb'
|
132
|
+
- 'spec/dummy/lib/themes.rb'
|
133
|
+
- 'spec/factories/thredded.rb'
|
134
|
+
- 'spec/support/features/fake_content.rb'
|
135
|
+
|
136
|
+
# Offense count: 2
|
137
|
+
# Cop supports --auto-correct.
|
138
|
+
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, Whitelist.
|
139
|
+
# Whitelist: present?, blank?, presence, try, try!
|
140
|
+
Style/SafeNavigation:
|
141
|
+
Exclude:
|
142
|
+
- 'Rakefile'
|
143
|
+
- 'spec/features/user_adds_post_and_is_redirected_spec.rb'
|
144
|
+
|
145
|
+
# Offense count: 3
|
146
|
+
# Cop supports --auto-correct.
|
147
|
+
Style/StderrPuts:
|
148
|
+
Exclude:
|
149
|
+
- 'Rakefile'
|
150
|
+
|
151
|
+
# Offense count: 50
|
152
|
+
# Cop supports --auto-correct.
|
153
|
+
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
|
154
|
+
# SupportedStyles: single_quotes, double_quotes
|
155
|
+
Style/StringLiterals:
|
156
|
+
Exclude:
|
157
|
+
- 'shared.gemfile'
|
158
|
+
- 'spec/gemfiles/rails_5_0.gemfile'
|
159
|
+
- 'spec/gemfiles/rails_5_1.gemfile'
|
160
|
+
- 'spec/gemfiles/rails_5_2.gemfile'
|
161
|
+
- 'thredded-workgroup.gemspec'
|
162
|
+
|
163
|
+
# Offense count: 3
|
164
|
+
# Cop supports --auto-correct.
|
165
|
+
# Configuration parameters: EnforcedStyle, MinSize.
|
166
|
+
# SupportedStyles: percent, brackets
|
167
|
+
Style/SymbolArray:
|
168
|
+
Exclude:
|
169
|
+
- 'Rakefile'
|
170
|
+
- 'spec/spec_helper.rb'
|
data/.travis.yml
CHANGED
@@ -12,12 +12,10 @@ addons:
|
|
12
12
|
|
13
13
|
language: ruby
|
14
14
|
rvm:
|
15
|
-
- 2.
|
16
|
-
# - 2.4 # not till rails 4.2.8 is released
|
15
|
+
- 2.5
|
17
16
|
cache: bundler
|
18
17
|
bundler_args: --path ../../vendor/bundle --without debug
|
19
18
|
gemfile:
|
20
|
-
- spec/gemfiles/rails_4_2.gemfile
|
21
19
|
- spec/gemfiles/rails_5_0.gemfile
|
22
20
|
- spec/gemfiles/rails_5_1.gemfile
|
23
21
|
- spec/gemfiles/rails_5_2.gemfile
|
@@ -43,3 +41,5 @@ script:
|
|
43
41
|
- xvfb-run bundle exec rspec
|
44
42
|
- bundle show rubocop
|
45
43
|
- bundle exec rubocop
|
44
|
+
- cp $BUNDLE_GEMFILE Gemfile.lock
|
45
|
+
- bundle exec bundle-audit check --update -v
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Guardfile
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
# More info at https://github.com/guard/guard#readme
|
3
4
|
|
4
5
|
## Uncomment and set this to only include directories you want to watch
|
@@ -15,44 +16,7 @@
|
|
15
16
|
#
|
16
17
|
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
|
17
18
|
|
18
|
-
|
19
|
-
extensions = {
|
20
|
-
css: :css,
|
21
|
-
scss: :css,
|
22
|
-
sass: :css,
|
23
|
-
js: :js,
|
24
|
-
coffee: :js,
|
25
|
-
html: :html,
|
26
|
-
png: :png,
|
27
|
-
gif: :gif,
|
28
|
-
jpg: :jpg,
|
29
|
-
jpeg: :jpeg,
|
30
|
-
# less: :less, # uncomment if you want LESS stylesheets done in browser
|
31
|
-
}
|
32
|
-
|
33
|
-
rails_view_exts = %w(erb haml slim)
|
34
|
-
|
35
|
-
# file types LiveReload may optimize refresh for
|
36
|
-
compiled_exts = extensions.values.uniq
|
37
|
-
watch(%r{public/.+\.(#{compiled_exts * '|'})})
|
38
|
-
|
39
|
-
extensions.each do |ext, type|
|
40
|
-
watch(%r{
|
41
|
-
(?:app|vendor)
|
42
|
-
(?:/assets/\w+/(?<path>[^.]+) # path+base without extension
|
43
|
-
(?<ext>\.#{ext})) # matching extension (must be first encountered)
|
44
|
-
(?:\.\w+|$) # other extensions
|
45
|
-
}x) do |m|
|
46
|
-
path = m[1]
|
47
|
-
"/assets/#{path}.#{type}"
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
# file needing a full reload of the page anyway
|
52
|
-
watch(%r{app/views/.+\.(#{rails_view_exts * '|'})$})
|
53
|
-
watch(%r{app/helpers/.+\.rb})
|
54
|
-
watch(%r{config/locales/.+\.yml})
|
55
|
-
end
|
19
|
+
interactor :off unless ENV["GUARD_USE_INTERACTOR"]
|
56
20
|
|
57
21
|
# Guard-Rails supports a lot options with default values:
|
58
22
|
# daemon: false # runs the server as a daemon.
|
@@ -71,7 +35,20 @@ end
|
|
71
35
|
# zeus: false # enables zeus gem.
|
72
36
|
# CLI: 'rails server' # customizes runner command. Omits all options except `pid_file`!
|
73
37
|
|
74
|
-
|
38
|
+
host = ENV["UNSAFE_DEV"] ? "0.0.0.0" : "localhost"
|
39
|
+
port = ENV["RAILS_S_PORT"]&.to_i || 3012
|
40
|
+
guard "rails", host: host, port: port, root: "spec/dummy" do
|
75
41
|
watch("Gemfile.lock")
|
76
42
|
watch(%r{^(config|lib)/.*})
|
77
43
|
end
|
44
|
+
|
45
|
+
guard "livereload", port: ENV["LIVERELOAD_PORT"]&.to_i || 35_734 do
|
46
|
+
watch(%r{app/views/.+\.(erb|haml|slim)$})
|
47
|
+
watch(%r{app/helpers/.+\.rb})
|
48
|
+
watch(%r{public/.+\.(css|js|html)})
|
49
|
+
watch(%r{config/locales/.+\.yml})
|
50
|
+
# Rails Assets Pipeline
|
51
|
+
watch(%r{(app|vendor)/assets/\w+/(.+\.(js|html)).*}) { |m| "/assets/#{m[2]}" }
|
52
|
+
watch(%r{(app|vendor)/assets/\w+/(.+)\.scss.*}) { |m| "/assets/#{m[2]}.css" }
|
53
|
+
watch(%r{spec/javascripts/(.+\.js)}) { |m| "/assets/#{m[1]}" }
|
54
|
+
end
|
data/README.md
CHANGED
@@ -1,22 +1,25 @@
|
|
1
1
|
# Thredded::Workgroup
|
2
2
|
|
3
|
-
Extension to [Thredded](http://github.com/thredded/thredded) with features useful to workgroup messaging
|
4
|
-
|
5
|
-
|
3
|
+
Extension to [Thredded](http://github.com/thredded/thredded) with features useful to workgroup messaging.
|
4
|
+
|
5
|
+
The point of Thredded-workgroup is to enable migration of workgroup communication from non-shared email to shared opt-in communications -- everyone can see any of the workgroup communications.
|
6
|
+
|
6
7
|
originated in https://github.com/thredded/thredded/issues/347
|
7
8
|
|
8
9
|
Out the box enables a homepage with a top-level nav menu consisting of:
|
9
10
|
|
10
11
|
* Unread: a list of unread topics (ordered by last post) across all messageboards
|
11
|
-
* Following: a list of followed topics (ordered by last post) across all messageboards
|
12
12
|
* Awaiting reply: a list of all topics you follow where yours is the last post
|
13
|
-
*
|
14
|
-
* All
|
15
|
-
|
16
|
-
It adds a navbar like this:
|
13
|
+
* Following: a list of followed topics (ordered by last post) across all messageboards
|
14
|
+
* All: a list of all topics (ordered by last post) across all messageboards
|
15
|
+
* Messageboards: a list of messageboards (as Thredded's normal home page)
|
17
16
|
|
18
|
-
|
17
|
+
![Screenshot of navbar](docs/navbar.png)
|
19
18
|
|
19
|
+
It also shows you the followers of the current topic before you post, and allows you to remove unneeded followers. (The logic for this is that (unlike a social forum) you need to broadcast as little as possible (because the aim is to reduce unnecessary noise, because people can find messages they need to). When you are adding to a topic it may become less relevant to existing followers. The person adding the message is able to adjust followers,
|
20
|
+
like you might adjust the cc-list of conversation).
|
21
|
+
|
22
|
+
![Screenshot of post form](docs/followers-above-post.png)
|
20
23
|
|
21
24
|
## Installation
|
22
25
|
|
@@ -73,6 +76,19 @@ Include thredded JavaScripts in your `application.js`:
|
|
73
76
|
//= require thredded-workgroup
|
74
77
|
```
|
75
78
|
|
79
|
+
### Configuration
|
80
|
+
|
81
|
+
**Reveal on hover?** The last topic shown in the thredded workflow top level pages is by default condensed when too long and revealed by click. You can also have it reveal on hover. This requires adding a data attribute in the layout (e.g. the body, or another high container element), as <div data-thredded-condensable-hover="reveal">. You can preview this behaviour in the demo, by adding `?hover=reveal` to the url.
|
82
|
+
|
83
|
+
### View hooks
|
84
|
+
|
85
|
+
Thredded::Workgroup augments Thredded with some extra view hooks (see https://github.com/thredded/thredded/#view-hooks) for customization.
|
86
|
+
|
87
|
+
To see the extra view hooks provided by Thredded::Workgroup (with their arguments), run:
|
88
|
+
|
89
|
+
```bash
|
90
|
+
grep view_hooks -R --include '*.html.erb' "$(bundle show thredded-workgroup)"
|
91
|
+
```
|
76
92
|
## Master vs Released versions
|
77
93
|
|
78
94
|
NB: if you are using the master version rather than a release version
|
@@ -104,8 +120,9 @@ bundle exec rake db:create db:migrate db:seed
|
|
104
120
|
Run the server
|
105
121
|
|
106
122
|
```
|
107
|
-
|
123
|
+
guard
|
108
124
|
```
|
125
|
+
(you can alternatively run `dummy-rails s -p 3012` but guard runs livereload for you too, which makes development much more pleasant)
|
109
126
|
|
110
127
|
### Updating when thredded changes
|
111
128
|
|
data/Rakefile
CHANGED
@@ -0,0 +1,2 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1664 1504v-768q-32 36-69 66-268 206-426 338-51 43-83 67t-86.5 48.5-102.5 24.5h-2q-48 0-102.5-24.5t-86.5-48.5-83-67q-158-132-426-338-37-30-69-66v768q0 13 9.5 22.5t22.5 9.5h1472q13 0 22.5-9.5t9.5-22.5zm0-1051v-24.5l-.5-13-3-12.5-5.5-9-9-7.5-14-2.5h-1472q-13 0-22.5 9.5t-9.5 22.5q0 168 147 284 193 152 401 317 6 5 35 29.5t46 37.5 44.5 31.5 50.5 27.5 43 9h2q20 0 43-9t50.5-27.5 44.5-31.5 46-37.5 35-29.5q208-165 401-317 54-43 100.5-115.5t46.5-131.5zm128-37v1088q0 66-47 113t-113 47h-1472q-66 0-113-47t-47-113v-1088q0-66 47-113t113-47h1472q66 0 113 47t47 113z"/></svg>
|
@@ -0,0 +1,2 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1474 913l39 51q8 11 6.5 23.5t-11.5 20.5q-43 34-126.5 98.5t-146.5 113-67 51.5q-39 32-60 48t-60.5 41-76.5 36.5-74 11.5h-2q-37 0-74-11.5t-76-36.5-61-41.5-60-47.5q-5-4-65-50.5t-143.5-111-122.5-94.5q-11-8-12.5-20.5t6.5-23.5l37-52q8-11 21.5-13t24.5 7q94 73 306 236 5 4 43.5 35t60.5 46.5 56.5 32.5 58.5 17h2q24 0 58.5-17t56.5-32.5 60.5-46.5 43.5-35q258-198 313-242 11-8 24-6.5t21 12.5zm190 719v-928q-90-83-159-139-91-74-389-304-3-2-43-35t-61-48-56-32.5-59-17.5h-2q-24 0-59 17.5t-56 32.5-61 48-43 35q-215 166-315.5 245.5t-129.5 104-82 74.5q-14 12-21 19v928q0 13 9.5 22.5t22.5 9.5h1472q13 0 22.5-9.5t9.5-22.5zm128-928v928q0 66-47 113t-113 47h-1472q-66 0-113-47t-47-113v-928q0-56 41-94 123-114 350-290.5t233-181.5q36-30 59-47.5t61.5-42 76-36.5 74.5-12h2q37 0 74.5 12t76 36.5 61.5 42 59 47.5q43 36 156 122t226 177 201 173q41 38 41 94z"/></svg>
|
@@ -1,13 +1 @@
|
|
1
|
-
|
2
|
-
// listed below.
|
3
|
-
//
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
-
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
-
//
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// compiled file.
|
9
|
-
//
|
10
|
-
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
-
// about supported directives.
|
12
|
-
//
|
13
|
-
//= require_tree ./thredded/workgroup
|
1
|
+
//= require thredded/workgroup
|
@@ -0,0 +1,24 @@
|
|
1
|
+
(($) => {
|
2
|
+
function removeFollower($followerSelector) {
|
3
|
+
$followerSelector.remove();
|
4
|
+
}
|
5
|
+
|
6
|
+
function clickRemoveFollower(e) {
|
7
|
+
e.preventDefault();
|
8
|
+
e.stopPropagation();
|
9
|
+
var $this = $(this);
|
10
|
+
var $followerSelector = $this.closest('.thredded--follower');
|
11
|
+
var path = $this.data('kickPath');
|
12
|
+
$.ajax({
|
13
|
+
url: path, type: "POST", success: function (data) {
|
14
|
+
removeFollower($followerSelector);
|
15
|
+
}
|
16
|
+
});
|
17
|
+
}
|
18
|
+
|
19
|
+
const Thredded = window.Thredded;
|
20
|
+
|
21
|
+
Thredded.onPageLoad(() => {
|
22
|
+
$('.thredded--follower--remove').click(clickRemoveFollower);
|
23
|
+
});
|
24
|
+
})(jQuery);
|