2013-02-21 19:22:41 +00:00
|
|
|
- act = action_name.to_sym; contr = controller_name.to_sym; treeish = project.default_head(params[:treeish]); branch = @branch.try(:name) || project.default_head
|
2013-03-07 08:06:34 +00:00
|
|
|
-http_url = git_repo_url(project.name_with_owner)
|
|
|
|
-ssh_url = git_ssh_repo_url(project.name_with_owner)
|
2013-02-12 16:35:14 +00:00
|
|
|
#description-top
|
2012-04-24 17:36:52 +01:00
|
|
|
-if @commit
|
|
|
|
%ul.nav.zip
|
|
|
|
%li#menu-archive.dropdown
|
|
|
|
%a.dropdown-toggle{"data-toggle" => "dropdown", :href => "#menu-archive"}
|
|
|
|
=image_tag 'zip.png', :alt => 'ZIP'
|
|
|
|
%b.caret
|
|
|
|
%ul.dropdown-menu
|
2013-02-14 12:46:25 +00:00
|
|
|
- file_name = "#{@project.name}-#{treeish}"
|
2012-09-20 15:26:26 +01:00
|
|
|
%li=link_to "tar.gz", archive_path(project, file_name, 'tar.gz')
|
2012-09-19 20:29:36 +01:00
|
|
|
%li=link_to "zip", archive_path(project, file_name, 'zip')
|
2013-03-07 08:06:34 +00:00
|
|
|
.btn-group#clone-urls
|
|
|
|
%button.git-protocol-selector.btn{:value => 'http_url', :class => current_user ? '' : 'active'} HTTP
|
|
|
|
%button.git-protocol-selector.btn{:value => 'ssh_url', :class => current_user ? 'active' : ''} SSH
|
|
|
|
=hidden_field_tag :http_url, http_url
|
|
|
|
=hidden_field_tag :ssh_url, ssh_url
|
|
|
|
= text_field_tag :url, (current_user ? ssh_url : http_url), :class => 'name', :spellcheck => 'false', :readonly => true
|
2012-04-05 08:26:03 +01:00
|
|
|
.git_help ?
|
2012-03-31 11:27:20 +01:00
|
|
|
.role= can?(:write, project) ? t("layout.read_write_access") : t("layout.read_access")
|
2013-02-12 17:02:34 +00:00
|
|
|
= render 'branch_select', :project => project if act != :tags
|
|
|
|
.both
|
2012-04-05 08:26:03 +01:00
|
|
|
#git_help_data
|
2012-04-05 21:21:19 +01:00
|
|
|
%p= t("layout.projects.git_help.cloning") + ":"
|
|
|
|
%p
|
2013-03-07 08:06:34 +00:00
|
|
|
%p.http_url{:class => current_user ? 'hidden' : ''}~ "git clone #{http_url} #{project.name}"
|
|
|
|
%p.ssh_url{:class => current_user ? '' : 'hidden'}~ "git clone #{ssh_url} #{project.name}"
|
2012-04-05 21:21:19 +01:00
|
|
|
%p~ "cd #{project.name}"
|
|
|
|
%p
|
|
|
|
%p= t("layout.projects.git_help.remote") + ":"
|
|
|
|
%p
|
2013-03-07 08:06:34 +00:00
|
|
|
%p.http_url{:class => current_user ? 'hidden' : ''}~ "git remote add #{project.name} #{http_url}"
|
|
|
|
%p.ssh_url{:class => current_user ? '' : 'hidden'}~ "git remote add #{project.name} #{ssh_url}"
|
2012-04-05 21:21:19 +01:00
|
|
|
%p~ "git fetch #{project.name}"
|
|
|
|
%p~ "git checkout -b my-local-tracking-branch #{project.name}/master_or_other_branch"
|
2013-02-12 16:35:14 +00:00
|
|
|
.project-tabnav
|
|
|
|
%ul.tabnav-tabs
|
|
|
|
%li{:class => ('selected' if act == :show && contr == :trees )}
|
|
|
|
= link_to t('project_menu.files'), tree_path(project, treeish)
|
|
|
|
%li{:class => ('selected' if act == :index && contr == :commits )}
|
2013-02-13 12:56:36 +00:00
|
|
|
= link_to t('project_menu.commits'), commits_path(project, treeish)
|
2013-02-12 16:35:14 +00:00
|
|
|
%li{:class => ('selected' if act == :branches && contr == :trees )}
|
2013-02-21 19:22:41 +00:00
|
|
|
= link_to t('project_menu.branches', :count => project.repo.branches.count), branches_path(project, branch)
|
2013-02-12 16:35:14 +00:00
|
|
|
%li.tags{:class => ('selected' if act == :tags && contr == :trees )}
|
|
|
|
= link_to t('project_menu.tags', :count => project.repo.tags.count), tags_path(project)
|
2012-02-27 17:40:46 +00:00
|
|
|
.both
|
2012-03-12 14:46:11 +00:00
|
|
|
:javascript
|
|
|
|
$(document).ready(function() {
|
|
|
|
$('#url').live('click', function() {
|
|
|
|
$(this).select();
|
|
|
|
});
|
2012-03-31 11:27:20 +01:00
|
|
|
});
|