Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
Ygopro Arena Web
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Ygopro Arena Web
Commits
32987f78
Commit
32987f78
authored
Jun 30, 2012
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
在线大厅修复
parent
4eb9f0fb
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
284 additions
and
186 deletions
+284
-186
Rakefile
Rakefile
+2
-2
app/controllers/rooms_controller.rb
app/controllers/rooms_controller.rb
+42
-32
app/controllers/servers_controller.rb
app/controllers/servers_controller.rb
+6
-1
app/controllers/users_controller.rb
app/controllers/users_controller.rb
+2
-2
app/views/boards/index.html.erb
app/views/boards/index.html.erb
+120
-35
app/views/users/new.html.erb
app/views/users/new.html.erb
+110
-113
config/locales/zh-CN.yml
config/locales/zh-CN.yml
+2
-1
No files found.
Rakefile
View file @
32987f78
...
@@ -99,7 +99,7 @@ end
...
@@ -99,7 +99,7 @@ end
task
:refresh_user_pass
=>
:environment
do
task
:refresh_user_pass
=>
:environment
do
require
'cgi'
require
'cgi'
require
'open-uri'
require
'open-uri'
servers
=
Server
.
all
#where(:server_type => "ygopro")
servers
=
Server
.
where
(
:name
=>
:"ygopro-ocg"
)
#
all#where(:server_type => "ygopro")
users
=
[]
users
=
[]
User
.
all
.
each
do
|
user
|
User
.
all
.
each
do
|
user
|
if
user
.
password
.
nil?
if
user
.
password
.
nil?
...
@@ -115,7 +115,7 @@ task :refresh_user_pass => :environment do
...
@@ -115,7 +115,7 @@ task :refresh_user_pass => :environment do
out
=
"
#{
user
.
id
}
#{
user
.
name
}
"
out
=
"
#{
user
.
id
}
#{
user
.
name
}
"
servers
.
each
do
|
server
|
servers
.
each
do
|
server
|
url
=
server
.
register
.
gsub
/\{key\}|\{id\}|\{name\}|\{password\}|\{email\}/
,
'{key}'
=>
URI
.
encode_www_form_component
(
server
.
key
),
'{id}'
=>
URI
.
encode_www_form_component
(
user
.
id
),
'{name}'
=>
URI
.
encode_www_form_component
(
user
.
name
),
'{password}'
=>
URI
.
encode_www_form_component
(
user
.
password
),
'{email}'
=>
URI
.
encode_www_form_component
(
user
.
email
)
url
=
server
.
register
.
gsub
/\{key\}|\{id\}|\{name\}|\{password\}|\{email\}/
,
'{key}'
=>
URI
.
encode_www_form_component
(
server
.
key
),
'{id}'
=>
URI
.
encode_www_form_component
(
user
.
id
),
'{name}'
=>
URI
.
encode_www_form_component
(
user
.
name
),
'{password}'
=>
URI
.
encode_www_form_component
(
user
.
password
),
'{email}'
=>
URI
.
encode_www_form_component
(
user
.
email
)
open
(
url
){
|
f
|
out
<<
"
\t
"
+
f
.
read
}
rescue
p
$!
open
(
url
,
server
.
server_type
==
'ygopro'
?
'r:GBK'
:
'r'
){
|
f
|
out
<<
"
\t
"
+
f
.
read
.
encode
(
"UTF-8"
,
:undef
=>
:replace
,
:invalid
=>
:replace
)
}
rescue
p
$!
end
end
print
out
+
"
\n
"
print
out
+
"
\n
"
end
end
...
...
app/controllers/rooms_controller.rb
View file @
32987f78
#encoding: UTF-8
#encoding: UTF-8
class
RoomsController
<
ApplicationController
class
RoomsController
<
ApplicationController
require
'open-uri'
require
'open-uri'
layout
'losses'
layout
'losses'
def
index
def
index
@rooms
=
[]
@rooms
=
[]
@actions
=
[
"在线大厅"
]
@actions
=
[
"在线大厅"
]
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
# index.html.erb
format
.
html
# index.html.erb
format
.
json
do
format
.
json
do
Server
.
all
.
each_with_index
do
|
server
,
index
|
if
params
[
:server_id
]
open
(
"http://
#{
server
.
ip
}
:
#{
server
.
http_port
}
/?operation=getroomjson"
,
'r:GBK'
)
do
|
file
|
servers
=
Server
.
where
(
id:
params
[
:server_id
])
JSON
.
parse
(
file
.
read
.
encode
(
"UTF-8"
))[
"rooms"
].
each
do
|
r
|
else
room
=
{
id:
(
'A'
.
ord
+
index
).
chr
+
r
[
"roomid"
],
name:
r
[
"roomname"
],
status:
r
[
"istart"
].
to_sym
,
users:
[]}
servers
=
Server
.
where
(
server_type:
"ygopro"
)
r
[
"users"
].
each
do
|
u
|
end
if
u
[
"id"
]
==
"0"
servers
.
each_with_index
do
|
server
,
index
|
user
=
{
player:
u
[
"pos"
].
to_i
%
2
+
1
,
id:
0
,
name:
u
[
"name"
],
certified:
false
}
open
(
"
#{
server
.
index
}
/?operation=getroomjsondelphi"
)
do
|
file
|
else
JSON
.
parse
(
file
.
read
)[
"rooms"
].
each
do
|
r
|
user
=
User
.
find_by_name
(
u
[
"name"
])
room
=
{
id:
(
'A'
.
ord
+
index
).
chr
+
r
[
"roomid"
],
name:
decode
(
r
[
"roomname"
]),
status:
r
[
"istart"
].
to_sym
,
users:
[]}
user
=
{
player:
u
[
"pos"
].
to_i
%
2
+
1
,
id:
user
?
user
.
id
:
0
,
name:
u
[
"name"
],
certified:
true
}
r
[
"users"
].
each
do
|
u
|
end
if
u
[
"id"
]
==
"0"
room
[
:users
]
<<
user
user
=
{
player:
u
[
"pos"
].
to_i
%
2
+
1
,
id:
0
,
name:
decode
(
u
[
"name"
]),
certified:
false
}
end
else
@rooms
<<
room
user
=
User
.
find_by_name
(
u
[
"name"
])
end
user
=
{
player:
u
[
"pos"
].
to_i
%
2
+
1
,
id:
user
?
user
.
id
:
0
,
name:
decode
(
u
[
"name"
]),
certified:
true
}
end
end
end
room
[
:users
]
<<
user
render
json:
@rooms
end
end
@rooms
<<
room
end
end
end
end
end
end
render
json:
@rooms
end
end
end
private
def
decode
(
str
)
[
str
].
pack
(
'H*'
).
force_encoding
(
"UTF-16BE"
).
encode
(
"UTF-8"
,
:undef
=>
:replace
,
:invalid
=>
:replace
)
end
end
app/controllers/servers_controller.rb
View file @
32987f78
...
@@ -2,7 +2,12 @@ class ServersController < ApplicationController
...
@@ -2,7 +2,12 @@ class ServersController < ApplicationController
# GET /servers
# GET /servers
# GET /servers.json
# GET /servers.json
def
index
def
index
@servers
=
Server
.
all
if
params
[
:server_type
]
@servers
=
Server
.
where
(
server_type:
params
[
:server_type
])
else
@servers
=
Server
.
all
end
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
# index.html.erb
format
.
html
# index.html.erb
...
...
app/controllers/users_controller.rb
View file @
32987f78
...
@@ -70,7 +70,7 @@ class UsersController < ApplicationController
...
@@ -70,7 +70,7 @@ class UsersController < ApplicationController
if
!
@user
.
errors
.
any?
and
@user
.
save
if
!
@user
.
errors
.
any?
and
@user
.
save
remote_register
(
@user
,
@from
)
remote_register
(
@user
,
@from
)
session
[
:user_id
]
=
@user
.
id
session
[
:user_id
]
=
@user
.
id
format
.
html
{
redirect_to
(
params
[
:continue
].
blank?
?
@user
:
URI
.
escape
(
params
[
:continue
]
),
:notice
=>
'注册成功'
)
}
format
.
html
{
redirect_to
(
params
[
:continue
].
blank?
?
@user
:
params
[
:continue
].
gsub
(
/\{name\}|\{password\}/
,
'{name}'
=>
URI
.
encode_www_form_component
(
@user
.
name
),
'{password}'
=>
URI
.
encode_www_form_component
(
@user
.
password
)
),
:notice
=>
'注册成功'
)
}
format
.
xml
{
render
:xml
=>
@user
,
:status
=>
:created
,
:location
=>
@user
}
format
.
xml
{
render
:xml
=>
@user
,
:status
=>
:created
,
:location
=>
@user
}
else
else
format
.
html
{
render
:action
=>
"new"
}
format
.
html
{
render
:action
=>
"new"
}
...
@@ -139,7 +139,7 @@ class UsersController < ApplicationController
...
@@ -139,7 +139,7 @@ class UsersController < ApplicationController
session
[
:user_id
]
=
@user
.
id
session
[
:user_id
]
=
@user
.
id
@user
.
update_attribute
(
:lastloginip
,
request
.
remote_ip
)
@user
.
update_attribute
(
:lastloginip
,
request
.
remote_ip
)
remote_register
(
@user
)
remote_register
(
@user
)
format
.
html
{
redirect_to
(
params
[
:continue
].
blank?
?
@user
:
URI
.
escape
(
params
[
:continue
]
),
:notice
=>
'Login Successfully.'
)
}
format
.
html
{
redirect_to
(
params
[
:continue
].
blank?
?
@user
:
params
[
:continue
].
gsub
(
/\{name\}|\{password\}/
,
'{name}'
=>
URI
.
encode_www_form_component
(
@user
.
name
),
'{password}'
=>
URI
.
encode_www_form_component
(
@user
.
password
)
),
:notice
=>
'Login Successfully.'
)
}
format
.
json
{
render
json:
@user
}
format
.
json
{
render
json:
@user
}
else
else
@user
=
User
.
new
(
params
[
:user
])
@user
=
User
.
new
(
params
[
:user
])
...
...
app/views/boards/index.html.erb
View file @
32987f78
<div
id=
"wrap"
class=
"wrap s_clear"
>
<style>
<div
class=
"itemtitle s_clear"
>
.topic
{
<p
class=
"right boardcount"
>
float
:
left
;
<%=
t
'datetime.today'
%>
:
<em>
<%=
Post
.
today
.
count
%>
</em>
,
width
:
190px
;
<%=
t
'datetime.yesterday'
%>
:
<em>
<%=
Post
.
yesterday
.
count
%>
</em>
,
margin
:
2px
;
<%=
t
'stat.total'
%>
:
<em>
<%=
Post
.
count
%>
</em>
}
</p>
</div>
.posttop
{
<%=
render
@boards
%>
height
:
146px
;
overflow
:
hidden
;
<div
class=
"mainbox list"
>
}
<span
class=
"headactions"
>
<%=
image_tag
'common/collapsed_no.gif'
%>
</span>
<h3>
<%=
link_to
t
(
'forum.link'
),
links_path
%>
</h3>
.first
{
<div
id=
"forumlinks"
>
height
:
92px
;
<!--<div class="forumlinks">
}
<ul class="s_clear"><li><div class="forumlogo"><img src="http://www.touhou.cc/logo.gif" border="0" alt="东方幻想乡"></div><div class="forumcontent"><h5><a href="http://www.touhou.cc/bbs" target="_blank">东方幻想乡</a></h5><p>这里是幻想乡,一片充满生机和幸福的乐土.</p></div></li></ul>
</div>-->
<!--详细-->
.last
{
<div
class=
"forumimglink"
>
height
:
54px
;
<%=
render
@links
%>
}
</div>
<!--<div class="forumtxtlink">
.name
{
<ul class="s_clear">
//如何设置单行
<li><a href="http://www.sakuracountry.cn/" target="_blank" title="樱之国度">樱之国度</a></li><li><a href="http://www.awawh.com/bbs/" target="_blank" title="聚合网">聚合网</a></li><li><a href="http://www.thactclub.cn/bbs" target="_blank" title="TAC触手乡">TAC触手乡</a></li><li><a href="http://www.bilibili.us/" target="_blank" title="哔哩哔哩">哔哩哔哩</a></li><li><a href="http://www.moeloli.cn" target="_blank" title="萝莉学园">萝莉学园</a></li><li><a href="http://www.0ymt.net/" target="_blank" title="零乐漫坛">零乐漫坛</a></li><li><a href="http://www.fulifuli.org/" target="_blank" title="炮姐大逃杀">炮姐大逃杀</a></li><li><a href="http://www.hgacg.com/" target="_blank" title="后宫动漫论坛">后宫动漫论坛</a></li><li><a href="http://www.lv8n.com" target="_blank" title="中国本土同人联盟">中国本土同人联盟</a></li><li><a href="http://bbs.u17.com/" target="_blank" title="有妖气漫画论坛">有妖气漫画论坛</a></li><li><a href="http://www.touhou.cc/bbs/plugin.php?id=xh_forumlinks:forumlinks" target="_blank" title="点击申请">点击申请</a></li></ul>
}
</div>--><!--文字-->
</div>
#stat
{
</div>
float
:
right
;
clear
:
both
;
<div
class=
"mainbox list"
id=
"online"
>
}
<span
class=
"headactions"
><a
href=
"index.php?showoldetails=yes#online"
class=
"nobdr"
>
<%=
image_tag
'common/collapsed_yes.gif'
%>
</a></span>
.first
{
<h3>
overflow
:
hidden
;
<%=
render
'entries/onlineuser'
%>
}
</h3>
</div>
.topics
{
</div>
overflow
:
hidden
;
}
.avatar_small
{
float
:
left
;
}
</style>
<div
id=
"wrap"
class=
"wrap s_clear"
>
<div
id=
"stat"
>
<%=
t
'datetime.today'
%>
:
<em>
<%=
Post
.
today
.
count
%>
</em>
,
<%=
t
'datetime.yesterday'
%>
:
<em>
<%=
Post
.
yesterday
.
count
%>
</em>
,
<%=
t
'stat.total'
%>
:
<em>
<%=
Post
.
count
%>
</em>
</div>
<div>
最新帖子
</div>
<div
id=
"stream"
>
<ul
id=
"topics"
>
<%
Post
.
group
(
:topic_id
).
order
(
:created_at
).
reverse_order
.
limit
(
5
).
includes
(
:topic
).
each
do
|
post
|
%>
<li
class=
"topic"
>
<%
last_post
=
post
.
topic
.
posts
.
order
(
:id
).
last
%>
<div
class=
"post
<%=
' first'
if
last_post
!=
post
%>
"
>
<div
class=
"posttop"
>
<%=
image_tag
post
.
user
.
avatar
.
url
(
:small
),
width:
48
,
height:
48
,
class:
"avatar_small"
%>
<div>
<span
class=
"name"
>
<%=
link_to
post
.
topic
.
name
,
post
.
topic
%>
</span>
</div>
<div>
<span>
<%=
link_to
post
.
user
.
name
,
post
.
user
%>
</span>
<span>
<%=
distance_of_time_in_words_to_now
post
.
created_at
%>
<%=
t
'ago'
%>
</span>
</div>
<%=
post
.
content
%>
</div>
<div
class=
"postbottom"
>
</div>
</div>
<%
if
last_post
!=
post
%>
<%
post
=
last_post
%>
<div
class=
"post last"
>
<div
class=
"posttop last"
>
<%=
image_tag
post
.
user
.
avatar
.
url
(
:small
),
width:
48
,
height:
48
,
class:
"avatar_small"
%>
<div>
<span>
<%=
link_to
post
.
user
.
name
,
post
.
user
%>
</span>
<span>
<%=
distance_of_time_in_words_to_now
post
.
created_at
%>
<%=
t
'ago'
%>
</span>
</div>
<%=
post
.
content
%>
</div>
</div>
<%
end
%>
<span>
<%=
link_to
post
.
topic
.
category
.
name
,
post
.
topic
.
category
%>
</span>
<span>
回复:
<%=
post
.
topic
.
posts
.
count
%>
</span><span>
查看:
<%=
post
.
topic
.
viewnum
%>
</span>
</li>
<%
end
%>
</ul>
</div>
<div
class=
"itemtitle s_clear"
></div>
<%=
render
@boards
%>
<div
class=
"mainbox list"
>
<span
class=
"headactions"
>
<%=
image_tag
'common/collapsed_no.gif'
%>
</span>
<h3>
<%=
link_to
t
(
'forum.link'
),
links_path
%>
</h3>
<div
id=
"forumlinks"
>
<!--<div class="forumlinks">
<ul class="s_clear"><li><div class="forumlogo"><img src="http://www.touhou.cc/logo.gif" border="0" alt="东方幻想乡"></div><div class="forumcontent"><h5><a href="http://www.touhou.cc/bbs" target="_blank">东方幻想乡</a></h5><p>这里是幻想乡,一片充满生机和幸福的乐土.</p></div></li></ul>
</div>-->
<!--详细-->
<div
class=
"forumimglink"
>
<%=
render
@links
%>
</div>
<!--<div class="forumtxtlink">
<ul class="s_clear">
<li><a href="http://www.sakuracountry.cn/" target="_blank" title="樱之国度">樱之国度</a></li><li><a href="http://www.awawh.com/bbs/" target="_blank" title="聚合网">聚合网</a></li><li><a href="http://www.thactclub.cn/bbs" target="_blank" title="TAC触手乡">TAC触手乡</a></li><li><a href="http://www.bilibili.us/" target="_blank" title="哔哩哔哩">哔哩哔哩</a></li><li><a href="http://www.moeloli.cn" target="_blank" title="萝莉学园">萝莉学园</a></li><li><a href="http://www.0ymt.net/" target="_blank" title="零乐漫坛">零乐漫坛</a></li><li><a href="http://www.fulifuli.org/" target="_blank" title="炮姐大逃杀">炮姐大逃杀</a></li><li><a href="http://www.hgacg.com/" target="_blank" title="后宫动漫论坛">后宫动漫论坛</a></li><li><a href="http://www.lv8n.com" target="_blank" title="中国本土同人联盟">中国本土同人联盟</a></li><li><a href="http://bbs.u17.com/" target="_blank" title="有妖气漫画论坛">有妖气漫画论坛</a></li><li><a href="http://www.touhou.cc/bbs/plugin.php?id=xh_forumlinks:forumlinks" target="_blank" title="点击申请">点击申请</a></li></ul>
</div>--><!--文字-->
</div>
</div>
<div
class=
"mainbox list"
id=
"online"
>
<span
class=
"headactions"
><a
href=
"index.php?showoldetails=yes#online"
class=
"nobdr"
>
<%=
image_tag
'common/collapsed_yes.gif'
%>
</a></span>
<h3>
<%=
render
'entries/onlineuser'
%>
</h3>
</div>
</div>
app/views/users/new.html.erb
View file @
32987f78
<style
type=
"text/css"
>
<style
type=
"text/css"
>
.main_div
{
margin
:
50px
auto
10px
auto
;
padding
:
0
;
width
:
500px
;
height
:
340px
;
font-size
:
12px
;
font-family
:
微软雅黑
;
border-radius
:
5px
;
border
:
1px
solid
#eeeeee
;
.main_div
{
margin
:
50px
auto
10px
auto
;
padding
:
0
;
width
:
500px
;
height
:
340px
;
font-size
:
12px
;
font-family
:
微软雅黑
;
border-radius
:
5px
;
border
:
1px
solid
#eeeeee
;
-webkit-box-shadow
:
#999
0px
2px
3px
;
-moz-box-shadow
:
#999
0px
2px
3px
;
box-shadow
:
#999
0px
2px
3px
;
color
:
#999999
;
background
:
#FFFFFF
;
-webkit-box-shadow
:
#999
0px
2px
3px
;
-moz-box-shadow
:
#999
0px
2px
3px
;
box-shadow
:
#999
0px
2px
3px
;
color
:
#999999
;
background
:
#FFFFFF
;
position
:
absolute
;
left
:
50%
;
top
:
50%
;
margin-left
:
-250px
;
margin-top
:
-170px
;}
position
:
absolute
;
left
:
50%
;
top
:
50%
;
margin-left
:
-250px
;
margin-top
:
-170px
;}
.inner_div
{
margin
:
20px
0
5px
40px
;
letter-spacing
:
1px
;
float
:
left
;
clear
:
left
;}
.inner_div
{
margin
:
20px
0
5px
40px
;
letter-spacing
:
1px
;
float
:
left
;
clear
:
left
;}
body
{
background
:
#eeeeee
;}
.floatleft
{
float
:
left
;}
body
{
background
:
#eeeeee
;}
.floatleft
{
float
:
left
;}
.form_label
{
margin
:
4px
10px
0
0
;
padding
:
0
;
height
:
17px
;
width
:
65px
;
text-align
:
right
;
color
:
#666666
;}
.form_label
{
margin
:
4px
10px
0
0
;
padding
:
0
;
height
:
17px
;
width
:
65px
;
text-align
:
right
;
color
:
#666666
;}
.from_input
{
border
:
1px
solid
#CCCCCC
;
width
:
220px
;
height
:
20px
;
padding
:
2px
5px
;
border-radius
:
5px
;
box-shadow
:
0
1px
3px
rgba
(
0
,
0
,
0
,
0.05
)
inset
,
0
1px
0
#FFFFFF
;
.from_input
{
border
:
1px
solid
#CCCCCC
;
width
:
220px
;
height
:
20px
;
padding
:
2px
5px
;
border-radius
:
5px
;
box-shadow
:
0
1px
3px
rgba
(
0
,
0
,
0
,
0.05
)
inset
,
0
1px
0
#FFFFFF
;
-moz-box-shadow
:
0
1px
3px
rgba
(
0
,
0
,
0
,
0.05
)
inset
,
0
1px
0
#FFFFFF
;
-webkit-box-shadow
:
0
1px
3px
rgba
(
0
,
0
,
0
,
0.05
)
inset
,
0
1px
0
#FFFFFF
;
}
-moz-box-shadow
:
0
1px
3px
rgba
(
0
,
0
,
0
,
0.05
)
inset
,
0
1px
0
#FFFFFF
;
-webkit-box-shadow
:
0
1px
3px
rgba
(
0
,
0
,
0
,
0.05
)
inset
,
0
1px
0
#FFFFFF
;
}
.film_bit_download
{
margin
:
0
0
0
75px
;
border
:
1px
solid
#6DAFE3
;
cursor
:
pointer
;
text-shadow
:
0
-1px
0
rgba
(
0
,
0
,
0
,
0.25
);
font-weight
:
bold
;
.film_bit_download
{
margin
:
0
0
0
75px
;
border
:
1px
solid
#6DAFE3
;
cursor
:
pointer
;
text-shadow
:
0
-1px
0
rgba
(
0
,
0
,
0
,
0.25
);
font-weight
:
bold
;
background
:
#8CC0E8
;
background
:
#8CC0E8
;
background
:
-webkit-gradient
(
linear
,
0
0
,
0
bottom
,
from
(
#8CC0E8
),
to
(
#1494E1
));
background
:
-webkit-linear-gradient
(
#8CC0E8
,
#1494E1
);
background
:
-webkit-gradient
(
linear
,
0
0
,
0
bottom
,
from
(
#8CC0E8
),
to
(
#1494E1
));
background
:
-webkit-linear-gradient
(
#8CC0E8
,
#1494E1
);
background
:
-moz-linear-gradient
(
#8CC0E8
,
#1494E1
);
background
:
-ms-linear-gradient
(
#8CC0E8
,
#1494E1
);
background
:
-moz-linear-gradient
(
#8CC0E8
,
#1494E1
);
background
:
-ms-linear-gradient
(
#8CC0E8
,
#1494E1
);
background
:
-o-linear-gradient
(
#8CC0E8
,
#1494E1
);
background
:
linear-gradient
(
#8CC0E8
,
#1494E1
);}
background
:
-o-linear-gradient
(
#8CC0E8
,
#1494E1
);
background
:
linear-gradient
(
#8CC0E8
,
#1494E1
);}
.film_bit_download
:hover
{
background
:
#58A2DA
;
.film_bit_download
:hover
{
background
:
#58A2DA
;
background
:
-webkit-gradient
(
linear
,
0
0
,
0
bottom
,
from
(
#58A2DA
),
to
(
#147EBD
));
background
:
-webkit-linear-gradient
(
#58A2DA
,
#147EBD
);
background
:
-webkit-gradient
(
linear
,
0
0
,
0
bottom
,
from
(
#58A2DA
),
to
(
#147EBD
));
background
:
-webkit-linear-gradient
(
#58A2DA
,
#147EBD
);
background
:
-moz-linear-gradient
(
#58A2DA
,
#147EBD
);
background
:
-ms-linear-gradient
(
#58A2DA
,
#147EBD
);
background
:
-moz-linear-gradient
(
#58A2DA
,
#147EBD
);
background
:
-ms-linear-gradient
(
#58A2DA
,
#147EBD
);
background
:
-o-linear-gradient
(
#58A2DA
,
#147EBD
);
background
:
linear-gradient
(
#58A2DA
,
#147EBD
);}
background
:
-o-linear-gradient
(
#58A2DA
,
#147EBD
);
background
:
linear-gradient
(
#58A2DA
,
#147EBD
);}
.film_bit_download
:active
{
margin
:
1px
0
0
75px
;
-moz-box-shadow
:
none
;
-webkit-box-shadow
:
none
;
box-shadow
:
none
;}
.film_bit_download
:active
{
margin
:
1px
0
0
75px
;
-moz-box-shadow
:
none
;
-webkit-box-shadow
:
none
;
box-shadow
:
none
;}
#title
{
display
:
none
}
#title
{
display
:
none
}
#actions
{
display
:
none
}
#actions
{
display
:
none
}
#footer
{
display
:
none
}
#footer
{
display
:
none
}
#main
{
display
:
block
}
#main
{
display
:
block
}
#error_explanation
{
position
:
fixed
;
right
:
10px
;
top
:
50%
;
margin
:
-176px
0
0
0
;
z-index
:
10
;
color
:
#000000
;
border
:
3px
solid
#FF0066
;
border-radius
:
5px
;
background
:
#ffffff
;
width
:
310px
;
box-shadow
:
0px
2px
5px
#999999
;}
#error_explanation
{
position
:
fixed
;
right
:
10px
;
top
:
50%
;
margin
:
-176px
0
0
0
;
z-index
:
10
;
color
:
#000000
;
border
:
3px
solid
#FF0066
;
border-radius
:
5px
;
background
:
#ffffff
;
width
:
310px
;
box-shadow
:
0px
2px
5px
#999999
;}
#error_explanation
h2
{
background
:
#FF0066
;
margin
:
0
;
padding
:
4px
4px
4px
8px
;
font-size
:
14px
;
color
:
#ffffff
;
text-align
:
left
;
letter-spacing
:
0px
}
#error_explanation
h2
{
background
:
#FF0066
;
margin
:
0
;
padding
:
4px
4px
4px
8px
;
font-size
:
14px
;
color
:
#ffffff
;
text-align
:
left
;
letter-spacing
:
0px
}
#error_explanation
h4
{
margin
:
4px
0
0
4px
;
padding
:
4px
;
text-align
:
left
;
font-weight
:
normal
;
font-size
:
12px
;}
#error_explanation
h4
{
margin
:
4px
0
0
4px
;
padding
:
4px
;
text-align
:
left
;
font-weight
:
normal
;
font-size
:
12px
;}
#error_explanation
ul
{
padding
:
0
0
0
40px
;
text-align
:
left
;
font-size
:
12px
;}
#error_explanation
ul
{
padding
:
0
0
0
40px
;
text-align
:
left
;
font-size
:
12px
;}
.field_with_errors
label
{
color
:
#FF0066
;
text-shadow
:
1px
1px
5px
#cccccc
;
font-weight
:
bold
;}
.field_with_errors
label
{
color
:
#FF0066
;
text-shadow
:
1px
1px
5px
#cccccc
;
font-weight
:
bold
;}
.field_with_errors
input
{
border
:
1px
solid
#FF0066
;
box-shadow
:
1px
1px
5px
#999999
,
0px
0px
2px
#999999
inset
;}
.field_with_errors
input
{
border
:
1px
solid
#FF0066
;
box-shadow
:
1px
1px
5px
#999999
,
0px
0px
2px
#999999
inset
;}
</style>
</style>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
function
postOrder
()
{
function
postOrder
()
{
var
userNum
=
$
(
"
#username
"
).
val
().
length
;
var
userNum
=
$
(
"
#username
"
).
val
().
length
;
var
passNum
=
$
(
"
#password
"
).
val
().
length
;
var
passNum
=
$
(
"
#password
"
).
val
().
length
;
var
userVal
=
$
(
"
#username
"
).
val
();
var
userVal
=
$
(
"
#username
"
).
val
();
var
userspecial
=
userVal
.
search
(
/
[\$\=\ \,
\<
\>\[\]]
/
);
var
userspecial
=
userVal
.
search
(
/
[\$\=\ \,
\<
\>\[\]]
/
);
if
(
$
(
"
#username
"
).
val
()
==
""
||
$
(
"
#password
"
).
val
()
==
""
||
$
(
"
#rePassword
"
).
val
()
==
""
){
if
(
$
(
"
#username
"
).
val
()
==
""
||
$
(
"
#password
"
).
val
()
==
""
||
$
(
"
#rePassword
"
).
val
()
==
""
){
alert
(
"
请填写完整
"
);
alert
(
"
请填写完整
"
);
return
false
;
return
false
;
}
}
else
if
(
userspecial
!=
-
1
){
else
if
(
userspecial
!=
-
1
){
alert
(
"
用户名不能包含特殊字符
"
);
alert
(
"
用户名不能包含特殊字符
"
);
return
false
;
return
false
;
}
}
else
if
(
(
userNum
+
passNum
)
>
18
){
else
if
(
(
userNum
+
passNum
)
>
18
){
alert
(
"
用户名和密码长度总和不得超过18个字符
"
);
alert
(
"
用户名和密码长度总和不得超过18个字符
"
);
return
false
;
return
false
;
}
}
else
if
(
$
(
"
#password
"
).
val
()
!=
$
(
"
#rePassword
"
).
val
()){
else
if
(
$
(
"
#password
"
).
val
()
!=
$
(
"
#rePassword
"
).
val
()){
alert
(
"
两次密码输入不一致
"
);
alert
(
"
两次密码输入不一致
"
);
return
false
;
return
false
;
}
}
else
{
else
{
<%
if
@from
==
:"ygopro-ocg"
%>
return
true
;
$
(
"
#continue
"
).
val
(
"
http://ygopro-ocg.com/mycard.php?username=
"
+
$
(
"
#username
"
).
val
()
+
"
&password=
"
+
$
(
"
#password
"
).
val
());
}
<%
end
%>
}
return
true
;
</script>
}
}
<%=
form_for
(
@user
,
:html
=>
{
:onsubmit
=>
"return postOrder();"
})
do
|
f
|
%>
</script>
<%
if
@user
.
errors
.
any?
%>
<div
id=
"error_explanation"
>
<%=
form_for
(
@user
,
:html
=>
{
:onsubmit
=>
"return postOrder();"
})
do
|
f
|
%>
<h2>
<%=
t
'activerecord.errors.template.header'
,
:count
=>
@user
.
errors
.
size
,
:model
=>
@user
.
class
.
model_name
.
human
%>
</h2>
<%
if
@user
.
errors
.
any?
%>
<h4>
<%=
t
'activerecord.errors.template.body'
,
:count
=>
@user
.
errors
.
size
%>
</h4>
<div
id=
"error_explanation"
>
<ul>
<h2>
<%=
t
'activerecord.errors.template.header'
,
:count
=>
@user
.
errors
.
size
,
:model
=>
@user
.
class
.
model_name
.
human
%>
</h2>
<%
@user
.
errors
.
full_messages
.
each
do
|
msg
|
%>
<h4>
<%=
t
'activerecord.errors.template.body'
,
:count
=>
@user
.
errors
.
size
%>
</h4>
<li>
<%=
msg
%>
</li>
<ul>
<%
end
%>
<%
@user
.
errors
.
full_messages
.
each
do
|
msg
|
%>
</ul>
<li>
<%=
msg
%>
</li>
</div>
<%
end
%>
<%
end
%>
</ul>
</div>
<!--<p>用户注册说明:用户名和密码长度总和不得超过18个字符 ,用户名不得包含“$”以及“=” 号,否则无法登陆,其他无限制</p>-->
<%
end
%>
<div
class=
"main_div"
>
<!--<p>用户注册说明:用户名和密码长度总和不得超过18个字符 ,用户名不得包含“$”以及“=” 号,否则无法登陆,其他无限制</p>-->
<div
style=
"font-size:18px;margin:20px 0 10px 25px;padding:0 0 10px 0;border-bottom:1px solid #eeeeee;width:450px;"
>
<%=
t
User
.
human_attribute_name
:register
%>
</div>
<div
class=
"inner_div"
>
<div
class=
"main_div"
>
<div
class=
"floatleft form_label"
>
<%=
f
.
label
:name
%>
</div>
<div
style=
"font-size:18px;margin:20px 0 10px 25px;padding:0 0 10px 0;border-bottom:1px solid #eeeeee;width:450px;"
>
<%=
t
User
.
human_attribute_name
:register
%>
</div>
<div
class=
"floatleft"
>
<div
class=
"inner_div"
>
<%=
f
.
text_field
:name
,
:id
=>
:username
,
:class
=>
:from_input
%>
<div
class=
"floatleft form_label"
>
<%=
f
.
label
:name
%>
</div>
</div>
<div
class=
"floatleft"
>
</div>
<%=
f
.
text_field
:name
,
:id
=>
:username
,
:class
=>
:from_input
%>
<div
class=
"inner_div"
>
</div>
<div
class=
"floatleft form_label"
>
<%=
f
.
label
:password
%>
</div>
</div>
<div
class=
"floatleft"
>
<div
class=
"inner_div"
>
<%=
f
.
password_field
:password
,
:id
=>
:password
,
:class
=>
:from_input
%>
<div
class=
"floatleft form_label"
>
<%=
f
.
label
:password
%>
</div>
</div>
<div
class=
"floatleft"
>
</div>
<%=
f
.
password_field
:password
,
:id
=>
:password
,
:class
=>
:from_input
%>
<div
class=
"inner_div"
>
</div>
<div
class=
"floatleft form_label"
>
<%=
f
.
label
:password_repeat
%>
</div>
</div>
<div
class=
"floatleft"
>
<div
class=
"inner_div"
>
<%=
f
.
password_field
:password
,
:id
=>
:rePassword
,
:class
=>
:from_input
%>
<div
class=
"floatleft form_label"
>
<%=
f
.
label
:password_repeat
%>
</div>
</div>
<div
class=
"floatleft"
>
</div>
<%=
f
.
password_field
:password
,
:id
=>
:rePassword
,
:class
=>
:from_input
%>
<div
class=
"inner_div"
>
</div>
<div
class=
"floatleft form_label"
>
<%=
f
.
label
:email
%>
</div>
</div>
<div
class=
"floatleft"
>
<div
class=
"inner_div"
>
<%=
f
.
email_field
:email
,
:id
=>
:email
,
:class
=>
:from_input
%>
<div
class=
"floatleft form_label"
>
<%=
f
.
label
:email
%>
</div>
</div>
<div
class=
"floatleft"
>
</div>
<%=
f
.
email_field
:email
,
:id
=>
:email
,
:class
=>
:from_input
%>
<div
class=
"inner_div"
>
</div>
<%=
f
.
submit
:class
=>
"film_bit_download"
,
:style
=>
"width:54px;height:25px;padding:4px 14px;border:1px solid #eeeeee;border-radius:5px;color:#ffffff;"
%>
</div>
</div>
<div
class=
"inner_div"
>
<input
type=
"hidden"
name=
"continue"
id=
"continue"
value=
"
<%=
@continue
%>
"
/>
<%=
f
.
submit
:class
=>
"film_bit_download"
,
:style
=>
"width:54px;height:25px;padding:4px 14px;border:1px solid #eeeeee;border-radius:5px;color:#ffffff;"
%>
<input
type=
"hidden"
name=
"from"
value=
"
<%=
@from
%>
"
/>
</div>
</div>
<input
type=
"hidden"
name=
"continue"
id=
"continue"
value=
"
<%=
@continue
%>
"
/>
<%
end
%>
<input
type=
"hidden"
name=
"from"
value=
"
<%=
@from
%>
"
/>
</div>
<%
end
%>
config/locales/zh-CN.yml
View file @
32987f78
...
@@ -397,4 +397,5 @@ zh-CN:
...
@@ -397,4 +397,5 @@ zh-CN:
anonymous
:
"
匿名发帖"
anonymous
:
"
匿名发帖"
tournament
:
tournament
:
location
:
location
:
qun
:
"
QQ群"
qun
:
"
QQ群"
\ No newline at end of file
ago
:
"
前"
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment