From 001a3796c74379be586b1cc78032f6cd4fd9e3b1 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 24 Mar 2017 15:05:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E7=9B=AE=E5=BD=95=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 3 ++- app/views/games/_myshixun_breadcrumbs.html.erb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index bbb6c285b..c20c44d6e 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -23,8 +23,9 @@ class GamesController < ApplicationController game_path = @game.path @rev = @rev.nil? ? "master" : @rev @git_url = git_repository_url(@myshixun, "Myshixun") + @type = params[:type] # 默认打开文件 - if @path == "" && !game_path.nil? && !@repository.cat(game_path, @rev).blank? + if @path == "" && !game_path.nil? && !@repository.cat(game_path, @rev).blank? && @type != "root" @path = game_path @file_open = true @content = @repository.cat(@path, @rev) diff --git a/app/views/games/_myshixun_breadcrumbs.html.erb b/app/views/games/_myshixun_breadcrumbs.html.erb index 5e9e01b87..a41bb3947 100644 --- a/app/views/games/_myshixun_breadcrumbs.html.erb +++ b/app/views/games/_myshixun_breadcrumbs.html.erb @@ -2,7 +2,7 @@ <% if @path.blank? %> <%= @repository.identifier %> <% else %> - <%= link_to "#{@repository.identifier.present? ? h(@repository.identifier) : 'root'}", myshixun_game_path(@game, :myshixun_id => @myshixun) %> + <%= link_to "#{@repository.identifier.present? ? h(@repository.identifier) : 'root'}", myshixun_game_path(@game, :myshixun_id => @myshixun, :type => "root"), :remote => true %> <% dirs = path.split('/') if 'file' == kind