Commit 3f0d8079 authored by gitlabhq's avatar gitlabhq

file name overflow fixed

parent a59b7090
...@@ -385,3 +385,4 @@ body.dashboard.project-page .news-feed .project-updates a.project-update span.up ...@@ -385,3 +385,4 @@ body.dashboard.project-page .news-feed .project-updates a.project-update span.up
body.project-page .team_member_new .span-6, .team_member_edit .span-6{ padding:10px 0; } body.project-page .team_member_new .span-6, .team_member_edit .span-6{ padding:10px 0; }
body.projects-page input.text.git-url.project_list_url { width:165px; }
...@@ -6,6 +6,8 @@ class TreeDecorator < ApplicationDecorator ...@@ -6,6 +6,8 @@ class TreeDecorator < ApplicationDecorator
part_path = "" part_path = ""
parts = path.split("\/") parts = path.split("\/")
parts = parts[0...-1] if is_blob?
yield(h.link_to("..", "#", :remote => :true)) if parts.count > max_links yield(h.link_to("..", "#", :remote => :true)) if parts.count > max_links
parts.each do |part| parts.each do |part|
......
...@@ -22,4 +22,8 @@ class Tree ...@@ -22,4 +22,8 @@ class Tree
def is_blob? def is_blob?
tree.is_a?(Grit::Blob) tree.is_a?(Grit::Blob)
end end
def empty?
data.blank?
end
end end
...@@ -46,6 +46,9 @@ ...@@ -46,6 +46,9 @@
- if @commit - if @commit
= link_to truncate(commit_name(@project,@commit), :length => 15), project_commit_path(@project, :id => @commit.id), :class => current_page?(:controller => "commits", :action => "show", :project_id => @project, :id => @commit.id) ? "current" : nil = link_to truncate(commit_name(@project,@commit), :length => 15), project_commit_path(@project, :id => @commit.id), :class => current_page?(:controller => "commits", :action => "show", :project_id => @project, :id => @commit.id) ? "current" : nil
- if can? current_user, :admin_project, @project
= link_to "Edit", edit_project_path(@project), :class => (current_page?(edit_project_path(@project))) ? "current" : nil
.medium-tags{:style => 'padding: 10px 0 0 10px; width: 210px;'}= tag_list @project .medium-tags{:style => 'padding: 10px 0 0 10px; width: 210px;'}= tag_list @project
.project-content .project-content
......
...@@ -8,8 +8,12 @@ ...@@ -8,8 +8,12 @@
%br/ %br/
- if file.text? - if file.text?
.view_file_content .view_file_content
- unless file.empty?
:erb :erb
<%= raw file.colorize %> <%= raw file.colorize %>
- else
%h3
%center Empty file
- elsif file.image? - elsif file.image?
.view_file_content_image .view_file_content_image
%img{ :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} %img{ :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
......
%div %div
- if can? current_user, :write_snippet, @project - if can? current_user, :write_snippet, @project
= link_to 'New Snippet', new_project_snippet_path(@project), :class => "button append-bottom-10" = link_to 'New Snippet', new_project_snippet_path(@project), :class => "grey-button append-bottom-10"
%table.round-borders#snippets-table %table.round-borders#snippets-table
%thead %thead
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment