diff --git a/app/assets/images/submodule.png b/app/assets/images/submodule.png new file mode 100644 index 0000000000000000000000000000000000000000..62a88cc619b1b7c21aeae765c5ac5b94cf3bff57 Binary files /dev/null and b/app/assets/images/submodule.png differ diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 6bd7cfc4a95f010961323d490cb7f166116b638e..d952033faa091cc68c39100a42b495ec36d437f6 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -234,12 +234,19 @@ img.lil_av { border-color:#ddd; h5 { - padding: 5px 10px; + padding: 0 10px; background:#f5f5f5; border-bottom: 1px solid #ccc; + @include round-borders-top(4px); + border-top:none; } li { padding:10px; + &:first-child { + @include round-borders-top(4px); + border-top:none; + } } + } diff --git a/app/assets/stylesheets/tree.scss b/app/assets/stylesheets/tree.scss index cacdaa66570a67f5121b69fe5d5a1e2be87d6343..b023dd77a9624e866d91b81bf75b6f8e84037881 100644 --- a/app/assets/stylesheets/tree.scss +++ b/app/assets/stylesheets/tree.scss @@ -144,3 +144,7 @@ table.highlighttable .linenodiv pre { background:#f5f5f5; } } + +.tree-commit-link { + color:#333; +} diff --git a/app/controllers/commits_controller.rb b/app/controllers/commits_controller.rb index 18f2758794e622e05b74a04ec3494dae8c5acfda..c7fcae3b79a5155b344f172120e456f006f8a025 100644 --- a/app/controllers/commits_controller.rb +++ b/app/controllers/commits_controller.rb @@ -28,6 +28,7 @@ class CommitsController < ApplicationController @notes = project.commit_notes(@commit).fresh.limit(20) @note = @project.build_commit_note(@commit) + @comments_allowed = true @line_notes = project.commit_line_notes(@commit) respond_to do |format| diff --git a/app/views/commits/_text_file.html.haml b/app/views/commits/_text_file.html.haml index 3058ee1d9bf0c3a8e989aa72a673381b7bc21b1d..a9b3f65aa815abc8c6984b5af2afaac2223c5e60 100644 --- a/app/views/commits/_text_file.html.haml +++ b/app/views/commits/_text_file.html.haml @@ -8,12 +8,14 @@ - else %td.old_line = link_to raw(type == "new" ? " " : line_old), "##{line_code}", :id => line_code - = link_to "", "#", :class => "line_note_link", "line_code" => line_code, :title => "Add note for this line" + - if @comments_allowed + = link_to "", "#", :class => "line_note_link", "line_code" => line_code, :title => "Add note for this line" %td.new_line= link_to raw(type == "old" ? " " : line_new) , "##{line_code}", :id => line_code %td.line_content{:class => "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line}  " - - - comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at).reverse - - unless comments.empty? - - comments.each do |note| - = render "notes/per_line_show", :note => note - - @line_notes.reject!{ |n| n == note } + + - if @comments_allowed + - comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at).reverse + - unless comments.empty? + - comments.each do |note| + = render "notes/per_line_show", :note => note + - @line_notes.reject!{ |n| n == note } diff --git a/app/views/refs/_submodule_item.html.haml b/app/views/refs/_submodule_item.html.haml new file mode 100644 index 0000000000000000000000000000000000000000..fc32c37b9a40c4dbe43d0530a7ef5f90c69af61d --- /dev/null +++ b/app/views/refs/_submodule_item.html.haml @@ -0,0 +1,13 @@ +- url = content.url(@ref) +- name = content.basename +- return unless url +%tr{ :class => "tree-item", :url => url } + %td.tree-item-file-name + = image_tag "submodule.png" + %strong= truncate(name, :length => 40) + %td + %code= content.id[0..10] + %td + = link_to truncate(url, :length => 40), url + + diff --git a/app/views/refs/_tree.html.haml b/app/views/refs/_tree.html.haml index d1fcc2958bf253f56e3005ac989a879fecc28422..e2360360ad8ae321864e2b68797df124c8b52703 100644 --- a/app/views/refs/_tree.html.haml +++ b/app/views/refs/_tree.html.haml @@ -39,6 +39,8 @@ = render :partial => "refs/tree_item", :locals => { :content => content } - contents.select{ |i| i.is_a?(Grit::Blob)}.each do |content| = render :partial => "refs/tree_item", :locals => { :content => content } + - contents.select{ |i| i.is_a?(Grit::Submodule)}.each do |content| + = render :partial => "refs/submodule_item", :locals => { :content => content } - if content = contents.select{ |c| c.is_a?(Grit::Blob) and c.name =~ /^readme/i }.first #tree-readme-holder diff --git a/app/views/refs/_tree_item.html.haml b/app/views/refs/_tree_item.html.haml index 73385514cd021c1d35a0bdeb073382835233293d..b5c29220da7435a5b4d1c8e9756424282d16e55c 100644 --- a/app/views/refs/_tree_item.html.haml +++ b/app/views/refs/_tree_item.html.haml @@ -15,4 +15,4 @@ - tm = @project.team_member_by_name_or_email(content_commit.author_email, content_commit.author_name) - if tm = link_to "[#{tm.user_name}]", project_team_member_path(@project, tm) - = link_to truncate(content_commit.safe_message, :length => tm ? 20 : 40), project_commit_path(@project, content_commit.id), :class => "tree-commit-link" + = link_to truncate(content_commit.safe_message, :length => tm ? 30 : 50), project_commit_path(@project, content_commit.id), :class => "tree-commit-link"