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
GaiaXalter
Ygopro Arena Web
Commits
b27d9fd4
Commit
b27d9fd4
authored
Mar 28, 2012
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
战网部分样式HTML规范化
parent
6a349380
Changes
26
Show whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
411 additions
and
360 deletions
+411
-360
app/assets/images/common/Thumbs.db
app/assets/images/common/Thumbs.db
+0
-0
app/assets/images/common/banner.fla
app/assets/images/common/banner.fla
+0
-0
app/assets/images/common/banner.psd
app/assets/images/common/banner.psd
+0
-0
app/assets/images/common/banner.swf
app/assets/images/common/banner.swf
+0
-0
app/assets/images/magics/Thumbs.db
app/assets/images/magics/Thumbs.db
+0
-0
app/assets/images/topic/Thumbs.db
app/assets/images/topic/Thumbs.db
+0
-0
app/assets/javascripts/ygo.js
app/assets/javascripts/ygo.js
+3
-5
app/assets/stylesheets/images/Thumbs.db
app/assets/stylesheets/images/Thumbs.db
+0
-0
app/assets/stylesheets/ygo.css
app/assets/stylesheets/ygo.css
+0
-6
app/controllers/cards_controller.rb
app/controllers/cards_controller.rb
+8
-1
app/controllers/duels_controller.rb
app/controllers/duels_controller.rb
+126
-125
app/controllers/mycard_controller.rb
app/controllers/mycard_controller.rb
+9
-0
app/controllers/users_controller.rb
app/controllers/users_controller.rb
+7
-7
app/models/duel.rb
app/models/duel.rb
+3
-0
app/views/cards/index.html.erb
app/views/cards/index.html.erb
+0
-3
app/views/duels/index.html.erb
app/views/duels/index.html.erb
+49
-46
app/views/duels/show.html.erb
app/views/duels/show.html.erb
+66
-73
app/views/entries/_action.html.erb
app/views/entries/_action.html.erb
+2
-4
app/views/layouts/ygo.html.erb
app/views/layouts/ygo.html.erb
+28
-3
app/views/users/_record.html.erb
app/views/users/_record.html.erb
+4
-4
app/views/users/index.html.erb
app/views/users/index.html.erb
+39
-16
app/views/users/new.html.erb
app/views/users/new.html.erb
+5
-0
app/views/users/show.html.erb
app/views/users/show.html.erb
+59
-66
config/routes.rb
config/routes.rb
+2
-0
public/assets/Thumbs.db
public/assets/Thumbs.db
+0
-0
public/index.html
public/index.html
+1
-1
No files found.
app/assets/images/common/Thumbs.db
deleted
100644 → 0
View file @
6a349380
File deleted
app/assets/images/common/banner.fla
0 → 100644
View file @
b27d9fd4
File added
app/assets/images/common/banner.psd
0 → 100644
View file @
b27d9fd4
File added
app/assets/images/common/banner.swf
View file @
b27d9fd4
No preview for this file type
app/assets/images/magics/Thumbs.db
deleted
100644 → 0
View file @
6a349380
File deleted
app/assets/images/topic/Thumbs.db
deleted
100644 → 0
View file @
6a349380
File deleted
app/assets/javascripts/ygo.js
View file @
b27d9fd4
$
(
document
).
ready
(
function
(){
$
(
'
.main1
'
).
show
(
500
);
})
function
test
(){
}
\ No newline at end of file
$
(
document
).
ready
(
function
(){
$
(
'
#main
'
).
show
(
500
);
})
\ No newline at end of file
app/assets/stylesheets/images/Thumbs.db
deleted
100644 → 0
View file @
6a349380
File deleted
app/assets/stylesheets/ygo.css
View file @
b27d9fd4
body
{
background
:
url(http://sh.convnet.net:7955/images/duel%20ranking.jpg)
no-repeat
top
center
#000000
;
margin
:
0px
;
font-size
:
14px
;
color
:
white
}
\ No newline at end of file
app/controllers/cards_controller.rb
View file @
b27d9fd4
...
...
@@ -3,7 +3,14 @@ class CardsController < ApplicationController
# GET /cards
# GET /cards.json
def
index
if
params
[
:user_id
]
@user
=
User
.
find
params
[
:user_id
]
@cards
=
@user
.
cards
@actions
=
[
"YGO战网"
,
@user
,
"常用卡片"
]
else
@cards
=
Card
.
joins
(
:duel_user_cards
)
@actions
=
[
"YGO战网"
,
"卡片排行"
]
end
respond_to
do
|
format
|
format
.
html
# index.html.erb
...
...
app/controllers/duels_controller.rb
View file @
b27d9fd4
...
...
@@ -7,11 +7,12 @@ class DuelsController < ApplicationController
if
params
[
:user_id
]
@user
=
User
.
find
params
[
:user_id
]
@duels
=
@user
.
duels
@actions
=
[
"YGO战网"
,
@user
,
'对战列表'
]
else
@duels
=
Duel
@duels
=
Duel
.
where
(
true
)
@actions
=
[
"YGO战网"
,
'对战列表'
]
end
@duels
=
@duels
.
reverse_order
.
page
(
params
[
:page
])
@actions
=
[
@user
,
'对战明细'
]
respond_to
do
|
format
|
format
.
html
# index.html.erb
format
.
json
{
render
json:
@duels
}
...
...
@@ -22,7 +23,7 @@ class DuelsController < ApplicationController
# GET /duels/1.json
def
show
@duel
=
Duel
.
find
(
params
[
:id
])
@actions
=
[
"YGO战网"
,
'对战列表'
,
@duel
]
respond_to
do
|
format
|
format
.
html
# show.html.erb
format
.
json
{
render
json:
@duel
}
...
...
app/controllers/mycard_controller.rb
View file @
b27d9fd4
...
...
@@ -13,4 +13,13 @@ class MycardController < ApplicationController
format
.
json
{
render
json:
result
}
end
end
def
download
file
=
Dir
.
glob
(
'public/mycard/mycard-*-win32.7z'
).
last
if
file
file
=
File
.
basename
(
file
)
respond_to
do
|
format
|
format
.
html
{
redirect_to
"/mycard/
#{
file
}
"
}
end
end
end
end
\ No newline at end of file
app/controllers/users_controller.rb
View file @
b27d9fd4
...
...
@@ -9,7 +9,7 @@ class UsersController < ApplicationController
# GET /users.xml
def
index
@users
=
User
.
all
@actions
=
[
"YGO战网"
,
"用户排行"
]
respond_to
do
|
format
|
format
.
html
# index.html.erb
format
.
xml
{
render
:xml
=>
@users
}
...
...
@@ -20,17 +20,17 @@ class UsersController < ApplicationController
# GET /users/1.xml
def
show
@user
=
User
.
find
(
params
[
:id
])
@actions
=
[
@user
.
name
]
@actions
=
[
"YGO战网"
,
@user
]
respond_to
do
|
format
|
format
.
html
# show.html.erb
format
.
xml
{
render
:xml
=>
@user
}
#
format.xml { render :xml => @user }
end
end
# GET /users/new
# GET /users/new.xml
def
new
@actions
=
[
:register
]
@actions
=
[
"注册"
]
@user
=
User
.
new
respond_to
do
|
format
|
...
...
@@ -106,11 +106,11 @@ class UsersController < ApplicationController
end
end
def
login
@actions
=
[
:login
]
@actions
=
[
"登陆"
]
@user
=
User
.
new
end
def
login_do
@actions
=
[
:login
]
@actions
=
[
"登陆"
]
user
=
User
.
find_by_name
(
params
[
:user
][
:name
])
if
user
and
params
[
:user
][
:password
]
==
user
.
password
@user
=
user
...
...
@@ -135,7 +135,7 @@ class UsersController < ApplicationController
if
@user
session
[
:user_id
]
=
@user
.
id
@user
.
update_attribute
(
:lastloginip
,
request
.
remote_ip
)
format
.
html
{
redirect_to
(
:root
,
:notice
=>
'Login Successfully.'
)
}
format
.
html
{
redirect_to
(
@user
,
:notice
=>
'Login Successfully.'
)
}
format
.
xml
{
head
:ok
}
else
@user
=
User
.
new
(
params
[
:user
])
...
...
app/models/duel.rb
View file @
b27d9fd4
...
...
@@ -24,4 +24,7 @@ class Duel < ActiveRecord::Base
def
user2_extra
user_cards
(
user2
,
false
)
end
def
to_s
"决斗详情"
end
end
app/views/cards/index.html.erb
View file @
b27d9fd4
<h1>
热门卡排行
</h1>
<p>
<b>
常用怪兽:
</b>
<%=
render
@cards
.
main_monsters
.
top
(
10
)
%>
...
...
app/views/duels/index.html.erb
View file @
b27d9fd4
...
...
@@ -7,53 +7,56 @@
padding-top
:
10px
;
padding-buttom
:
10px
;
width
:
600px
;
text-align
:
center
;
}
#duels
{
width
:
600px
;
text-align
:
center
}
#duels
thead
{
line-height
:
25px
;
background-color
:
#1c1b1b
;
height
:
25px
;
color
:
#d6edff
;
font-weight
:
bold
;
}
#duels
tbody
{
line-height
:
25px
;
padding-top
:
3px
;
font-weight
:
bold
;}
#duels
.index
{
color
:
white
}
#duels
.win
{
color
:
#58db3e
}
#duels
.lose
{
color
:
red
}
#duels
.current
{
color
:
red
}
</style>
<div
align=
"center"
style=
"padding-top:150px; cursor:pointer;"
>
<div
align=
"right"
style=
"width:600px; font-size:30px; padding-bottom:20px; color:#ffcc66"
>
<%=
@user
.
name
%>
</div>
<div
style=
"width:750px; font-size:14px; padding-bottom:10px; line-height:40px; color:#ffcc66"
align=
"left"
><a
href=
"#"
style=
" color:#ffcc66"
>
YGO战网
</a>
>>
<%=
link_to
@user
.
name
,
@user
,
:style
=>
"color:#ffcc66"
%>
>>
<a
href=
""
style=
" color:#ffcc66"
>
对战列表
</a></div>
<div
style=
"width:600px; display:none; "
id=
"mian1"
class=
"main1"
>
<div
style=
"line-height:25px; background-color:#1c1b1b; height:25px; color:#d6edff; font-weight:bold; "
>
<div
style=
'width:50px; float:left;'
><em>
场次
</em></div>
<div
style=
'width:200px; float:left;'
><em>
对手
</em></div>
<div
style=
'width:100px; float:left;'
align=
'center'
><em>
胜负
</em></div>
<div
style=
'width:100px; float:left;'
align=
'center'
><em>
得分
</em></div>
<!--<div style='width:100px; float:left;' align='center'><em>战斗终分</em></div>-->
</div>
<!--这里的效率很低,待优化-->
<%
first_index
=
@user
.
duels
.
where
(
"id<=?"
,
@duels
.
to_enum
.
first
.
id
).
count
%>
<%# final_credits = Duels.where("id<=?",@duels.to_enum.first.id).sum %>
<table
id=
"duels"
>
<thead>
<tr>
<%
if
@user
%>
<th>
场次
</th>
<th>
对手
</th>
<th>
胜负
</th>
<th>
得分
</th>
<%
else
%>
<th>
场次
</th>
<th>
玩家1
</th>
<th>
玩家2
</th>
<th>
玩家1得分
</th>
<th>
玩家2得分
</th>
<%
end
%>
</tr>
</thead>
<tfoot>
<tr><td
colspan=
"7"
>
<%=
will_paginate
@duels
%>
</td></tr>
</tfoot>
<tbody>
<%
first_index
=
@user
.
duels
.
where
(
"id<=?"
,
@duels
.
to_enum
.
first
.
id
).
count
if
@user
%>
<!--这里的效率很低,待优化-->
<%
@duels
.
each_with_index
do
|
duel
,
index
|
%>
<div
style=
'clear:both;'
></div>
<div
style=
'line-height:25px; padding-top:3px; font-weight:bold; '
align=
'center'
>
<!--场次-->
<div
style=
'width:50px; float:left; color:white '
>
<%=
link_to
(
first_index
-
index
),
duel
,
:style
=>
"color:white"
%>
</div>
<!--对手-->
<div
style=
'width:200px; float:left; '
align=
'left'
>
<%
opponent
=
duel
.
user1
==
@user
?
duel
.
user2
:
duel
.
user1
%>
<%=
link_to
opponent
.
name
,
opponent
,
:style
=>
'color:#ffe793; text-decoration:none'
%>
</div>
<!--胜负-->
<div
style=
'width:100px; float:left; color:
<%
if
duel
.
winner
==
@user
%>
#58db3e
<%
else
%>
red
<%
end
%>
'
>
<%=
duel
.
winner
==
@user
?
"WIN"
:
"LOSE"
%>
</div>
<!--得分-->
<div
style=
'width:100px; float:left; color:
<%
if
duel
.
winner
==
@user
%>
#58db3e
<%
else
%>
red
<%
end
%>
'
>
<%=
duel
.
user1
==
@user
?
duel
.
user1_credits
:
duel
.
user2_credits
%>
</div>
<!--战斗终分-->
<!--<div style='width:100px; float:left; color:
<%
if
index
.
zero?
%>
red
<%
else
%>
#d6edff
<%
end
%>
; '>
<%#= final_credits %>
<%# final_credits -= duel.user1 == @user ? duel.user1_credits : duel.user2_credits %>
</div>-->
</div>
<tr>
<%
if
@user
%>
<td
class=
"index"
>
<%=
link_to
(
first_index
-
index
),
duel
%>
</td>
<td
class=
"user opponent"
>
<%
opponent
=
duel
.
user1
==
@user
?
duel
.
user2
:
duel
.
user1
%><%=
link_to
opponent
.
name
,
opponent
%>
</td>
<td
class=
"result
<%=
duel
.
winner
==
@user
?
"win"
:
"lose"
%>
"
>
<%=
duel
.
winner
==
@user
?
"WIN"
:
"LOSE"
%>
</td>
<td
class=
"credits
<%=
duel
.
winner
==
@user
?
"win"
:
"lose"
%>
"
>
<%=
duel
.
user1
==
@user
?
duel
.
user1_credits
:
duel
.
user2_credits
%>
</td>
<%
else
%>
<td
class=
"index"
>
<%=
link_to
duel
.
id
,
duel
%>
</td>
<td
class=
"user user1"
>
<%=
link_to
duel
.
user1
.
name
,
duel
.
user1
%>
</td>
<td
class=
"user user2"
>
<%=
link_to
duel
.
user2
.
name
,
duel
.
user2
%>
</td>
<td
class=
"credits user1
<%=
duel
.
winner
==
duel
.
user1
?
"win"
:
"lose"
%>
"
>
<%=
duel
.
user1_credits
%>
</td>
<td
class=
"credits user2
<%=
duel
.
winner
==
duel
.
user2
?
"win"
:
"lose"
%>
"
>
<%=
duel
.
user2_credits
%>
</td>
<%
end
%>
</div
>
</div
>
<div
style=
"clear:both"
/
>
<
div
align=
"center"
>
<%=
will_paginate
@duels
%>
</div>
</tr
>
<%
end
%
>
</tbody
>
<
/table
>
app/views/duels/show.html.erb
View file @
b27d9fd4
<div
id=
"replay"
>
录像下载
</div>
<style
type=
"text/css"
>
<!
--
...
...
@@ -36,12 +37,7 @@
}
}
</script>
<div
style=
"padding-top:150px; "
align=
"center"
>
<div
style=
"width:600px; font-size:30px; padding-bottom:10px; color:#ffcc66;font-weight: bold;"
align=
"right"
>
DUEL INFO
</div>
<div
style=
"width:750px; font-size:14px; padding-bottom:10px; line-height:40px; color:#ffcc66"
align=
"left"
><a
href=
"#"
style=
" color:#ffcc66"
>
YGO战网
</a>
>>
<a
href=
"#"
style=
" color:#ffcc66"
>
对战列表
</a>
>>
<%=
l
@duel
.
created_at
%>
<span
class=
"STYLE2"
><a
href=
"#"
style=
" color:#33CCFF"
>
录像下载
</a></span></div>
<div
style=
"color: white; width:750px;"
align=
"left"
>
<div
style=
"color: white; width:750px;"
align=
"left"
>
<div
class=
"user_act"
id=
"user1"
onClick=
"show(1)"
>
<%=
@duel
.
user1
.
name
%>
<%
if
@duel
.
winner
==
@duel
.
user1
%>
...
...
@@ -91,9 +87,9 @@
卡组未公开
<%
end
%>
</div>
</div>
<div
style=
"clear:both"
/>
<div
style=
"color: white; width:700px; "
align=
"left"
>
</div>
<div
style=
"clear:both"
/>
<div
style=
"color: white; width:700px; "
align=
"left"
>
<div
id=
"cards2"
>
<%
if
@duel
.
user2_public
or
@current_user
==
@duel
.
user2
%>
<p><b>
主卡组:
</b>
</p>
...
...
@@ -113,7 +109,4 @@
卡组未公开
<%
end
%>
</div>
</div>
<div
align=
"center"
></div>
</div>
\ No newline at end of file
app/views/entries/_action.html.erb
View file @
b27d9fd4
<div
id=
"action"
>
<%=
@site
%>
<%
@actions
.
each
do
|
action
|
%>
»
<%=
action
%
>
»
<span
class=
"action"
>
<%=
action
%>
</span
>
<%
end
%>
\ No newline at end of file
</div>
\ No newline at end of file
app/views/layouts/ygo.html.erb
View file @
b27d9fd4
<!DOCTYPE html>
<html>
<head>
<!--[if lte IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<title>
<%=
@site
.
name
%><%
if
@actions
&&
!
@actions
.
empty?
%>
-
<%=
@actions
.
last
.
respond_to?
(
:name
)
?
@actions
.
last
.
name
:
@actions
.
last
%>
<%
end
%>
</title>
<%#= stylesheet_link_tag 'application' %>
<%=
stylesheet_link_tag
'ygo'
%>
...
...
@@ -9,12 +10,36 @@
<%=
javascript_include_tag
'ygo'
%>
<%=
javascript_include_tag
params
[
:controller
]
%>
<%=
csrf_meta_tags
%>
<style>
body
{
background
:
url(http://sh.convnet.net:7955/images/duel%20ranking.jpg)
no-repeat
top
center
#000000
;
margin
:
0px
;
font-size
:
14px
;
color
:
white
}
a
:link
{
text-decoration
:
none
;
color
:
#ffcc66
;}
a
:visited
{
color
:
#ffcc66
;}
a
:hover
{
text-decoration
:
underline
}
nav
{
width
:
750px
;
font-size
:
14px
;
padding-bottom
:
10px
;
line-height
:
40px
;
color
:
#ffcc66
;
text-align
:
left
;
margin-left
:
auto
;
margin-right
:
auto
;}
nav
a
{
color
:
#ffcc66
}
#footer
{
line-height
:
50px
;
padding-top
:
20px
;
padding-bottom
:
10px
;
font-size
:
12px
;
color
:
#0099FF
;
clear
:
both
;
text-align
:
center
;
margin-left
:
auto
;
margin-right
:
auto
;}
#header
{
width
:
600px
;
margin-left
:
auto
;
margin-right
:
auto
;}
#title
{
width
:
600px
;
font-size
:
30px
;
padding-bottom
:
20px
;
color
:
#ffcc66
;
text-align
:
right
;
padding-top
:
150px
;}
#main
{
width
:
600px
;
margin-left
:
auto
;
margin-right
:
auto
;
;
display
:
none
;}
</style>
</head>
<body>
<div
id=
"body"
>
<header
id=
"header"
>
<div
id=
"title"
>
<%=
@actions
.
last
%>
</div>
</header>
<nav
id=
"actions"
>
<%=
render
'entries/action'
%>
</nav>
<div
id=
"main"
>
<%=
yield
%>
</div>
<div
style=
"clear:both"
/>
<div
style=
"line-height:50px; padding-top:20px; padding-bottom:10px; font-size:12px; color:#0099FF"
align=
"center"
>
YGO DULE BATTLENET
</div>
<footer
id=
"footer"
>
YGO DULE BATTLENET
</footer>
</body>
</html>
app/views/users/_record.html.erb
View file @
b27d9fd4
...
...
@@ -15,18 +15,18 @@
</div>
<!--胜率-->
<div
style=
'width:40px; float:left; color:#58db3e'
align=
'left'
>
<%=
user
.
win
.
zero?
&&
user
.
lost
.
zero?
?
0
:
user
.
win
*
100
/
(
user
.
win
+
user
.
lost
)
%>
%
</div>
<!--胜场-->
<div
style=
'width:30px; float:left; color:red'
align=
'right'
>
<%=
user
.
win
%>
</div>
<!--负场-->
<div
style=
'width:30px; float:left; color:blue'
align=
'right'
>
<%=
user
.
lost
%>
</div>
<!--详情-->
<div
style=
'width:100px; float:left; color:#dfc84b; font-weight:100; cursor:pointer'
>
<%=
link_to
'详情'
,
user
,
:style
=>
'color:#ffe793; text-decoration:none'
%>
, :style=>'color:#ffe793; text-decoration:none' %>
</div>
</div>
app/views/users/index.html.erb
View file @
b27d9fd4
<div
align=
"center"
style=
"padding-top:130px;"
>
<div
align=
"right"
style=
"width:600px; font-size:50px; padding-bottom:20px; color:#ffffff"
>
TOP10
</div>
<div
style=
"width:600px; display:none; "
id=
"mian1"
class=
"main1"
>
<div
style=
"line-height:25px; background-color:#1c1b1b; height:25px; color:#d6edff; font-weight:bold; "
>
<div
style=
'width:90px; float:left;'
><em>
名次
</em></div>
<div
style=
'width:200px; float:left;'
><em>
决斗者
</em></div>
<div
style=
'width:100px; float:left;'
align=
'center'
><em>
积分
</em></div>
<div
style=
'width:100px; float:left;'
align=
'center'
><em>
胜率/胜/负
</em></div>
<div
style=
'width:100px; float:left;'
align=
'center'
><em>
得分纪录
</em></div>
</div>
<style>
#users
{
width
:
600px
;
text-align
:
center
}
#users
thead
{
line-height
:
25px
;
background-color
:
#1c1b1b
;
height
:
25px
;
color
:
#d6edff
;
font-weight
:
bold
;}
#users
tbody
{
line-height
:
25px
;
padding-top
:
3px
;
font-weight
:
bold
;
}
#users
.index
{
color
:
#d6edff
}
#users
.name
a
{
color
:
#FFE793
}
#users
.credits
{
color
:
#FF6468
}
#users
.ratio
{
color
:
#58DB3E
;
text-align
:
right
}
#users
.win
{
color
:
red
;
text-align
:
right
}
#users
.lost
{
color
:
blue
;
text-align
:
right
}
#users
.show
a
{
color
:
#DFC84B
}
</style>
<table
id=
"users"
>
<thead>
<tr>
<th>
名次
</th>
<th>
决斗者
</th>
<th>
积分
</th>
<th
colspan=
"3"
>
胜率/胜/负
</th>
<th>
得分纪录
</th>
</tr>
</thead>
<tbody>
<%
top_users
=
User
.
order
(
:credits
).
reverse_order
.
limit
(
10
)
%>
<%
top_users
.
each_with_index
do
|
user
,
index
|
%>
<%=
render
:partial
=>
"record"
,
:locals
=>
{
:user
=>
user
,
:index
=>
index
}
%>
<%
end
%>
<%
if
logged?
&&
!
top_users
.
include?
(
@current_user
)
%>
<%=
render
:partial
=>
"record"
,
:locals
=>
{
:user
=>
@current_user
,
:index
=>
User
.
where
(
"credits>?"
,
@current_user
.
credits
).
count
}
%>
<%
top_users
+=
@current_user
%>
<%
my_index
=
User
.
where
(
"credits>=?"
,
@current_user
.
credits
).
count
%>
<%
end
%>
<%
top_users
.
each_with_index
do
|
user
,
index
|
%>
<tr>
<td
class=
"index"
>
<%=
user
==
@current_user
?
my_index
:
index
.
next
%>
</td>
<td
class=
"name"
>
<%=
link_to
user
.
name
,
user
%>
</td>
<td
class=
"credits"
>
<%=
user
.
credits
%>
</td>
<td
class=
"ratio"
>
<%=
user
.
win
.
zero?
&&
user
.
lost
.
zero?
?
0
:
user
.
win
*
100
/
(
user
.
win
+
user
.
lost
)
%>
%
</td>
<td
class=
"win"
>
<%=
user
.
win
%>
</td>
<td
class=
"lost"
>
<%=
user
.
lost
%>
</td>
<td
class=
"show"
>
<%=
link_to
'详情'
,
user
%>
</td>
</tr>
<%
end
%>
</
div>
</
div
>
</
tbody>
</
table
>
\ No newline at end of file
app/views/users/new.html.erb
View file @
b27d9fd4
...
...
@@ -19,6 +19,11 @@
background
:
-moz-linear-gradient
(
#58A2DA
,
#147EBD
);
background
:
-ms-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
;}
#title
{
display
:
none
}
#actions
{
display
:
none
}
#footer
{
display
:
none
}
#main
{
display
:
block
}
</style>
<script
type=
"text/javascript"
>
...
...
app/views/users/show.html.erb
View file @
b27d9fd4
<div
align=
"center"
style=
"padding-top:150px; cursor:pointer;"
>
<div
align=
"right"
style=
"width:600px; font-size:30px; padding-bottom:20px; color:#ffcc66"
>
<%=
@user
.
name
%>
</div>
<style>
#duels
{
width
:
600px
;
text-align
:
center
}
#duels
thead
{
line-height
:
25px
;
background-color
:
#1c1b1b
;
height
:
25px
;
color
:
#d6edff
;
font-weight
:
bold
;
}
#duels
tbody
{
line-height
:
25px
;
padding-top
:
3px
;
font-weight
:
bold
;}
#duels
.index
{
color
:
white
}
#duels
.win
{
color
:
#58db3e
}
#duels
.lose
{
color
:
red
}
#duels
.current
{
color
:
red
}
</style>
<div
style=
"color: white"
>
<p>
<div
id=
"duels"
>
胜
<%=
@user
.
wins
.
count
%>
:负
<%=
@user
.
losts
.
count
%>
总场次:
<%=
@user
.
duels
.
count
%>
</p>
</div>
<div
id=
"cards"
>
<p>
<b>
常用怪兽:
</b>
<%=
render
@user
.
cards
.
main_monsters
.
top
(
10
)
%>
...
...
@@ -22,48 +30,33 @@
<b>
常用陷阱:
</b>
<%=
render
@user
.
cards
.
traps
.
top
(
5
)
%>
</p>
</div>
</div>
<div
style=
"width:600px; display:none; "
id=
"mian1"
class=
"main1"
>
<div
style=
"line-height:25px; background-color:#1c1b1b; height:25px; color:#d6edff; font-weight:bold; "
>
<div
style=
'width:50px; float:left;'
><em>
场次
</em></div>
<div
style=
'width:200px; float:left;'
><em>
对手
</em></div>
<div
style=
'width:100px; float:left;'
align=
'center'
><em>
胜负
</em></div>
<div
style=
'width:100px; float:left;'
align=
'center'
><em>
得分
</em></div>
<div
style=
'width:100px; float:left;'
align=
'center'
><em>
战斗终分
</em></div>
</div>
<table
id=
"duels"
>
<thead>
<tr>
<th>
场次
</th>
<th>
对手
</th>
<th>
胜负
</th>
<th>
得分
</th>
<th>
战斗终分
</th>
</tr>
</thead>
<tfoot>
<tr>
<%=
link_to
"更多..."
,
{
:controller
=>
:duels
,
:action
=>
:index
,
:user_id
=>
@user
.
id
}
%>
</tr>
</tfoot>
<tbody>
<%
final_credits
=
@user
.
credits
%>
<%
@user
.
top_duels
(
20
).
each_with_index
do
|
duel
,
index
|
%>
<div
style=
'clear:both;'
></div>
<div
style=
'line-height:25px; padding-top:3px; font-weight:bold; '
align=
'center'
>
<!--场次-->
<div
style=
'width:50px; float:left; color:white '
>
<%=
link_to
(
@user
.
duels
.
count
-
index
),
duel
,
:style
=>
"color:white"
%>
</div>
<!--对手-->
<div
style=
'width:200px; float:left; '
align=
'left'
>
<%
opponent
=
duel
.
user1
==
@user
?
duel
.
user2
:
duel
.
user1
%>
<%=
link_to
opponent
.
name
,
opponent
,
:style
=>
'color:#ffe793; text-decoration:none'
%>
</div>
<!--胜负-->
<div
style=
'width:100px; float:left; color:
<%
if
duel
.
winner
==
@user
%>
#58db3e
<%
else
%>
red
<%
end
%>
'
>
<%=
duel
.
winner
==
@user
?
"WIN"
:
"LOSE"
%>
</div>
<!--得分-->
<div
style=
'width:100px; float:left; color:
<%
if
duel
.
winner
==
@user
%>
#58db3e
<%
else
%>
red
<%
end
%>
'
>
<%=
duel
.
user1
==
@user
?
duel
.
user1_credits
:
duel
.
user2_credits
%>
</div>
<!--战斗终分-->
<div
style=
'width:100px; float:left; color:
<%
if
index
.
zero?
%>
red
<%
else
%>
#d6edff
<%
end
%>
; '
>
<%=
final_credits
%>
<%
final_credits
-=
duel
.
user1
==
@user
?
duel
.
user1_credits
:
duel
.
user2_credits
%>
</div>
</div>
<tr>
<td
class=
"index"
>
<%=
link_to
(
@user
.
duels
.
count
-
index
),
duel
%>
</td>
<td
class=
"opponent"
>
<%
opponent
=
duel
.
user1
==
@user
?
duel
.
user2
:
duel
.
user1
%><%=
link_to
opponent
.
name
,
opponent
%>
</td>
<td
class=
"result
<%=
duel
.
winner
==
@user
?
"win"
:
"lose"
%>
"
>
<%=
duel
.
winner
==
@user
?
"WIN"
:
"LOSE"
%>
</td>
<td
class=
"credits
<%=
duel
.
winner
==
@user
?
"win"
:
"lose"
%>
"
>
<%=
duel
.
user1
==
@user
?
duel
.
user1_credits
:
duel
.
user2_credits
%>
</td>
<td
class=
"final_credits
<%=
"current"
if
index
.
zero?
%>
"
>
<%=
final_credits
%><%
final_credits
-=
duel
.
user1
==
@user
?
duel
.
user1_credits
:
duel
.
user2_credits
%>
</td>
</tr>
<%
end
%>
</div>
</div>
<div
style=
"clear:both"
></div>
<div
align=
"center"
>
<%=
link_to
"更多..."
,
{
:controller
=>
:duels
,
:action
=>
:index
,
:user_id
=>
@user
.
id
},
:style
=>
"color:white"
%>
</div>
\ No newline at end of file
</tbody>
</table>
config/routes.rb
View file @
b27d9fd4
...
...
@@ -2,6 +2,7 @@ MycardServerHttp::Application.routes.draw do
get
"rooms/index"
get
"mycard/update"
get
"mycard/download"
root
:to
=>
"boards#index"
...
...
@@ -12,6 +13,7 @@ MycardServerHttp::Application.routes.draw do
resources
:cards
resources
:users
do
resources
:duels
resources
:cards
end
resources
:boards
resources
:topics
...
...
public/assets/Thumbs.db
deleted
100644 → 0
View file @
6a349380
File deleted
public/index.html
View file @
b27d9fd4
...
...
@@ -5,7 +5,7 @@ mycard ygocore 服务器测试主页 <br />
<a
href=
"login"
>
用户登陆
</a>
<br
/>
<a
href=
"rooms"
>
在线大厅
</a>
<br
/>
<a
href=
"
downloads/mycard-0.4.5-win32.7z
"
>
mycard下载
</a>
<a
href=
"
mycard/download
"
>
mycard下载
</a>
<br
/><br
/><br
/>
以功能开发中,可能会出现程序出错、界面乱糟糟等情况 请自备氪金狗眼
<br
/>
<a
href=
"users"
>
用户排行
</a>
<br
/>
...
...
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