diff --git a/Gemfile.lock b/Gemfile.lock index c4d78bd..87e7aea 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -270,7 +270,7 @@ GEM websocket-driver (0.5.4) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.2) - will_paginate (3.0.5) + will_paginate (3.0.12) xpath (2.0.0) nokogiri (~> 1.3) diff --git a/app/assets/javascripts/local.js b/app/assets/javascripts/local.js index d21797c..6fbf463 100644 --- a/app/assets/javascripts/local.js +++ b/app/assets/javascripts/local.js @@ -32,6 +32,12 @@ $(function() { $(this).scrollTop(scrollTop-Math.round(delta)); }); + + // Forums fast reply + $("a#fastReply").live('click', function() { + $('#reply').fadeIn('slow') + }); + // Gather stuff $("a#gather-info-hide").live('click', function() { diff --git a/app/controllers/teamers_controller.rb b/app/controllers/teamers_controller.rb index 28302fe..e4477e6 100644 --- a/app/controllers/teamers_controller.rb +++ b/app/controllers/teamers_controller.rb @@ -1,4 +1,7 @@ class TeamersController < ApplicationController + def index + end + def create @teamer = Teamer.new params[:teamer] raise AccessError unless @teamer.can_create? cuser, params[:teamer] diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9b9d542..b62a0e1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -171,7 +171,6 @@ module ApplicationHelper end end - def upcoming_matches GoogleCalendar.new(ENV['GOOGLE_CALENDAR_ID'], timezone_offset). upcoming.sort_by do |event| diff --git a/app/models/forum.rb b/app/models/forum.rb index dff7494..785dec8 100644 --- a/app/models/forum.rb +++ b/app/models/forum.rb @@ -75,7 +75,7 @@ class Forum < ActiveRecord::Base is_admin = Grouper.where(user_id: cuser, group_id: Group::ADMINS) Forum.where("EXISTS (#{is_admin.to_sql}) OR id IN (SELECT q.id from (#{user_has_access.to_sql}) q ) OR - id IN (SELECT q.id from (#{Forum.public.to_sql}) q )") + id IN (SELECT q.id from (#{Forum.public_forums.to_sql}) q )") end end diff --git a/app/models/post.rb b/app/models/post.rb index c8c9d22..c526131 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -16,7 +16,7 @@ class Post < ActiveRecord::Base attr_protected :id, :updated_at, :created_at, :votes, :user_id - scope :basic, :include => [{:user => [:team, :profile]}, :topic] + scope :basic, -> {includes([{:user => [:team, :profile]}, :topic])} validates_presence_of :topic, :user validates_length_of :text, :in => 1..10000 diff --git a/app/models/user.rb b/app/models/user.rb index fc2622f..04a5e84 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -183,7 +183,7 @@ class User < ActiveRecord::Base end def banned? type = Ban::TYPE_SITE - Ban.first :conditions => ["expiry > UTC_TIMESTAMP() AND user_id = ? AND ban_type = ?", self.id, type] + Ban.where("expiry > UTC_TIMESTAMP() AND user_id = ? AND ban_type = ?", self.id, type).exists? end def admin? diff --git a/app/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb index ca08506..0643014 100644 --- a/app/views/comments/_comment.html.erb +++ b/app/views/comments/_comment.html.erb @@ -10,7 +10,7 @@