根目录刷新显示页面
This commit is contained in:
parent
27c34985ca
commit
001a3796c7
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue