submodules displayed for tree view
This commit is contained in:
parent
c062e56b4c
commit
a7bcc2eb5c
8 changed files with 38 additions and 9 deletions
13
app/views/refs/_submodule_item.html.haml
Normal file
13
app/views/refs/_submodule_item.html.haml
Normal file
|
@ -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
|
||||
|
||||
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue