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
@@ -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 %>
|