More progress on upgrade

This commit is contained in:
Ari Timonen 2019-06-07 11:04:16 -04:00
parent ce9797aed8
commit f156ed3060
10 changed files with 17 additions and 8 deletions

View file

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

View file

@ -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() {

View file

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

View file

@ -171,7 +171,6 @@ module ApplicationHelper
end
end
def upcoming_matches
GoogleCalendar.new(ENV['GOOGLE_CALENDAR_ID'], timezone_offset).
upcoming.sort_by do |event|

View file

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

View file

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

View file

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

View file

@ -10,7 +10,7 @@
</h1>
<div class="controls">
<% if cuser %>
<%= link_to_function icon('comment'), "QuoteText(#{comment.id}, 'comments')" %>
<%= link_to '#', data:{on: :click, call: 'QuoteText',args: "#{comment.id}, 'comments'"} >
<% if comment.can_update? cuser %>
<%= link_to icon('pencil'), edit_comment_path(comment) %>
<% end %>

View file

@ -69,7 +69,8 @@
<div class="controls">
<% if post.topic.posts.build.can_create? cuser %>
<%= link_to_function 'Quote Reply', "QuoteText(#{post.id}); $('#reply').fadeIn('slow')", class: 'button tiny' %>
<%= # link_to_function 'Quote Reply', "QuoteText(#{post.id}); $('#reply').fadeIn('slow') ", class: 'button tiny' %>
<%= link_to '#', data:{on: :click, call: 'QuoteText', args: "#{post.id}"}, class: 'button tiny' %>
<% end %>
<% if post.can_update? cuser %>
<%= link_to 'Edit', edit_post_path(post), class: 'button tiny' %>

View file

@ -54,7 +54,7 @@
<div>
<% if @newpost.can_create? cuser %>
<%= link_to_function 'Fast Reply', "$('#reply').fadeIn('slow')", class: 'button' %>
<%= link_to 'Fast Reply', "#", class: 'button fastReply' %>
<%= link_to 'Reply', new_post_path(@newpost, id: @topic), class: 'button' %>
<% end %>
<% if @topic.can_update? cuser %>