Further repo browser/Dolt integration work
[gitorious:mainline.git] / app / views / repositories / _overview.html.erb
1 <%
2   #--
3   #   Copyright (C) 2012 Gitorious AS
4   #   Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
5   #
6   #   This program is free software: you can redistribute it and/or modify
7   #   it under the terms of the GNU Affero General Public License as published by
8   #   the Free Software Foundation, either version 3 of the License, or
9   #   (at your option) any later version.
10   #
11   #   This program is distributed in the hope that it will be useful,
12   #   but WITHOUT ANY WARRANTY; without even the implied warranty of
13   #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   #   GNU Affero General Public License for more details.
15   #
16   #   You should have received a copy of the GNU Affero General Public License
17   #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
18   #++
19   %>
20
21 <% verbose ||= false %>
22
23 <div class="repository_meta">
24   <div class="repository-info">
25     <h3 <%= repository.mainline? ? "mainline" : "clone" -%>>
26       <% if verbose -%>
27         <%= link_to h(repository.project.to_param),
28             repository.project -%>
29         <% if repository.project.private? -%>
30           <%= image_tag("silk/lock.png", :class => "private_access") -%>
31         <% end -%>
32         <%= image_tag("silk/arrow_right.png") -%>
33       <% end -%>
34       <%= link_to h(repository.name), [repository.project, repository] -%>
35       <% if repository.private? -%>
36         <%= image_tag("silk/lock.png", :class => "private_access") -%>
37       <% end -%>
38     </h3>
39     <% unless repository.description.blank? -%>
40       <div class="repository-description page">
41         <%= paragraphs_with_more(render_markdown(repository.description, :auto_link),
42                                  repository.id) -%>
43       </div>
44     <% end -%>
45     <div class="infobox">
46       <%= render :partial => "repositories/clone_urls",
47           :locals => {:repository => repository} -%>
48
49     </div>
50     <% if verbose && repository.has_commits? && !repository.git.heads.blank? -%>
51       <div class="branches">
52         <ul class="branch_list">
53           <li><strong>Branches:</strong></li>
54           <%= render_chunked_branch_list_items(repository) -%>
55         </ul>
56       </div>
57       <% if repository.parent -%>
58         <div class="clone-of">
59           <ul class="clone-of_list">
60             <li><strong>Clone of:</strong></li>
61             <li class="head"><%= link_to "#{h(repository.parent.name)}",
62                                  [repository.parent.project, repository.parent] -%></li>
63           </ul>
64         </div>
65       <% end -%>
66     <% end -%>
67   </div> <!-- End of repository-description -->
68   <div class="repository-links">
69     <%= favorite_button(repository) -%>
70     <ul>
71       <li class="repository-link commit">
72         <%= link_to "Commit log",
73             [repository.project, repository, :commits] -%>
74       </li>
75       <li class="repository-link tree">
76         <%= link_to("Source tree", tree_url(RepositoryPresenter.new(repository).slug, repository.head.name)) -%>
77       </li>
78       <%- if repository.merge_requests_enabled? -%>
79         <li class="repository-link merge_requests">
80           <%= link_to("Merge requests <small>(#{repository.open_merge_requests.count})</small>".html_safe,
81                       [repository.project, repository, :merge_requests]) -%>
82         </li>
83       <%- end -%>
84
85       <% if repository.ready? -%>
86         <li class="repository-link clone_repository">
87           <%= link_to t("views.repos.btn_clone"), [:clone, repository.project, repository] -%>
88         </li>
89       <% end -%>
90     </ul>
91   </div>
92 </div>