Commit ab027db4 authored by 神楽坂玲奈's avatar 神楽坂玲奈

临时,不能用

parent a73a1e25
<?xml version="1.0" encoding="UTF-8"?>
<Settings><!--This file was automatically generated by Ruby plugin.
You are allowed to:
1. Reorder generators
2. Remove generators
3. Add installed generators
To add new installed generators automatically delete this file and reload the project.
--><GeneratorsGroup><Generator name="active_record:migration" /><Generator name="active_record:model" /><Generator name="active_record:observer" /><Generator name="active_record:session_migration" /><Generator name="controller" /><Generator name="erb:controller" /><Generator name="erb:mailer" /><Generator name="erb:scaffold" /><Generator name="generator" /><Generator name="helper" /><Generator name="integration_test" /><Generator name="mailer" /><Generator name="metal" /><Generator name="migration" /><Generator name="model" /><Generator name="model_subclass" /><Generator name="observer" /><Generator name="performance_test" /><Generator name="plugin" /><Generator name="resource" /><Generator name="scaffold" /><Generator name="scaffold_controller" /><Generator name="session_migration" /><Generator name="stylesheets" /><Generator name="test_unit:controller" /><Generator name="test_unit:helper" /><Generator name="test_unit:integration" /><Generator name="test_unit:mailer" /><Generator name="test_unit:model" /><Generator name="test_unit:observer" /><Generator name="test_unit:performance" /><Generator name="test_unit:plugin" /><Generator name="test_unit:scaffold" /></GeneratorsGroup></Settings>
mycard-server-http
\ No newline at end of file
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectResources">
<default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="ruby-1.9.3-p134" project-jdk-type="RUBY_SDK" />
<component name="SvnConfiguration" maxAnnotateRevisions="500" myUseAcceleration="nothing" myAutoUpdateAfterCommit="false" cleanupOnStartRun="false">
<option name="USER" value="" />
<option name="PASSWORD" value="" />
<option name="mySSHConnectionTimeout" value="30000" />
<option name="mySSHReadTimeout" value="30000" />
<option name="LAST_MERGED_REVISION" />
<option name="MERGE_DRY_RUN" value="false" />
<option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
<option name="UPDATE_LOCK_ON_DEMAND" value="false" />
<option name="IGNORE_SPACES_IN_MERGE" value="false" />
<option name="DETECT_NESTED_COPIES" value="true" />
<option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
<option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
<option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
<option name="FORCE_UPDATE" value="false" />
<myIsUseDefaultProxy>false</myIsUseDefaultProxy>
</component>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/mycard-server-http.iml" filepath="$PROJECT_DIR$/.idea/mycard-server-http.iml" />
</modules>
</component>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<module type="RUBY_MODULE" version="4">
<component name="FacetManager">
<facet type="RailsFacetType" name="Ruby on Rails">
<configuration>
<RAILS_FACET_CONFIG_ID NAME="RAILS_FACET_SUPPORT_REMOVED" VALUE="false" />
<RAILS_FACET_CONFIG_ID NAME="RAILS_TESTS_SOURCES_PATCHED" VALUE="true" />
<RAILS_FACET_CONFIG_ID NAME="RAILS_FACET_APPLICATION_ROOT" VALUE="$MODULE_DIR$" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="actionmailer (v3.2.2, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="actionpack (v3.2.2, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="activemodel (v3.2.2, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="activerecord (v3.2.2, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="activerecord-import (v0.2.9, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="activeresource (v3.2.2, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="activesupport (v3.2.2, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="arel (v3.0.2, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="bb-ruby (v0.9.5, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="builder (v3.0.0, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.1.3, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="cocaine (v0.2.1, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="coffee-rails (v3.2.2, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="coffee-script (v2.2.0, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="coffee-script-source (v1.3.1, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="erubis (v2.7.0, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="execjs (v1.3.1, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="hike (v1.2.1, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="http_accept_language (v1.0.2, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="i18n (v0.6.0, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="journey (v1.0.3, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="jquery-rails (v2.0.2, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="json (v1.7.0, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="mail (v2.4.4, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="mime-types (v1.18, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="multi_json (v1.3.4, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="mysql2 (v0.3.11, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="paperclip (v3.0.2, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="polyglot (v0.3.3, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="rack (v1.4.1, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="rack-cache (v1.2, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="rack-ssl (v1.3.2, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="rack-test (v0.6.1, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="rails (v3.2.2, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="railties (v3.2.2, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="rake (v0.9.2.2, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="rdoc (v3.12, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="sass (v3.1.16, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="sass-rails (v3.2.5, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="sprockets (v2.1.3, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="thor (v0.14.6, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="tilt (v1.3.3, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="treetop (v1.4.10, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="tzinfo (v0.3.33, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="uglifier (v1.2.4, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="will-paginate-i18n (v0.1.2, ruby-1.9.3-p134) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="will_paginate (v3.0.3, ruby-1.9.3-p134) [gem]" level="application" />
</component>
<component name="RModuleSettingsStorage">
<LOAD_PATH number="0" />
<I18N_FOLDERS number="1" string0="$MODULE_DIR$/config/locales" />
</component>
</module>
<component name="DependencyValidationManager">
<state>
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</state>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
This diff is collapsed.
app/assets/images/captcha/circle.png

3.43 KB | W: | H:

app/assets/images/captcha/circle.png

6.81 KB | W: | H:

app/assets/images/captcha/circle.png
app/assets/images/captcha/circle.png
app/assets/images/captcha/circle.png
app/assets/images/captcha/circle.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -29,13 +29,10 @@ class PostsController < ApplicationController
# GET /posts/new.xml
def new
@topic = Topic.find(params[:topic_id])
if @topic.nil? or @topic.locked
return render :text => "Topic not found or locked."
end
@post = Post.new
@post.topic = @topic
@post.attachments.build
@post.attachments.build
@actions = [@topic, :reply]
@actions = [@topic, "回复"]
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @post }
......
......@@ -53,7 +53,8 @@ class TopicsController < ApplicationController
@topic.update_attribute(:viewnum, @topic.viewnum + 1)
@current_user.update_attribute(:viewnum, @current_user.viewnum + 1)
@post = Post.new(topic: @topic)
@post = Post.new
@post.topic = @topic
@post.attachments.build
respond_to do |format|
format.html # show.html.erb
......
......@@ -65,7 +65,7 @@ class UsersController < ApplicationController
if @user.save
boardcast_user(@user)
session[:user_id] = @user.id
format.html { redirect_to(@user, :notice => '注册成功') }
format.html { redirect_to(params[:continue] || @user, :notice => '注册成功') }
format.xml { render :xml => @user, :status => :created, :location => @user }
else
format.html { render :action => "new" }
......@@ -110,9 +110,7 @@ class UsersController < ApplicationController
end
def login
@actions = [User.human_attribute_name(:login)]
@user = User.new
end
def login_do
return @user = User.new if params[:user].blank?
@actions = [User.human_attribute_name(:login)]
user = User.find_by_name(params[:user][:name])
if user and params[:user][:password] == user.password
......@@ -120,7 +118,7 @@ class UsersController < ApplicationController
elsif user.nil? or user.password.nil?
username = params[:user][:name]
password = params[:user][:password]
Server.each do |server|
Server.all.each do |server|
open("http://#{server.ip}:#{server.http_port}/?operation=passcheck&username=#{CGI.escape username}&pass=#{CGI.escape password}") do |file|
if file.read == "true"
user.password = password
......@@ -137,7 +135,7 @@ class UsersController < ApplicationController
session[:user_id] = @user.id
@user.update_attribute(:lastloginip, request.remote_ip)
boardcast_user(@user)
format.html { redirect_to(@user, :notice => 'Login Successfully.') }
format.html { redirect_to(params[:continue] || @user, :notice => 'Login Successfully.') }
format.json { render json: @user }
else
@user = User.new(params[:user])
......@@ -145,7 +143,6 @@ class UsersController < ApplicationController
format.json { head json: nil }
end
end
end
def logout
session[:user_id] = nil
......
......@@ -3,7 +3,6 @@ class Duel < ActiveRecord::Base
belongs_to :user1, :class_name => "User"
belongs_to :user2, :class_name => "User"
belongs_to :winner, :class_name => "User"
self.per_page = 20
has_many :duel_user_cards
has_many :cards, :through => :duel_user_cards
def user_cards(user, main)
......
#encoding: UTF-8
class Post < ActiveRecord::Base
belongs_to :topic
belongs_to :user
......@@ -6,6 +7,7 @@ class Post < ActiveRecord::Base
accepts_nested_attributes_for :attachments
validates :content, :presence => true
validates :user_id, :numericality => { :greater_than => 0, :message => "发帖请先登录" }
def user
super || User::Guest
end
......
#encoding: UTF-8
class Topic < ActiveRecord::Base
belongs_to :user
#belongs_to :type
belongs_to :board, :foreign_key => :category_id
has_many :posts
accepts_nested_attributes_for :posts
validates :name, :presence => true
validates :user_id, :numericality => { :greater_than => 0, :message => "发帖请先登录" }
default_scope where(:deleted => false)
self.per_page = 20
alias category board
def user
......
#encoding: UTF-8
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me, :name, :nickname, :role_id, :regip, :lastloginip, :viewnum, :onlinetime, :credit1, :credit2, :credit3, :credit4, :credit5, :credit6, :credit7, :credit8
has_attached_file :avatar, :styles => { :middle => ["120x120#", :png], :small => ["48x48#", :png] }, :default_url => lambda { |avatar| "http://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(avatar.instance.email.strip.downcase)}?size=#{120}" }
......@@ -14,7 +21,9 @@ class User < ActiveRecord::Base
:format => {:with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i}
has_many :topics
has_many :posts, :through => :topics
def admin?
true
end
def top_duels(count = 20)
duels.reverse_order.limit(count)
end
......
This diff is collapsed.
......@@ -38,7 +38,7 @@
</tr>
</thead>
<tfoot>
<tr><td colspan="7"><%= will_paginate @duels %></td></tr>
<tr><td colspan="7"><%= paginate @duels %></td></tr>
</tfoot>
<tbody>
<% first_index = @user.duels.where("id<=?",@duels.to_enum.first.id).count if @user and !@user.duels.empty? %><!--这里的效率很低,待优化-->
......
<%# Link to the "First" page
- available local variables
url: url to the first page
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<span class="first">
<%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote %>
</span>
<%# Non-link tag that stands for skipped pages...
- available local variables
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<span class="page gap"><%= raw(t 'views.pagination.truncate') %></span>
<%# Link to the "Last" page
- available local variables
url: url to the last page
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<span class="last">
<%= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote} %>
</span>
<%# Link to the "Next" page
- available local variables
url: url to the next page
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<span class="next">
<%= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote %>
</span>
<%# Link showing page number
- available local variables
page: a page object for "this" page
url: url to this page
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<span class="page<%= ' current' if page.current? %>">
<%= link_to_unless page.current?, page, url, opts = {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} %>
</span>
<%# The container tag
- available local variables
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
paginator: the paginator that renders the pagination tags inside
-%>
<%= paginator.render do -%>
<nav class="pagination">
<%= first_page_tag unless current_page.first? %>
<%= prev_page_tag unless current_page.first? %>
<% each_page do |page| -%>
<% if page.left_outer? || page.right_outer? || page.inside_window? -%>
<%= page_tag page %>
<% elsif !page.was_truncated? -%>
<%= gap_tag %>
<% end -%>
<% end -%>
<%= next_page_tag unless current_page.last? %>
<%= last_page_tag unless current_page.last? %>
</nav>
<% end -%>
<%# Link to the "Previous" page
- available local variables
url: url to the previous page
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<span class="prev">
<%= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote %>
</span>
......@@ -12,10 +12,6 @@
<% end %>
<!--<div class="field">
<%= f.label :topic %><br />
<%= f.text_field :topic %>
</div>
<div class="field">
<%= f.label :user %><br />
<%= f.text_field :user %>
</div>-->
......@@ -64,6 +60,7 @@
</div>
<% end %>
</div>
<%= f.hidden_field :topic_id %>
<div class="actions">
<%= f.submit %>
</div>
......
......@@ -74,9 +74,15 @@
<% end %>
</div>
<%= f.hidden_field :topic_id %>
<div class="actions">
<%= f.submit %>
</div>
<% if logged? %>
<div class="actions">
<%= f.submit %>
</div>
<% else %>
<div class="actions">
要发帖,请先 <%= link_to "注册", register_path %><%= link_to "登录", login_path %>
</div>
<% end %>
<% end %>
<script type="text/javascript">
$(document).ready(function() {
......
......@@ -48,7 +48,7 @@ module MycardServerHttp
# This will create an empty whitelist of attributes available for mass-assignment for all models
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
# parameters by using an attr_accessible or attr_protected declaration.
# config.active_record.whitelist_attributes = true
config.active_record.whitelist_attributes = true
# Enable the asset pipeline
config.assets.enabled = true
......
......@@ -5,4 +5,4 @@ require File.expand_path('../application', __FILE__)
MycardServerHttp::Application.initialize!
Mime::Type.register 'application/octet-stream', :ydk
Mime::Type.register 'application/octet-stream', :yrp
Mime::Type.register 'application/octet-stream', :deck
\ No newline at end of file
Mime::Type.register 'application/octet-stream', :deck
......@@ -5,17 +5,17 @@ MycardServerHttp::Application.configure do
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = true
config.serve_static_assets = false
# Compress JavaScripts and CSS
config.assets.compress = true
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = true
config.assets.compile = false
# Generate digests for assets URLs
config.assets.digest = true
......@@ -25,7 +25,7 @@ MycardServerHttp::Application.configure do
# Specifies the header that your server uses for sending files
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
......
This diff is collapsed.
......@@ -3,4 +3,3 @@
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone
Mime::Type.register "application/json-p", :jsonp
\ No newline at end of file
#encoding: UTF-8
RailsAdmin.config do |config|
config.main_app_name = Proc.new { |controller| [ "Mycard", "管理中心 - #{controller.params[:action].try(:titleize)}" ] }
config.authenticate_with &:authenticate_admin!
end
\ No newline at end of file
......@@ -4,4 +4,4 @@
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
MycardServerHttp::Application.config.secret_token = 'a32b24adbf3c1eb8ce92cd7ad099a14ff05bbf94ac397ddfe6ed0afd74cbaf58597ae575e1ef8e595a03f9a3f97b777ab500690efdfd8e58518da7775957da9c'
MycardServerHttp::Application.config.secret_token = '4305b8fb721201a119f88db9a433022ec1b3dd5e1b7f80026661dada544457fee1a0b7e6aee25db081ebe198b0d838a625e1143615b47cede510aef8c5cea04b'
# Be sure to restart your server when you modify this file.
MycardServerHttp::Application.config.session_store :cookie_store, key: '_mycard-server-http_session', :expire_after => 9999.years
MycardServerHttp::Application.config.session_store :cookie_store, key: '_mycard_server_http_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
......
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
en:
errors:
messages:
expired: "has expired, please request a new one"
not_found: "not found"
already_confirmed: "was already confirmed, please try signing in"
not_locked: "was not locked"
not_saved:
one: "1 error prohibited this %{resource} from being saved:"
other: "%{count} errors prohibited this %{resource} from being saved:"
devise:
failure:
already_authenticated: 'You are already signed in.'
unauthenticated: 'You need to sign in or sign up before continuing.'
unconfirmed: 'You have to confirm your account before continuing.'
locked: 'Your account is locked.'
invalid: 'Invalid email or password.'
invalid_token: 'Invalid authentication token.'
timeout: 'Your session expired, please sign in again to continue.'
inactive: 'Your account was not activated yet.'
sessions:
signed_in: 'Signed in successfully.'
signed_out: 'Signed out successfully.'
passwords:
send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.'
updated: 'Your password was changed successfully. You are now signed in.'
updated_not_active: 'Your password was changed successfully.'
send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
confirmations:
send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
send_paranoid_instructions: 'If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes.'
confirmed: 'Your account was successfully confirmed. You are now signed in.'
registrations:
signed_up: 'Welcome! You have signed up successfully.'
signed_up_but_unconfirmed: 'A message with a confirmation link has been sent to your email address. Please open the link to activate your account.'
signed_up_but_inactive: 'You have signed up successfully. However, we could not sign you in because your account is not yet activated.'
signed_up_but_locked: 'You have signed up successfully. However, we could not sign you in because your account is locked.'
updated: 'You updated your account successfully.'
update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address."
destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
unlocks:
send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
unlocked: 'Your account has been unlocked successfully. Please sign in to continue.'
send_paranoid_instructions: 'If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.'
omniauth_callbacks:
success: 'Successfully authenticated from %{kind} account.'
failure: 'Could not authenticate you from %{kind} because "%{reason}".'
mailer:
confirmation_instructions:
subject: 'Confirmation instructions'
reset_password_instructions:
subject: 'Reset password instructions'
unlock_instructions:
subject: 'Unlock Instructions'
......@@ -252,4 +252,4 @@ en:
mycard:
battlenet: "YGO Battle Net"
more:
"More..."
\ No newline at end of file
"More..."
en:
views:
pagination:
first: "&laquo; First"
last: "Last &raquo;"
previous: "&lsaquo; Prev"
next: "Next &rsaquo;"
truncate: "..."
\ No newline at end of file
zh-CN:
views:
pagination:
first: "&laquo; 第一页"
last: "尾页 &raquo;"
previous: "&lsaquo; 上一页"
next: "下一页 &rsaquo;"
truncate: "..."
\ No newline at end of file
zh-CN:
home:
name: "网站首页"
views:
pagination:
previous: "&laquo; 上一页"
next: "下一页 &raquo;"
truncate: "…"
admin:
misc:
filter_date_format: "yy-mm-dd" # a combination of 'dd', 'mm' and 'yy' with any delimiter. No other interpolation will be done!
search: "搜索"
filter: "过滤"
refresh: "刷新"
show_all: "查看全部"
add_filter: "添加过滤条件"
bulk_menu_title: "选中的项目"
remove: "删除"
add_new: "新增"
chosen: "选择%{name}"
chose_all: "全选"
clear_all: "取消选择"
up: "上"
down: "下"
navigation: "导航"
log_out: "注销登录"
ago: "前"
flash:
successful: "%{name}%{action}成功"
error: "%{name}%{action}失败"
noaction: "没有任何操作"
model_not_found: "找不到 '%{model}' Model"
object_not_found: "找不到 id '%{id} '%{model}'"
table_headers:
model_name: "模型名称"
last_used: "最后使用"
records: "记录"
username: "用户"
changes: "变更"
created_at: "日期/时间"
item: "项目"
message: "信息"
actions:
dashboard:
title: "管理中心"
menu: "管理面板"
breadcrumb: "管理面板"
index:
title: "%{model_label_plural}列表"
menu: "列表"
breadcrumb: "%{model_label_plural}"
show:
title: "详细信息: %{model_label} '%{object_label}'"
menu: "查看"
breadcrumb: "%{object_label}"
show_in_app:
menu: "在站点中显示"
new:
title: "新增 %{model_label}"
menu: "新增"
breadcrumb: "新的"
link: "新增%{model_label}"
done: "已建立"
edit:
title: "编辑 %{model_label} '%{object_label}'"
menu: "编辑"
breadcrumb: "编辑"
link: "编辑%{model_label}"
done: "已更新"
delete:
title: "删除 %{model_label} '%{object_label}'"
menu: "删除"
breadcrumb: "删除"
link: "删除 '%{object_label}'"
done: "已删除"
bulk_delete:
title: "删除 %{model_label_plural}"
menu: "批量删除"
breadcrumb: "批量删除"
bulk_link: "删除选中的 %{model_label_plural}"
export:
title: "导出 %{model_label_plural}"
menu: "导出"
breadcrumb: "导出"
link: "导出找到的 %{model_label_plural}"
bulk_link: "导出选中的 %{model_label_plural}"
done: "已导出"
history_index:
title: "修改记录: %{model_label_plural}"
menu: "修改记录"
breadcrumb: "修改记录"
history_show:
title: "修改记录: %{model_label} '%{object_label}'"
menu: "修改记录"
breadcrumb: "修改记录"
form:
cancel: "取消"
basic_info: "基本信息"
required: "必填"
optional: "选填"
one_char: "限一个字符"
char_length_up_to: "字数限制: "
char_length_of: "字数: "
save: "保存"
save_and_add_another: "保存后继续添加"
save_and_edit: "保存后继续编辑"
all_of_the_following_related_items_will_be_deleted: "? 下列的关联项目将被删除或孤立:"
are_you_sure_you_want_to_delete_the_object: "您确定要删除 %{model_name} 吗?"
confirmation: "是的,我确定"
bulk_delete: "下列的项目将被删除,其相依的项目将会被删除或孤立:"
new_model: "%{name} (新)"
export:
confirmation: "导出至 %{name}"
select: "选择欲导出的栏位"
fields_from: "来自 %{name} 的栏位"
fields_from_associated: "来自关联 '%{name}' 的栏位"
display: "显示 %{name}: %{type}"
options_for: "%{name} 选项"
empty_value_for_associated_objects: "<空>"
click_to_reverse_selection: '反向选择'
csv:
header_for_root_methods: "%{name}" # 'model' is available
header_for_association_methods: "%{name} [%{association}]"
encoding_to: "档案编码"
encoding_to_help: "选择输出的编码。留空保留来源的编码: (%{name})"
skip_header: "略过标头"
skip_header_help: "不要输出标头资讯(无栏位描述)"
default_col_sep: ","
col_sep: "栏位分隔字元"
col_sep_help: "留空将使用预设值 ('%{value}')" # value is default_col_sep
\ No newline at end of file
zh-TW:
home:
name: "網站首頁"
views:
pagination:
previous: "&laquo; 前頁"
next: "次頁 &raquo;"
truncate: "…"
admin:
misc:
filter_date_format: "mm/dd/yy" # a combination of 'dd', 'mm' and 'yy' with any delimiter. No other interpolation will be done!
search: "搜尋"
filter: "過慮"
refresh: "重整"
show_all: "檢視全部"
add_filter: "新增過慮條件"
bulk_menu_title: "選定的項目"
remove: "移除"
add_new: "新增"
chosen: "選擇%{name}"
chose_all: "全選"
clear_all: "取消選取"
up: "上"
down: "下"
navigation: "導覽"
log_out: "登出"
ago: "前"
flash:
successful: "%{name}%{action}成功"
error: "%{name}%{action}失敗"
noaction: "沒作任何動作"
model_not_found: "找不到 '%{model}' Model"
object_not_found: "找不到 id '%{id} '%{model}'"
table_headers:
model_name: "Model 名稱"
last_used: "最後使用"
records: "記錄"
username: "使用者"
changes: "變更"
created_at: "日期/時間"
item: "項目"
message: "訊息"
actions:
dashboard:
title: "站台管理"
menu: "儀錶板"
breadcrumb: "儀錶板"
index:
title: "%{model_label_plural}清單"
menu: "清單"
breadcrumb: "%{model_label_plural}"
show:
title: "詳細資訊: %{model_label} '%{object_label}'"
menu: "檢視"
breadcrumb: "%{object_label}"
show_in_app:
menu: "在站台中顯示"
new:
title: "新增 %{model_label}"
menu: "新增"
breadcrumb: "新的"
link: "新增%{model_label}"
done: "已建立"
edit:
title: "編輯 %{model_label} '%{object_label}'"
menu: "編輯"
breadcrumb: "編輯"
link: "編輯%{model_label}"
done: "已更新"
delete:
title: "刪除 %{model_label} '%{object_label}'"
menu: "刪除"
breadcrumb: "刪除"
link: "刪除 '%{object_label}'"
done: "已刪除"
bulk_delete:
title: "刪除 %{model_label_plural}"
menu: "批次刪除"
breadcrumb: "批次刪除"
bulk_link: "刪除選擇的 %{model_label_plural}"
export:
title: "匯出 %{model_label_plural}"
menu: "匯出"
breadcrumb: "匯出"
link: "匯出找到的 %{model_label_plural}"
bulk_link: "匯出選取的 %{model_label_plural}"
done: "已匯出"
history_index:
title: "編輯履歷: %{model_label_plural}"
menu: "編輯履歷"
breadcrumb: "履歷"
history_show:
title: "編輯履歷: %{model_label} '%{object_label}'"
menu: "編輯履歷"
breadcrumb: "編輯履歷"
form:
cancel: "取消"
basic_info: "基本資訊"
required: "必填"
optional: "選填"
one_char: "限一個字元"
char_length_up_to: "字元數限制: "
char_length_of: "字元數: "
save: "儲存"
save_and_add_another: "儲存後繼續新增"
save_and_edit: "儲存後繼續編輯"
all_of_the_following_related_items_will_be_deleted: "? 下列的關聯項目將被刪除或孤立:"
are_you_sure_you_want_to_delete_the_object: "您確定要刪除 %{model_name} 嗎?"
confirmation: "是的,我確定"
bulk_delete: "下列的項目將被刪除,其相依的項目將會被刪除或孤立:"
new_model: "%{name} (新)"
export:
confirmation: "匯出至 %{name}"
select: "選擇欲匯出的欄位"
fields_from: "來自 %{name} 的欄位"
fields_from_associated: "來自關聯 '%{name}' 的欄位"
display: "顯示 %{name}: %{type}"
options_for: "%{name} 選項"
empty_value_for_associated_objects: "<空>"
click_to_reverse_selection: '反向選擇'
csv:
header_for_root_methods: "%{name}" # 'model' is available
header_for_association_methods: "%{name} [%{association}]"
encoding_to: "檔案編碼"
encoding_to_help: "選擇輸出的編碼。留空保留來源的編碼: (%{name})"
skip_header: "略過標頭"
skip_header_help: "不要輸出標頭資訊(無欄位描述)"
default_col_sep: ","
col_sep: "欄位分隔字元"
col_sep_help: "留空將使用預設值 ('%{value}')" # value is default_col_sep
\ No newline at end of file
......@@ -204,6 +204,23 @@ zh-CN:
errors:
<<: *errors
models:
attachment: "附件"
board: "版块"
card: "卡片"
comment: "(未使用)评论"
deck: "玩家使用卡组记录"
duel: "决斗记录"
duel_user_card: "玩家使用卡片记录"
library: "卡组分类"
link: "友情链接"
moderation: "(未使用)版务操作记录"
moderator: "版主"
navigation: "导航"
notice: "(未使用)提醒"
pm: "(未使用)短消息"
role: "(未使用)用户组"
server: "服务器"
setting: "(未使用)系统设置"
user: "用户"
topic: "主题"
post: "帖子"
......
......@@ -38,8 +38,7 @@ MycardServerHttp::Application.routes.draw do
get 'topics' => "users#topic"
end
get 'theme/:theme' => 'users#theme', :as => :theme
get 'login' => 'users#login'
post 'login' => 'users#login_do'
match 'login' => 'users#login'
get 'logout' => 'users#logout'
get 'register' => 'users#new'
resources :pms
......@@ -47,6 +46,7 @@ MycardServerHttp::Application.routes.draw do
resources :moderations
match "/captcha" => "captcha#show"
mount RailsAdmin::Engine => '/admin', :as => 'rails_admin'
# The priority is based upon order of creation:
# first created -> highest priority.
......
class AddDeviseToUsers < ActiveRecord::Migration
def self.up
change_table(:users) do |t|
## Database authenticatable
#t.string :email, :null => false, :default => ""
t.string :encrypted_password, :null => false, :default => ""
## Recoverable
t.string :reset_password_token
t.datetime :reset_password_sent_at
## Rememberable
t.datetime :remember_created_at
## Trackable
t.integer :sign_in_count, :default => 0
t.datetime :current_sign_in_at
t.datetime :last_sign_in_at
t.string :current_sign_in_ip
t.string :last_sign_in_ip
## Confirmable
# t.string :confirmation_token
# t.datetime :confirmed_at
# t.datetime :confirmation_sent_at
# t.string :unconfirmed_email # Only if using reconfirmable
## Lockable
# t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
# t.string :unlock_token # Only if unlock strategy is :email or :both
# t.datetime :locked_at
## Token authenticatable
# t.string :authentication_token
# Uncomment below if timestamps were not included in your original model.
# t.timestamps
end
add_index :users, :email#, #:unique => true
add_index :users, :reset_password_token, :unique => true
# add_index :users, :confirmation_token, :unique => true
# add_index :users, :unlock_token, :unique => true
# add_index :users, :authentication_token, :unique => true
end
def self.down
# By default, we don't want to make any assumption about how to roll back a migration when your
# model already existed. Please edit below which fields you would like to remove in this migration.
raise ActiveRecord::IrreversibleMigration
end
end
......@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20120518234415) do
ActiveRecord::Schema.define(:version => 20120522232536) do
create_table "attachments", :force => true do |t|
t.string "data_file_name"
......@@ -232,38 +232,49 @@ ActiveRecord::Schema.define(:version => 20120518234415) do
end
create_table "users", :force => true do |t|
t.string "name", :null => false
t.string "name", :null => false
t.string "password"
t.string "email", :default => "", :null => false
t.string "nickname", :default => "", :null => false
t.string "email", :default => "", :null => false
t.string "nickname", :default => "", :null => false
t.text "signature"
t.integer "credits", :default => 0, :null => false
t.integer "credit1", :default => 0, :null => false
t.integer "credit2", :default => 0, :null => false
t.integer "credit3", :default => 0, :null => false
t.integer "credit4", :default => 0, :null => false
t.integer "credit5", :default => 0, :null => false
t.integer "credit6", :default => 0, :null => false
t.integer "credit7", :default => 0, :null => false
t.integer "credit8", :default => 0, :null => false
t.integer "win", :default => 0, :null => false
t.integer "lost", :default => 0, :null => false
t.integer "role_id", :default => 5, :null => false
t.boolean "locked", :default => false, :null => false
t.string "regip", :default => "", :null => false
t.string "lastloginip", :default => "", :null => false
t.integer "viewnum", :default => 0, :null => false
t.integer "onlinetime", :default => 0, :null => false
t.integer "credits", :default => 0, :null => false
t.integer "credit1", :default => 0, :null => false
t.integer "credit2", :default => 0, :null => false
t.integer "credit3", :default => 0, :null => false
t.integer "credit4", :default => 0, :null => false
t.integer "credit5", :default => 0, :null => false
t.integer "credit6", :default => 0, :null => false
t.integer "credit7", :default => 0, :null => false
t.integer "credit8", :default => 0, :null => false
t.integer "win", :default => 0, :null => false
t.integer "lost", :default => 0, :null => false
t.integer "role_id", :default => 5, :null => false
t.boolean "locked", :default => false, :null => false
t.string "regip", :default => "", :null => false
t.string "lastloginip", :default => "", :null => false
t.integer "viewnum", :default => 0, :null => false
t.integer "onlinetime", :default => 0, :null => false
t.string "locale"
t.string "theme"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "avatar_file_name"
t.string "avatar_content_type"
t.integer "avatar_file_size"
t.datetime "avatar_updated_at"
t.string "encrypted_password", :default => "", :null => false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_count", :default => 0
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
end
add_index "users", ["email"], :name => "index_users_on_email"
add_index "users", ["name"], :name => "index_users_on_name"
add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment