mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-11-14 00:40:49 +00:00
removed shoutmsg history
removed compmod council group from staff page fixed some errors with missing database entries
This commit is contained in:
parent
f695db4bb1
commit
dec054eed8
9 changed files with 35 additions and 81 deletions
13
Gemfile.lock
13
Gemfile.lock
|
@ -155,6 +155,8 @@ GEM
|
|||
hurley (0.2)
|
||||
i18n (0.9.1)
|
||||
concurrent-ruby (~> 1.0)
|
||||
i18n-js (3.0.11)
|
||||
i18n (>= 0.6.6, < 2)
|
||||
i18n_data (0.8.0)
|
||||
journey (1.0.4)
|
||||
jquery-rails (2.0.3)
|
||||
|
@ -162,7 +164,6 @@ GEM
|
|||
thor (~> 0.14)
|
||||
json (1.8.6)
|
||||
jwt (1.5.6)
|
||||
libv8 (3.16.14.19)
|
||||
little-plugger (1.1.4)
|
||||
logging (2.2.2)
|
||||
little-plugger (~> 1.1)
|
||||
|
@ -236,7 +237,6 @@ GEM
|
|||
rake (10.5.0)
|
||||
rdoc (3.12.2)
|
||||
json (~> 1.4)
|
||||
ref (2.0.0)
|
||||
representable (3.0.4)
|
||||
declarative (< 0.1.0)
|
||||
declarative-option (< 0.2.0)
|
||||
|
@ -295,9 +295,6 @@ GEM
|
|||
net-ssh (>= 2.8.0)
|
||||
test-unit (3.1.9)
|
||||
power_assert
|
||||
therubyracer (0.12.3)
|
||||
libv8 (~> 3.16.14.15)
|
||||
ref
|
||||
thor (0.20.0)
|
||||
tilt (1.4.1)
|
||||
timecop (0.7.4)
|
||||
|
@ -350,6 +347,7 @@ DEPENDENCIES
|
|||
font-awesome-sass (~> 4.1.0.0)
|
||||
google-api-client (~> 0.10.3)
|
||||
haml (~> 4.0.5)
|
||||
i18n-js
|
||||
jquery-rails (~> 2.0.2)
|
||||
mysql2 (~> 0.3.17)
|
||||
neat (~> 1.6.0)
|
||||
|
@ -372,14 +370,13 @@ DEPENDENCIES
|
|||
sprockets (~> 2.2.1)
|
||||
steam-condenser!
|
||||
test-unit (~> 3.1.3)
|
||||
therubyracer (~> 0.12.1)
|
||||
timecop (~> 0.7.1)
|
||||
tinymce-rails (~> 3.5.9)
|
||||
uglifier (~> 2.5.0)
|
||||
will_paginate (~> 3.0.5)
|
||||
|
||||
RUBY VERSION
|
||||
ruby 2.2.2p95
|
||||
ruby 2.2.10p489
|
||||
|
||||
BUNDLED WITH
|
||||
1.15.1
|
||||
1.16.5
|
||||
|
|
|
@ -22,6 +22,7 @@ class CustomUrlsController < ApplicationController
|
|||
|
||||
def show
|
||||
custom_url = CustomUrl.find_by_name(params[:name])
|
||||
raise ActiveRecord::RecordNotFound unless custom_url
|
||||
@article = custom_url.article
|
||||
raise AccessError unless @article.can_show? cuser
|
||||
@article.read_by! cuser if cuser
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
class ShoutmsgsController < ApplicationController
|
||||
respond_to :html, :js
|
||||
|
||||
def index
|
||||
@shoutmsgs = Shoutmsg.lastXXX.typebox
|
||||
end
|
||||
|
||||
def show
|
||||
if params[:id2]
|
||||
@shoutmsgs = Shoutmsg.recent.of_object(params[:id], params[:id2]).reverse
|
||||
|
|
|
@ -22,7 +22,6 @@ class Group < ActiveRecord::Base
|
|||
PREDICTORS = 8
|
||||
STAFF = 10
|
||||
GATHER_MODERATORS = 14
|
||||
COMP_MOD_COUNCIL = 16
|
||||
|
||||
attr_protected :id, :updated_at, :created_at, :founder_id
|
||||
validates_length_of :name, :maximum => 20
|
||||
|
@ -50,7 +49,8 @@ class Group < ActiveRecord::Base
|
|||
|
||||
def self.staff
|
||||
staff = []
|
||||
(find(ADMINS).groupers + find(PREDICTORS).groupers + find(CASTERS).groupers + find(STAFF).groupers + find(REFEREES).groupers).each do |g|
|
||||
|
||||
(admins + casters + referees + extras).each do |g|
|
||||
staff << g unless staff.include? g
|
||||
end
|
||||
staff
|
||||
|
@ -58,7 +58,10 @@ class Group < ActiveRecord::Base
|
|||
|
||||
def self.admins
|
||||
admins = []
|
||||
(find(ADMINS).groupers).each do |g|
|
||||
admin_group = where(id: ADMINS).first
|
||||
return admins unless admin_group
|
||||
|
||||
(admin_group.groupers).each do |g|
|
||||
admins << g unless admins.include? g
|
||||
end
|
||||
admins
|
||||
|
@ -66,7 +69,10 @@ class Group < ActiveRecord::Base
|
|||
|
||||
def self.referees
|
||||
referees = []
|
||||
(find(REFEREES).groupers).each do |g|
|
||||
referee_group = where(id: REFEREES).first
|
||||
return referees unless referee_group
|
||||
|
||||
(referee_group.groupers).each do |g|
|
||||
referees << g unless referees.include? g
|
||||
end
|
||||
referees
|
||||
|
@ -74,7 +80,13 @@ class Group < ActiveRecord::Base
|
|||
|
||||
def self.extras
|
||||
extras = []
|
||||
(find(PREDICTORS).groupers + find(STAFF).groupers).each do |g|
|
||||
extra_group = where(id: PREDICTORS).first
|
||||
staff_group = where(id: STAFF).first
|
||||
|
||||
extra_groupers = extra_group ? extra_group.groupers : []
|
||||
staff_groupers = staff_group ? staff_group.groupers : []
|
||||
|
||||
(extra_groupers + staff_groupers).each do |g|
|
||||
extras << g unless extras.include? g
|
||||
end
|
||||
extras
|
||||
|
@ -82,7 +94,10 @@ class Group < ActiveRecord::Base
|
|||
|
||||
def self.casters
|
||||
casters = []
|
||||
(find(CASTERS).groupers).each do |g|
|
||||
caster_group = where(id:CASTERS).first
|
||||
return casters unless caster_group
|
||||
|
||||
(caster_group.groupers).each do |g|
|
||||
casters << g unless casters.include? g
|
||||
end
|
||||
casters
|
||||
|
@ -90,17 +105,12 @@ class Group < ActiveRecord::Base
|
|||
|
||||
def self.gathermods
|
||||
gathermods = []
|
||||
(find(GATHER_MODERATORS).groupers).each do |g|
|
||||
gathermod_group = where(id:GATHER_MODERATORS).first
|
||||
return gathermods unless gathermod_group
|
||||
|
||||
(gathermod_group.groupers).each do |g|
|
||||
gathermods << g unless gathermods.include? g
|
||||
end
|
||||
gathermods
|
||||
end
|
||||
|
||||
def self.compmodcouncil
|
||||
compmodcouncil = []
|
||||
(find(COMP_MOD_COUNCIL).groupers).each do |g|
|
||||
compmodcouncil << g unless compmodcouncil.include? g
|
||||
end
|
||||
compmodcouncil
|
||||
end
|
||||
end
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
<li><a href="#referees">Referees</a></li>
|
||||
<li><a href="#casters">Casters</a></li>
|
||||
<li><a href="#gathermods">Gather Mods</a></li>
|
||||
<li><a href="#compmodcouncil">Comp. Mod Council</a></li>
|
||||
<li><a href="#extras">Extras</a></li>
|
||||
<li><a href="#support">Support</a></li>
|
||||
</ul>
|
||||
|
@ -148,37 +147,6 @@
|
|||
<% end %>
|
||||
</table>
|
||||
</div>
|
||||
<div class="tab" id="compmodcouncil">
|
||||
<h3>COMP. MOD COUNCIL</h3>
|
||||
<table class="striped staff">
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Username</th>
|
||||
<th>Email</th>
|
||||
<th>Task</th>
|
||||
<th>Age</th>
|
||||
</tr>
|
||||
<% Group.compmodcouncil.each do |grouper| %>
|
||||
<tr>
|
||||
<td class="country"><%= flag grouper.user.country %></td>
|
||||
<td class="username"><%= namelink grouper.user %></td>
|
||||
<% if grouper.user.public_email %>
|
||||
<td><%= h grouper.user.email_s %></td>
|
||||
<% else %>
|
||||
<td></td>
|
||||
<% end %>
|
||||
<td>
|
||||
<% if grouper.task %>
|
||||
<%= h grouper.task %>
|
||||
<% else %>
|
||||
<%= h grouper.group.name.singularize %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="age"><%= h grouper.user.age %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
</div>
|
||||
<div class="tab" id="extras">
|
||||
<h3>Extras</h3>
|
||||
<table class="striped staff">
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
<h1>Last 500 Shoutbox Messages</h1>
|
||||
|
||||
<table class="data">
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Time</th>
|
||||
<th>User</th>
|
||||
<th>Text</th>
|
||||
</tr>
|
||||
|
||||
<% @shoutmsgs.each do |shoutmsg| %>
|
||||
<tr class="<%= cycle('even', 'odd') %>">
|
||||
<td><%= shoutmsg.created_at.strftime("%Y/%m/%d") %></td>
|
||||
<td><%= shoutmsg.created_at.strftime("%H:%M") %></td>
|
||||
<td><%= link_to shoutmsg.user, shoutmsg.user %></td>
|
||||
<td><%= shoutmsg.text %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
|
@ -6,7 +6,6 @@
|
|||
</div>
|
||||
</div>
|
||||
<%= render partial: "shoutmsgs/new", locals: { shoutmsg: Shoutmsg.new } %>
|
||||
<%= link_to "Shoutbox Recent History", controller: :shoutmsgs, action: "index" %><br/>
|
||||
<%= link_to "Shoutbox Rules", article_path(Article::SB_RULES) %>
|
||||
</div>
|
||||
|
||||
|
|
3
config/initializers/abstract_mysql2_adapter.rb
Normal file
3
config/initializers/abstract_mysql2_adapter.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
class ActiveRecord::ConnectionAdapters::Mysql2Adapter
|
||||
NATIVE_DATABASE_TYPES[:primary_key] = "int(11) auto_increment PRIMARY KEY"
|
||||
end
|
|
@ -35,7 +35,7 @@ Ensl::Application.routes.draw do
|
|||
match "comments/quote"
|
||||
|
||||
resources :comments
|
||||
resources :shoutmsgs
|
||||
resources :shoutmsgs, except: :index
|
||||
resources :teamers
|
||||
resources :teams
|
||||
resources :gathers
|
||||
|
|
Loading…
Reference in a new issue