Commit 22c18441 authored by 神楽坂玲奈's avatar 神楽坂玲奈

actions导航增强

parent 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
}
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;}
\ No newline at end of file
...@@ -6,10 +6,10 @@ class CardsController < ApplicationController ...@@ -6,10 +6,10 @@ class CardsController < ApplicationController
if params[:user_id] if params[:user_id]
@user = User.find params[:user_id] @user = User.find params[:user_id]
@cards = @user.cards @cards = @user.cards
@actions = ["YGO战网", @user, "常用卡片"] @actions = [{"YGO战网" => users_path}, @user, "常用卡片"]
else else
@cards = Card.joins(:duel_user_cards) @cards = Card.joins(:duel_user_cards)
@actions = ["YGO战网", "卡片排行"] @actions = [{"YGO战网" => users_path}, "卡片排行"]
end end
respond_to do |format| respond_to do |format|
...@@ -22,7 +22,7 @@ class CardsController < ApplicationController ...@@ -22,7 +22,7 @@ class CardsController < ApplicationController
# GET /cards/1.json # GET /cards/1.json
def show def show
@card = Card.find(params[:id]) @card = Card.find(params[:id])
@actions = [{"YGO战网" => users_path}, {"YGO战网" => cards_path}, @card]
respond_to do |format| respond_to do |format|
format.html # show.html.erb format.html # show.html.erb
format.json { render json: @card } format.json { render json: @card }
......
...@@ -7,10 +7,10 @@ class DuelsController < ApplicationController ...@@ -7,10 +7,10 @@ class DuelsController < ApplicationController
if params[:user_id] if params[:user_id]
@user = User.find params[:user_id] @user = User.find params[:user_id]
@duels = @user.duels @duels = @user.duels
@actions = ["YGO战网", @user, '对战列表'] @actions = [{"YGO战网" => users_path}, @user, '对战列表']
else else
@duels = Duel.where(true) @duels = Duel.where(true)
@actions = ["YGO战网", '对战列表'] @actions = [{"YGO战网" => users_path}, '对战列表']
end end
@duels = @duels.reverse_order.page(params[:page]) @duels = @duels.reverse_order.page(params[:page])
respond_to do |format| respond_to do |format|
...@@ -23,7 +23,7 @@ class DuelsController < ApplicationController ...@@ -23,7 +23,7 @@ class DuelsController < ApplicationController
# GET /duels/1.json # GET /duels/1.json
def show def show
@duel = Duel.find(params[:id]) @duel = Duel.find(params[:id])
@actions = ["YGO战网", '对战列表', @duel] @actions = [{"YGO战网" => users_path}, {'对战列表' => duels_path}, @duel]
respond_to do |format| respond_to do |format|
format.html # show.html.erb format.html # show.html.erb
format.json { render json: @duel } format.json { render json: @duel }
......
...@@ -9,7 +9,7 @@ class UsersController < ApplicationController ...@@ -9,7 +9,7 @@ class UsersController < ApplicationController
# GET /users.xml # GET /users.xml
def index def index
@users = User.all @users = User.all
@actions = ["YGO战网", "用户排行"] @actions = [{"YGO战网" => users_path}, "用户排行"]
respond_to do |format| respond_to do |format|
format.html # index.html.erb format.html # index.html.erb
format.xml { render :xml => @users } format.xml { render :xml => @users }
...@@ -20,7 +20,7 @@ class UsersController < ApplicationController ...@@ -20,7 +20,7 @@ class UsersController < ApplicationController
# GET /users/1.xml # GET /users/1.xml
def show def show
@user = User.find(params[:id]) @user = User.find(params[:id])
@actions = ["YGO战网", @user] @actions = [{"YGO战网" => users_path}, @user]
respond_to do |format| respond_to do |format|
format.html # show.html.erb format.html # show.html.erb
#format.xml { render :xml => @user } #format.xml { render :xml => @user }
......
...@@ -40,4 +40,7 @@ class Card < ActiveRecord::Base ...@@ -40,4 +40,7 @@ class Card < ActiveRecord::Base
def extra? def extra?
[:融合怪兽, :同调怪兽, :超量怪兽].include? card_type [:融合怪兽, :同调怪兽, :超量怪兽].include? card_type
end end
def to_s
name
end
end end
\ No newline at end of file
<div id="replay">录像下载</div> <div id="replay"><a href="#">录像下载</a></div>
<style type="text/css"> <style type="text/css">
<!-- <!--
......
<%= @site %> <%= @site %>
<% @actions.each do |action| %> <% @actions.each do |action| %>
&raquo; <span class="action"><%= action %></span> &raquo;
<span class="action">
<%= action.is_a?(Hash) ? link_to(action.keys[0], action.values[0]) : action %>
</span>
<% end %> <% end %>
\ No newline at end of file
...@@ -10,23 +10,6 @@ ...@@ -10,23 +10,6 @@
<%= javascript_include_tag 'ygo' %> <%= javascript_include_tag 'ygo' %>
<%= javascript_include_tag params[:controller] %> <%= javascript_include_tag params[:controller] %>
<%= csrf_meta_tags %> <%= 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> </head>
<body> <body>
<header id="header"> <header id="header">
......
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