Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added verify plug-in, fixed form_for, form_tag in views, changed name…
…d_scope to scope
  • Loading branch information
jittat committed Oct 1, 2012
1 parent 3c63c51 commit d974478
Show file tree
Hide file tree
Showing 34 changed files with 618 additions and 209 deletions.
4 changes: 4 additions & 0 deletions Gemfile
Expand Up @@ -41,3 +41,7 @@ gem "tmail"
gem "rdiscount", :require => "rdiscount"
gem "test-unit"
gem 'will_paginate', '~> 3.0.0'

group :test, :development do
gem "rspec-rails", "~> 2.0"
end
15 changes: 15 additions & 0 deletions Gemfile.lock
Expand Up @@ -37,6 +37,7 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.3.3)
diff-lcs (1.1.3)
erubis (2.7.0)
execjs (1.4.0)
multi_json (~> 1.0)
Expand Down Expand Up @@ -81,6 +82,19 @@ GEM
rdiscount (1.6.8)
rdoc (3.12)
json (~> 1.4)
rspec (2.11.0)
rspec-core (~> 2.11.0)
rspec-expectations (~> 2.11.0)
rspec-mocks (~> 2.11.0)
rspec-core (2.11.1)
rspec-expectations (2.11.3)
diff-lcs (~> 1.1.3)
rspec-mocks (2.11.3)
rspec-rails (2.11.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec (~> 2.11.0)
sass (3.2.1)
sass-rails (3.2.5)
railties (~> 3.2.0)
Expand Down Expand Up @@ -113,6 +127,7 @@ DEPENDENCIES
prototype-rails
rails (= 3.2.8)
rdiscount
rspec-rails (~> 2.0)
sass-rails (~> 3.2.3)
test-unit
tmail
Expand Down
2 changes: 1 addition & 1 deletion app/models/contest.rb
Expand Up @@ -3,6 +3,6 @@ class Contest < ActiveRecord::Base
has_and_belongs_to_many :users
has_and_belongs_to_many :problems

named_scope :enabled, :conditions => {:enabled => true}
scope :enabled, :conditions => {:enabled => true}

end
2 changes: 1 addition & 1 deletion app/models/problem.rb
Expand Up @@ -8,7 +8,7 @@ class Problem < ActiveRecord::Base
validates_format_of :name, :with => /^\w+$/
validates_presence_of :full_name

named_scope :available, :conditions => {:available => true}
scope :available, :conditions => {:available => true}

DEFAULT_TIME_LIMIT = 1
DEFAULT_MEMORY_LIMIT = 32
Expand Down
2 changes: 1 addition & 1 deletion app/models/user.rb
Expand Up @@ -23,7 +23,7 @@ class User < ActiveRecord::Base

has_and_belongs_to_many :contests, :uniq => true, :order => 'name'

named_scope :activated_users, :conditions => {:activated => true}
scope :activated_users, :conditions => {:activated => true}

validates_presence_of :login
validates_uniqueness_of :login
Expand Down
2 changes: 1 addition & 1 deletion app/views/announcements/edit.html.erb
Expand Up @@ -2,7 +2,7 @@

<%= error_messages_for :announcement %>
<% form_for(@announcement) do |f| %>
<%= form_for(@announcement) do |f| %>
<p>
<b>Title</b><br />
<%= f.text_field :title %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/announcements/new.html.erb
Expand Up @@ -2,7 +2,7 @@

<%= error_messages_for :announcement %>
<% form_for(@announcement) do |f| %>
<%= form_for(@announcement) do |f| %>
<p>
<b>Title</b><br />
<%= f.text_field :title %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/contests/edit.html.erb
@@ -1,6 +1,6 @@
<h1>Editing contest</h1>

<% form_for(@contest) do |f| %>
<%= form_for(@contest) do |f| %>
<%= f.error_messages %>

<table>
Expand Down
2 changes: 1 addition & 1 deletion app/views/contests/new.html.erb
@@ -1,6 +1,6 @@
<h1>New contest</h1>

<% form_for(@contest) do |f| %>
<%= form_for(@contest) do |f| %>
<%= f.error_messages %>

<p>
Expand Down
2 changes: 1 addition & 1 deletion app/views/main/_login_box.html.haml
Expand Up @@ -12,7 +12,7 @@
%hr/

%div{ :style => "border: solid 1px gray; padding: 4px; background: #eeeeff;"}
- form_tag :controller => 'login', :action => 'login' do
= form_tag :controller => 'login', :action => 'login' do
%table
%tr
%td{:align => "right"}
Expand Down
2 changes: 1 addition & 1 deletion app/views/main/_submission_box.html.erb
@@ -1,4 +1,4 @@
<% form_tag({:action => 'submit'}, :multipart => true) do %>
<%= form_tag({:action => 'submit'}, :multipart => true) do %>
<b>Problem:</b> <%= select 'submission', 'problem_id',
[[(t 'main.specified_in_header'),'-1']] +
@problems.collect {|p| [p.full_name, p.id]},
Expand Down
2 changes: 1 addition & 1 deletion app/views/problems/edit.rhtml
@@ -1,6 +1,6 @@
<h1>Editing problem</h1>

<% form_tag :action => 'update', :id => @problem do %>
<%= form_tag :action => 'update', :id => @problem do %>
<%= render :partial => 'form' %>
<%= submit_tag 'Edit' %>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/problems/list.rhtml
Expand Up @@ -14,7 +14,7 @@
</p>

<div class="submitbox">
<% form_tag :action => 'quick_create' do %>
<%= form_tag :action => 'quick_create' do %>
<b>Quick New:</b>
<label for="problem_name">Name</label>
<%= text_field 'problem', 'name' %> |
Expand Down
2 changes: 1 addition & 1 deletion app/views/problems/new.rhtml
@@ -1,6 +1,6 @@
<h1>New problem</h1>

<% form_tag :action => 'create' do %>
<%= form_tag :action => 'create' do %>
<%= render :partial => 'form' %>
<%= submit_tag "Create" %>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/sites/edit.html.erb
Expand Up @@ -2,7 +2,7 @@

<%= error_messages_for :site %>
<% form_for(@site) do |f| %>
<%= form_for(@site) do |f| %>
<p>
<b>Name</b><br />
<%= f.text_field :name %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/sites/new.html.erb
Expand Up @@ -2,7 +2,7 @@

<%= error_messages_for :site %>
<% form_for(@site) do |f| %>
<%= form_for(@site) do |f| %>
<p>
<b>Name</b><br />
<%= f.text_field :name %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/user_admin/contests.html.erb
Expand Up @@ -15,7 +15,7 @@
<%= link_to "[no contest]", :action => 'contests', :id => 'none' %>
<% end %>
<br/>
<% form_tag :action => 'assign_from_list' do %>
<%= form_tag :action => 'assign_from_list' do %>
<%= hidden_field_tag 'users_contest_id', (@contest ? @contest.id : 'none') %>
Assign all to
<%= select("new_contest","id",Contest.all.collect {|c| [c.title, c.id]}) %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/user_admin/edit.rhtml
@@ -1,6 +1,6 @@
<h1>Editing user</h1>

<% form_tag :action => 'update', :id => @user do %>
<%= form_tag :action => 'update', :id => @user do %>
<%= render :partial => 'form' %>
<%= submit_tag 'Edit' %>
<% end %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/user_admin/list.rhtml
Expand Up @@ -2,7 +2,7 @@

<div class="submitbox">
<b>Quick add</b>
<% form_tag :action => 'create' do %>
<%= form_tag :action => 'create' do %>
<table border="0">
<tr>
<td><label for="user_login">Login</label></td>
Expand All @@ -23,7 +23,7 @@
<% end %>
<br/>
<b>Import from site management</b>
<% form_tag({:action => 'import'}, :multipart => true) do %>
<%= form_tag({:action => 'import'}, :multipart => true) do %>
File: <%= file_field_tag 'file' %> <%= submit_tag 'Import' %>
<% end %>
<br/>
Expand Down
2 changes: 1 addition & 1 deletion app/views/user_admin/new.rhtml
@@ -1,6 +1,6 @@
<h1>New user</h1>

<% form_tag :action => 'create' do %>
<%= form_tag :action => 'create' do %>
<%= render :partial => 'form' %>
<%= submit_tag "Create" %>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/user_admin/new_list.rhtml
@@ -1,6 +1,6 @@
<h1>Adding list of users</h1>

<% form_tag :action => 'create_from_list' do %>
<%= form_tag :action => 'create_from_list' do %>
<%= submit_tag 'create users' %><br/>
List of user information in this format: <tt>user_id,name(,passwd(,alias))</tt><br/>
Note that <tt>passwd</tt> and <tt>alias</tt> is optional.<br/>
Expand Down
144 changes: 0 additions & 144 deletions lib/tasks/rspec.rake

This file was deleted.

Empty file added log/.gitkeep
Empty file.

0 comments on commit d974478

Please sign in to comment.