From 8082bb456fdbd27ba6429e944671a076129ca501 Mon Sep 17 00:00:00 2001 From: huangjingquan Date: Sat, 12 Oct 2013 10:45:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E7=AB=9E=E8=B5=9B=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/bids_controller.rb | 52 +++++--- app/views/layouts/base_contest.html.erb | 159 ++++++++++++++++++++++++ config/locales/zh.yml | 1 + 3 files changed, 194 insertions(+), 18 deletions(-) create mode 100644 app/views/layouts/base_contest.html.erb diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index 499d90a92..d9cac4b58 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -195,11 +195,15 @@ class BidsController < ApplicationController format.html { render :layout => 'base_homework' } - else + elsif @bid.reward_type == 1 format.html { - render :layout => 'base_bids' - } - end + render :layout => 'base_bids' + } + else + format.html { + render :layout => 'base_contest' + } + end format.api end @@ -217,11 +221,15 @@ class BidsController < ApplicationController format.html { render :layout => 'base_homework' } - else + elsif @bid.reward_type == 1 format.html { - render :layout => 'base_bids' - } - end + render :layout => 'base_bids' + } + else + format.html { + render :layout => 'base_contest' + } + end format.api end @@ -251,14 +259,18 @@ class BidsController < ApplicationController end respond_to do |format| if @bid.reward_type == 3 + format.html { + render :layout => 'base_homework' + } + elsif @bid.reward_type == 1 format.html { - render :layout => 'base_homework' - } + render :layout => 'base_bids' + } else - format.html { - render :layout => 'base_bids' - } - end + format.html { + render :layout => 'base_contest' + } + end format.api end end @@ -279,11 +291,15 @@ class BidsController < ApplicationController format.html { render :layout => 'base_homework' } - else + elsif @bid.reward_type == 1 format.html { - render :layout => 'base_bids' - } - end + render :layout => 'base_bids' + } + else + format.html { + render :layout => 'base_contest' + } + end format.api end end diff --git a/app/views/layouts/base_contest.html.erb b/app/views/layouts/base_contest.html.erb new file mode 100644 index 000000000..719ac7d75 --- /dev/null +++ b/app/views/layouts/base_contest.html.erb @@ -0,0 +1,159 @@ + + + + + <%= h html_title %> + + + <%= csrf_meta_tag %> + <%= favicon %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', :media => 'all' %> + <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> + <%= javascript_heads %> + <%= heads_for_theme %> + <%= call_hook :view_layouts_base_html_head %> + + <%= yield :header_tags -%> + + +
+
+
+ + <% if session[:enterprise_college] == 2 %> + <%=render :partial => 'layouts/base_enterprise_header'%> + <% elsif session[:enterprise_college] == 1 %> + <%=render :partial => 'layouts/base_college_header'%> + <% else %> + <%=render :partial => 'layouts/base_header'%> + <% end %> + +
+ +
+ <% if display_main_menu?(@bid) %> +
+ <%= render_menu :bid_menu %> +
+ <% end %> + + <%= yield %> + <%= call_hook :view_layouts_base_content %> +
+
+ <%=render :partial => 'layouts/base_footer'%> +
+
+
+ + + + +
+ <%= call_hook :view_layouts_base_body_bottom %> + + diff --git a/config/locales/zh.yml b/config/locales/zh.yml index fefbebcce..bcfcd0476 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -511,6 +511,7 @@ zh: label_enterprise_into: 进入企业 label_college_into: 进入高校 label_investor: 投资人: + lable_contest_user: 竞赛发布人: #huang label_theme: 主题 label_logged_as_new: 当前用户 button_register: 注册