Better control placement on project page

This commit is contained in:
Dmitriy Zaporozhets 2013-07-09 17:44:35 +03:00
parent 5baac66992
commit f63cd42bab
2 changed files with 32 additions and 35 deletions

View file

@ -17,9 +17,28 @@
- if can? current_user, :download_code, @project
= link_to archive_project_repository_path(@project), class: "btn grouped" do
%i.icon-download-alt
Download
= link_to tags_project_repository_path(@project), class: "btn grouped only-wide", title: 'Git Tags' do
%i.icon-tags
Tags
%span.only-wide Download
.dropdown.pull-right
%a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"}
%i.icon-plus-sign-alt
%span.only-wide New
%b.caret
%ul.dropdown-menu
- if @project.issues_enabled && can?(current_user, :write_issue, @project)
%li
= link_to url_for_new_issue, title: "New Issue" do
Issue
- if @project.merge_requests_enabled && can?(current_user, :write_merge_request, @project)
%li
= link_to new_project_merge_request_path(@project), title: "New Merge Request" do
Merge Request
- if @project.snippets_enabled && can?(current_user, :write_snippet, @project)
%li
= link_to new_project_snippet_path(@project), title: "New Snippet" do
Snippet
- if can?(current_user, :admin_team_member, @project)
%li.divider
%li
= link_to new_project_team_member_path(@project), title: "New Team member" do
Team member

View file

@ -7,29 +7,6 @@
.loading.hide
.span3
.light-well
.dropdown.pull-right
%a.dropdown-toggle.btn.btn-small{href: '#', "data-toggle" => "dropdown"}
%i.icon-plus-sign-alt
%b.caret
%ul.dropdown-menu
- if @project.issues_enabled && can?(current_user, :write_issue, @project)
%li
= link_to url_for_new_issue, title: "New Issue" do
Issue
- if @project.merge_requests_enabled && can?(current_user, :write_merge_request, @project)
%li
= link_to new_project_merge_request_path(@project), title: "New Merge Request" do
Merge Request
- if @project.snippets_enabled && can?(current_user, :write_snippet, @project)
%li
= link_to new_project_snippet_path(@project), title: "New Snippet" do
Snippet
- if can?(current_user, :admin_team_member, @project)
%li.divider
%li
= link_to new_project_team_member_path(@project), title: "New Team member" do
Team member
%h3.page_title
= @project.name
- if @project.description.present?
@ -55,15 +32,16 @@
Forked from:
= link_to @project.forked_from_project.name_with_namespace, project_path(@project.forked_from_project)
%hr
%p
= link_to pluralize(@repository.round_commit_count, 'commit'), project_commits_path(@project, @ref || @repository.root_ref)
%p
= link_to pluralize(@repository.branch_names.count, 'branch'), project_repository_path(@project)
%p
= link_to pluralize(@repository.tag_names.count, 'tag'), tags_project_repository_path(@project)
- if @project.gitlab_ci?
%hr
= link_to @project.gitlab_ci_service.builds_path do
= image_tag @project.gitlab_ci_service.status_img_path, alt: "build status"
%hr
%p
= link_to pluralize(@repository.round_commit_count, 'commit'), project_commits_path(@project)
%p
= link_to pluralize(@repository.branch_names.count, 'branch'), project_repository_path(@project)
%p
= link_to pluralize(@repository.tag_names.count, 'tag'), tags_project_repository_path(@project)