rosa-build/app/views/projects/base/_repo_block.html.haml

55 lines
2.8 KiB
Plaintext
Raw Normal View History

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
-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
-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
- 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')
%li=link_to "zip", archive_path(project, file_name, 'zip')
.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
.git_help ?
.role= can?(:write, project) ? t("layout.read_write_access") : t("layout.read_access")
= render 'branch_select', :project => project if act != :tags
.both
#git_help_data
2012-04-05 21:21:19 +01:00
%p= t("layout.projects.git_help.cloning") + ":"
%p
%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
%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)
.both
2012-03-12 14:46:11 +00:00
:javascript
$(document).ready(function() {
$('#url').live('click', function() {
$(this).select();
});
});