a TON of bugfixes and new features

This commit is contained in:
jomo
2014-04-28 03:01:33 +02:00
parent a6ba503e73
commit 65f5adf65d
59 changed files with 1023 additions and 970 deletions

View File

@@ -3,11 +3,15 @@ class ForumsController < ApplicationController
def index
@groups = Forumgroup.select {|g| g.can_read?(current_user) }
@groups.sort_by!{|g| g[:position]}
@groups.sort_by!{ |g| g.position || 0 }
end
def show
@threads = @forum.forumthreads.order("sticky desc, updated_at desc")
@threads = @forum.forumthreads.to_a
@threads.sort_by! do |t|
# sticky goes first, then sort by last activity (new replies)
[t.sticky ? 0 : 1, -(t.replies.last.try(:created_at) || t.created_at).to_i]
end
end
def edit