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.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +12 -4
  3. data/.rubocop_todo.yml +170 -0
  4. data/.travis.yml +3 -3
  5. data/CHANGELOG.md +9 -0
  6. data/Gemfile +1 -0
  7. data/Guardfile +16 -39
  8. data/README.md +27 -10
  9. data/Rakefile +1 -0
  10. data/app/assets/config/thredded_workgroup_manifest.js +3 -0
  11. data/app/assets/images/thredded/workgroup/envelope-o.svg +2 -0
  12. data/app/assets/images/thredded/workgroup/envelope-open-o.svg +2 -0
  13. data/app/assets/javascripts/thredded-workgroup.js +1 -13
  14. data/app/assets/javascripts/thredded/workgroup/components/followers.es6 +24 -0
  15. data/app/assets/javascripts/thredded/workgroup/components/overflow.es6 +60 -0
  16. data/app/assets/javascripts/thredded/workgroup/components/topics.es6 +151 -0
  17. data/app/assets/javascripts/thredded/workgroup/core/thredded_workgroup.js +1 -0
  18. data/app/assets/javascripts/thredded/workgroup/core/touch.es6 +16 -0
  19. data/app/assets/javascripts/thredded/workgroup/index.js +3 -0
  20. data/app/assets/stylesheets/thredded-workgroup.scss +2 -0
  21. data/app/assets/stylesheets/thredded/workgroup/_followers.scss +51 -0
  22. data/app/assets/stylesheets/thredded/workgroup/_navs.scss +29 -7
  23. data/app/assets/stylesheets/thredded/workgroup/_overflow.scss +71 -0
  24. data/app/assets/stylesheets/thredded/workgroup/_topics.scss +186 -16
  25. data/app/controllers/concerns/thredded/workgroup/all_unread_followed_topics.rb +31 -0
  26. data/app/controllers/thredded/application_controller.rb +23 -0
  27. data/app/controllers/thredded/posts_controller.rb +1 -0
  28. data/app/controllers/thredded/workgroup/application_controller.rb +1 -0
  29. data/app/controllers/thredded/workgroup/navs_controller.rb +1 -0
  30. data/app/controllers/thredded/workgroup/read_states_controller.rb +14 -0
  31. data/app/controllers/thredded/workgroup/topics_controller.rb +18 -0
  32. data/app/helpers/thredded/application_helper.rb +1 -0
  33. data/app/helpers/thredded/workgroup/application_helper.rb +1 -0
  34. data/app/jobs/thredded/workgroup/mark_all_topics_read_job.rb +13 -0
  35. data/app/view_hooks/thredded/all_view_hooks.rb +9 -0
  36. data/app/view_hooks/thredded/workgroup/view_hooks.rb +28 -0
  37. data/app/view_models/thredded/topic_view.rb +17 -0
  38. data/app/view_models/thredded/topics_page_view.rb +1 -0
  39. data/app/views/thredded/shared/nav/_unread_topics.html.erb +1 -0
  40. data/app/views/thredded/topics/_followers.html.erb +23 -0
  41. data/app/views/thredded/topics/_topic.html.erb +25 -28
  42. data/app/views/thredded/workgroup/navs/_personal_nav.html.erb +7 -1
  43. data/app/views/thredded/workgroup/navs/all_topics.html.erb +1 -1
  44. data/app/views/thredded/workgroup/navs/awaiting.html.erb +1 -1
  45. data/app/views/thredded/workgroup/navs/following.html.erb +1 -1
  46. data/app/views/thredded/workgroup/navs/unread.html.erb +1 -1
  47. data/app/views/thredded/workgroup/topics/_controls.html.erb +21 -0
  48. data/app/views/thredded/workgroup/topics/_last_post.html.erb +11 -0
  49. data/app/views/thredded/workgroup/topics/_last_post_with_controls.html.erb +12 -0
  50. data/app/views/thredded/workgroup/topics/_topics_with_last_post.html.erb +16 -0
  51. data/bin/rails.rb +1 -0
  52. data/bin/rspec +1 -0
  53. data/bin/update_from_thredded +1 -0
  54. data/config/locales/en.yml +11 -0
  55. data/config/routes.rb +9 -0
  56. data/docs/followers-above-post.png +0 -0
  57. data/docs/navbar.png +0 -0
  58. data/lib/thredded/workgroup.rb +1 -0
  59. data/lib/thredded/workgroup/engine.rb +11 -2
  60. data/lib/thredded/workgroup/thredded_route_delegator.rb +1 -0
  61. data/lib/thredded/workgroup/version.rb +2 -1
  62. data/shared.gemfile +4 -0
  63. data/thredded-workgroup.gemspec +6 -10
  64. metadata +62 -60
  65. data/app/assets/javascripts/thredded/workgroup/follow.js +0 -36
  66. data/app/assets/javascripts/thredded/workgroup/topics.js +0 -18
  67. data/app/views/thredded/topics/_topics_with_last_post.html.erb +0 -14
