Blob of app/views/trees/show.html.erb (raw blob data)

1 <% @page_title = "Tree for #{@repository.name} in #{@project.title}" -%>
2 <h1>
3 Tree of <%= h(@repository.name) -%> repository in <%= h(@project.title) -%>
4 </h1>
5
6 <% content_for :submenu do -%>
7 <%= render :partial => "repositories/context_menu" -%>
8 <% end -%>
9
10 <%= breadcrumb_path(@repository.name) -%>
11
12 <% cache(tree_path(@commit.id, params[:path])) do -%>
13 <table class="listing tree">
14 <% @tree.contents.sort_by{|c| c.name.downcase}.each do |node| -%>
15 <tr class="<%= cycle("odd", "even") -%>">
16 <% if node.is_a? Grit::Tree -%>
17 <td class="node tree"><%= link_to h(node.basename) + "/", tree_path(params[:id], node.name) -%></td>
18 <% else -%>
19 <td class="node file"><%= link_to h(node.basename), blob_path(params[:id], node.name) -%></td>
20 <% end -%>
21 <% if last_commit = commit_for_tree_path(@repository, node.name) -%>
22 <td class="meta"><%= last_commit.committed_date.to_s(:short) -%></td>
23 <td class="meta commit_message">
24 <%= link_to truncate(h(last_commit.message), 75, "&hellip;"), commit_path(last_commit.id) -%>
25 </td>
26 <% else -%>
27 <td class="meta"></td>
28 <td class="meta commit_message"></td>
29 <% end -%>
30 </tr>
31 <% end -%>
32 </table>
33 <% end -%>
34 <% if logged_in? -%>
35 <p>
36 <small><%= link_to "Download as gzipped tarball", archive_tree_path(@commit.id) -%></small>
37 </p>
38 <% end -%>
39
40 <% content_for :sidebar do -%>
41 <h5>Branches:</h5>
42 <ul class="links">
43 <% @git.branches.sort{|a, b| a.name <=> b.name }.each do |branch| -%>
44 <li><%= link_to h(branch.name), tree_path(branch.name) -%></li>
45 <% end -%>
46 </ul>
47
48 <h5>Tags:</h5>
49 <ul class="links">
50 <% @git.tags.sort{|a, b| a.name <=> b.name }.each do |tag| -%>
51 <li><%= link_to h(tag.name), commit_path(tag.commit.id) -%></li>
52 <% end -%>
53 </ul>
54 <% end -%>