diff --git a/app/assets/stylesheets/projects.css.scss b/app/assets/stylesheets/projects.css.scss index 5d0d4df7ad0c60107796bdef4960be6efde79703..029b8d3fbd71180d4a86745f5b26aab4aad087b6 100644 --- a/app/assets/stylesheets/projects.css.scss +++ b/app/assets/stylesheets/projects.css.scss @@ -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.projects-page input.text.git-url.project_list_url { width:165px; } diff --git a/app/decorators/tree_decorator.rb b/app/decorators/tree_decorator.rb index 8379006c94bd0b32f02fd937add19d3c0acba2ae..11af9724c0f2a09ade6a4add8ef88c30cc2e6857 100644 --- a/app/decorators/tree_decorator.rb +++ b/app/decorators/tree_decorator.rb @@ -6,6 +6,8 @@ class TreeDecorator < ApplicationDecorator part_path = "" parts = path.split("\/") + parts = parts[0...-1] if is_blob? + yield(h.link_to("..", "#", :remote => :true)) if parts.count > max_links parts.each do |part| diff --git a/app/models/tree.rb b/app/models/tree.rb index db9df1312f0fe13a9ae5a5b189afdbc4610344da..16b23a5e9d319f5dd4d5e6e03e84fbe62e1ed143 100644 --- a/app/models/tree.rb +++ b/app/models/tree.rb @@ -22,4 +22,8 @@ class Tree def is_blob? tree.is_a?(Grit::Blob) end + + def empty? + data.blank? + end end diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project.html.haml index bc019f38f087933150d1fed7b2b5a730bb3252d0..00955a450c1c08906da8fb881b3ff4294bddd114 100644 --- a/app/views/layouts/project.html.haml +++ b/app/views/layouts/project.html.haml @@ -46,6 +46,9 @@ - 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 + - 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 .project-content diff --git a/app/views/refs/_tree_file.html.haml b/app/views/refs/_tree_file.html.haml index b3a11e58ce63989ee6cdba3a5f0a31270197a745..86597706b57d126158d2f6a21d7c34f2c60c4219 100644 --- a/app/views/refs/_tree_file.html.haml +++ b/app/views/refs/_tree_file.html.haml @@ -8,8 +8,12 @@ %br/ - if file.text? .view_file_content - :erb - <%= raw file.colorize %> + - unless file.empty? + :erb + <%= raw file.colorize %> + - else + %h3 + %center Empty file - elsif file.image? .view_file_content_image %img{ :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} diff --git a/app/views/snippets/index.html.haml b/app/views/snippets/index.html.haml index c76107b9e2e94d6a63dc70a487a446ec142e3872..691ec6408a892d5ed149dfb7b1eca5afa213bb87 100644 --- a/app/views/snippets/index.html.haml +++ b/app/views/snippets/index.html.haml @@ -1,6 +1,6 @@ %div - 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 %thead