Commit 3f0d8079557e573871cbb1b62e0f90e4e34853f9

Authored by gitlabhq
1 parent a59b7090

file name overflow fixed

app/assets/stylesheets/projects.css.scss
@@ -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
385 385
386 body.project-page .team_member_new .span-6, .team_member_edit .span-6{ padding:10px 0; } 386 body.project-page .team_member_new .span-6, .team_member_edit .span-6{ padding:10px 0; }
387 387
  388 +body.projects-page input.text.git-url.project_list_url { width:165px; }
app/decorators/tree_decorator.rb
@@ -6,6 +6,8 @@ class TreeDecorator < ApplicationDecorator @@ -6,6 +6,8 @@ class TreeDecorator < ApplicationDecorator
6 part_path = "" 6 part_path = ""
7 parts = path.split("\/") 7 parts = path.split("\/")
8 8
  9 + parts = parts[0...-1] if is_blob?
  10 +
9 yield(h.link_to("..", "#", :remote => :true)) if parts.count > max_links 11 yield(h.link_to("..", "#", :remote => :true)) if parts.count > max_links
10 12
11 parts.each do |part| 13 parts.each do |part|
app/models/tree.rb
@@ -22,4 +22,8 @@ class Tree @@ -22,4 +22,8 @@ class Tree
22 def is_blob? 22 def is_blob?
23 tree.is_a?(Grit::Blob) 23 tree.is_a?(Grit::Blob)
24 end 24 end
  25 +
  26 + def empty?
  27 + data.blank?
  28 + end
25 end 29 end
app/views/layouts/project.html.haml
@@ -46,6 +46,9 @@ @@ -46,6 +46,9 @@
46 - if @commit 46 - if @commit
47 = 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 47 = 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
48 48
  49 + - if can? current_user, :admin_project, @project
  50 + = link_to "Edit", edit_project_path(@project), :class => (current_page?(edit_project_path(@project))) ? "current" : nil
  51 +
49 .medium-tags{:style => 'padding: 10px 0 0 10px; width: 210px;'}= tag_list @project 52 .medium-tags{:style => 'padding: 10px 0 0 10px; width: 210px;'}= tag_list @project
50 53
51 .project-content 54 .project-content
app/views/refs/_tree_file.html.haml
@@ -8,8 +8,12 @@ @@ -8,8 +8,12 @@
8 %br/ 8 %br/
9 - if file.text? 9 - if file.text?
10 .view_file_content 10 .view_file_content
11 - :erb  
12 - <%= raw file.colorize %> 11 + - unless file.empty?
  12 + :erb
  13 + <%= raw file.colorize %>
  14 + - else
  15 + %h3
  16 + %center Empty file
13 - elsif file.image? 17 - elsif file.image?
14 .view_file_content_image 18 .view_file_content_image
15 %img{ :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} 19 %img{ :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
app/views/snippets/index.html.haml
1 %div 1 %div
2 - if can? current_user, :write_snippet, @project 2 - if can? current_user, :write_snippet, @project
3 - = link_to 'New Snippet', new_project_snippet_path(@project), :class => "button append-bottom-10" 3 + = link_to 'New Snippet', new_project_snippet_path(@project), :class => "grey-button append-bottom-10"
4 4
5 %table.round-borders#snippets-table 5 %table.round-borders#snippets-table
6 %thead 6 %thead