根目录刷新显示页面

This commit is contained in:
huang 2017-03-24 15:05:44 +08:00
parent 27c34985ca
commit 001a3796c7
2 changed files with 3 additions and 2 deletions

View File

@ -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)

View File

@ -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