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