entry的时候加入language

This commit is contained in:
huang 2017-03-31 14:46:58 +08:00
parent e65400609e
commit e6777b0436
2 changed files with 7 additions and 3 deletions

View File

@ -7,6 +7,7 @@ class GamesController < ApplicationController
before_filter :find_repository, :only => [:show, :entry, :file_edit, :file_update] before_filter :find_repository, :only => [:show, :entry, :file_edit, :file_update]
before_filter :allowd_manager before_filter :allowd_manager
before_filter :allowd_view, :only => [:show, :game_build, :next_step, :change_status, :file_update] before_filter :allowd_view, :only => [:show, :game_build, :next_step, :change_status, :file_update]
before_filter :find_language, :only[:show, :entry]
include ApplicationHelper include ApplicationHelper
def index def index
@ -27,8 +28,6 @@ class GamesController < ApplicationController
@rev = @rev.nil? ? "master" : @rev @rev = @rev.nil? ? "master" : @rev
@git_url = git_repository_url(@myshixun, "Myshixun") @git_url = git_repository_url(@myshixun, "Myshixun")
@type = params[:type] @type = params[:type]
language = @myshixun.shixun.try(:language)
@language = language_switch(language)
# 默认打开文件 # 默认打开文件
if @path == "" && !game_path.nil? && !@repository.cat(game_path, @rev).blank? && @type != "root" if @path == "" && !game_path.nil? && !@repository.cat(game_path, @rev).blank? && @type != "root"
@path = game_path @path = game_path
@ -217,6 +216,11 @@ class GamesController < ApplicationController
render_403 if @game.status == 3 render_403 if @game.status == 3
end end
def find_language
language = @myshixun.shixun.try(:language)
@language = language_switch(language)
end
# Find myshixun of id params[:id] # Find myshixun of id params[:id]
def find_myshixun def find_myshixun
myshixun_id = params[:myshixun_id] || (params[:game] && params[:game][:myshixun_id]) myshixun_id = params[:myshixun_id] || (params[:game] && params[:game][:myshixun_id])

View File

@ -46,7 +46,7 @@
<h3 >操作</h3> <h3 >操作</h3>
</div> </div>
<div class="content-submitbox"> <div class="content-submitbox">
<a href="javascript:void(0)" class="task-btn task-btn-green mb10" style="display:none;" id="bottom_save_edit" onclick="file_edit_submit1()">保存修改</a> <a href="javascript:void(0)" class="task-btn task-btn-green mb10" id="bottom_save_edit" onclick="file_edit_submit1()">保存修改</a>
<! if(status == 0){ !> <! if(status == 0){ !>
<div id="game_commit"> <div id="game_commit">
<a href="javascript:void(0)" class="task-btn task-btn-green" onclick="training_task_submmit();">提交评测</a> <a href="javascript:void(0)" class="task-btn task-btn-green" onclick="training_task_submmit();">提交评测</a>