@@ -1,36 +0,0 @@
1
- (function($) {
2
- $(document).ready(function () {
3
- function updateFollowStatus($svg, $topic, followStatus) {
4
- var $newSvg = $svg.clone();
5
- if (followStatus) {
6
- $topic.removeClass('thredded--topic-notfollowing').addClass('thredded--topic-following')
7
- $newSvg.find('use').attr('xlink:href', '#thredded-follow-icon');
8
-
9
- } else {
10
- $topic.removeClass('thredded--topic-following').addClass('thredded--topic-notfollowing')
11
- $newSvg.find('use').attr('xlink:href', '#thredded-unfollow-icon');
12
- }
13
- $newSvg.click(clickFollowIcon);
14
- $svg.replaceWith($newSvg);
15
- $newSvg.show();
16
- };
17
- function clickFollowIcon() {
18
- var $icon = $(this);
19
- var $topic = $icon.parents('.thredded--topics--topic');
20
- var following = $topic.hasClass('thredded--topic-following');
21
- var topicId = $topic.data("topic");
22
- var messageboardId = $topic.data("messageboard");
23
- var rootPath = $('#thredded--container').data('thredded-root-url');
24
-
25
- var path = "" + rootPath + messageboardId + "/" + topicId + "/" + (following ? 'unfollow.json' : 'follow.json');
26
- $icon.show();
27
- $.ajax({
28
- url: path, type: "POST", success: function (data) {
29
- updateFollowStatus($icon, $topic, data["follow"])
30
- }
31
- });
32
- }
33
-
34
- $('.thredded--topics--follow-icon').click(clickFollowIcon);
35
- });
36
- })(jQuery);
@@ -1,18 +0,0 @@
1
- (function($){
2
- $(function () {
3
- $('.thredded--topics--topic .thredded--topic-title, .thredded--topics--topic .thredded--topic-followers,' +
4
- '.thredded--topics--topic .thredded--topics--posts-count').hover(
5
- function(){$(this).closest('.thredded--topics--topic').addClass("thredded--rollover")},
6
- function(){$(this).closest('.thredded--topics--topic').removeClass("thredded--rollover")}
7
- ).click(function() {
8
- var $a = $(this).closest('.thredded--topics--topic').find(".thredded--topic-title a");
9
- window.location.href = $a.attr('href');
10
- });
11
-
12
- $('.thredded--topic-post-and-last-user').hover(
13
- function(){ $(this).addClass('thredded--hovering')},
14
- function(){ $(this).removeClass('thredded--hovering')}
15
- ).click(function(){$(this).toggleClass('thredded--condensed')});
16
- });
17
- })(jQuery);
18
-
@@ -1,14 +0,0 @@
1
- <div class="thredded--svg-definitions">
2
- <%= inline_svg 'thredded/follow.svg', id:"thredded-follow-icon" %>
3
- <%= inline_svg 'thredded/unfollow.svg', id:"thredded-unfollow-icon" %>
4
- </div>
5
-
6
- <%= thredded_page do %>
7
- <%= content_tag :section, class: 'thredded--main-section thredded--topics', 'data-thredded-topics' => true do %>
8
- <%= render @topics %>
9
- <% end %>
10
-
11
- <footer>
12
- <%= paginate @topics %>
13
- </footer>
14
- <% end %>