summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-05-09 23:43:15 +0200
committerDouwe Maan <douwe@gitlab.com>2015-05-12 10:27:17 +0200
commitbfe23847977376e3b89d98f17e0b3fd0fa2ddd77 (patch)
treea81e8fca05b9b6da35521a900660c0bd64099d83
parente9dff9f4103506d22a7044d2b721b74c4d0b510a (diff)
downloadgitlab-ce-bfe23847977376e3b89d98f17e0b3fd0fa2ddd77.tar.gz
Restructure project sidebar.
-rw-r--r--app/helpers/icons_helper.rb6
-rw-r--r--app/views/projects/_aside.html.haml140
2 files changed, 81 insertions, 65 deletions
diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb
index a9030729b48..a730684f8f3 100644
--- a/app/helpers/icons_helper.rb
+++ b/app/helpers/icons_helper.rb
@@ -26,15 +26,15 @@ module IconsHelper
end
def public_icon
- icon('globe')
+ icon('globe fw')
end
def internal_icon
- icon('shield')
+ icon('shield fw')
end
def private_icon
- icon('lock')
+ icon('lock fw')
end
def file_type_icon_class(type, mode, name)
diff --git a/app/views/projects/_aside.html.haml b/app/views/projects/_aside.html.haml
index 1241b51f9ac..8044906dbf4 100644
--- a/app/views/projects/_aside.html.haml
+++ b/app/views/projects/_aside.html.haml
@@ -1,85 +1,101 @@
.clearfix
- .append-bottom-20
- = render "shared/clone_panel"
-
- unless @project.empty_repo?
.well
%h4.visibility-level-label
= visibility_level_icon(@project.visibility_level)
= "#{visibility_level_label(@project.visibility_level).capitalize} project"
- %ul.nav.nav-pills
- %li= link_to pluralize(number_with_delimiter(@repository.commit_count), 'commit'), namespace_project_commits_path(@project.namespace, @project, @ref || @repository.root_ref)
- %li= link_to pluralize(number_with_delimiter(@repository.branch_names.count), 'branch'), namespace_project_branches_path(@project.namespace, @project)
- %li= link_to pluralize(number_with_delimiter(@repository.tag_names.count), 'tag'), namespace_project_tags_path(@project.namespace, @project)
-
- .actions
- = link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: @ref || @repository.root_ref), class: 'btn btn-sm' do
- %i.fa.fa-exchange
- Compare code
- - if can?(current_user, :download_code, @project)
- &nbsp;
- = render 'projects/repositories/download_archive', split_button: true, btn_class: 'btn-group-sm'
+ - if @repository.changelog || @repository.license || @repository.contribution_guide
+ %ul.nav.nav-pills
+ - if @repository.changelog
+ %li.hidden-xs
+ = link_to changelog_url(@project) do
+ = icon("list-alt fw")
+ Changelog
+ - if @repository.license
+ %li
+ = link_to license_url(@project) do
+ = icon("check-circle-o fw")
+ License
+ - if @repository.contribution_guide
+ %li
+ = link_to contribution_guide_url(@project) do
+ = icon("info-circle fw")
+ Contribution guide
- - unless @project.empty_repo?
- .well
- %h4 Contribute
- %ul.nav.nav-pills
- - if @repository.changelog
- %li.hidden-xs
- = link_to changelog_url(@project) do
- Changelog
- - if @repository.contribution_guide
- %li.hidden-xs
- = link_to contribution_guide_url(@project) do
- Contribution guide
- - if @repository.license
- %li
- = link_to license_url(@project) do
- License
.actions
- = link_to url_for_new_issue(@project, only_path: true), title: "New Issue", class: 'btn btn-sm' do
- %i.fa.fa-fw.fa-exclamation-circle
- New issue
+ - if can? current_user, :write_issue, @project
+ = link_to url_for_new_issue(@project, only_path: true), title: "New Issue", class: 'btn btn-sm append-right-10' do
+ = icon("exclamation-circle fw")
+ New Issue
- if can? current_user, :write_merge_request, @project
- &nbsp;
= link_to new_namespace_project_merge_request_path(@project.namespace, @project), class: "btn btn-sm", title: "New Merge Request" do
- %i.fa.fa-plus
+ = icon("plus fw")
New Merge Request
-
-
- - if @project.archived?
- .alert.alert-warning
+ - if version = @repository.version
+ .well
%h4
- %i.fa.fa-exclamation-triangle
- Archived project!
- %p Repository is read-only
+ = icon("clock-o fw")
+ Version
+ .pull-right
+ = link_to version_url(@project) do
+ = @repository.blob_by_oid(version.id).data
- - if @project.forked_from_project
+ - if forked_from_project = @project.forked_from_project
.well
%h4
+ = icon("code-fork fw")
Forked from
.pull-right
- = link_to @project.forked_from_project.namespace.try(:name), project_path(@project.forked_from_project)
+ = link_to forked_from_project.namespace.try(:name), project_path(forked_from_project)
+ - @project.ci_services.each do |ci_service|
+ - if ci_service.active? && ci_service.respond_to?(:builds_path)
+ .well
+ %h4
+ = icon("check fw")
+ = ci_service.title
+ .pull-right
+ - if ci_service.respond_to?(:status_img_path)
+ = link_to ci_service.builds_path, :'data-no-turbolink' => 'data-no-turbolink' do
+ = image_tag ci_service.status_img_path, alt: "build status"
+ - else
+ = link_to 'view builds', ci_service.builds_path, :'data-no-turbolink' => 'data-no-turbolink'
-- if version = @repository.version
- .well
- %h4
- Version
- .pull-right
- = link_to version_url(@project) do
- = @repository.blob_by_oid(version.id).data
-
-- @project.ci_services.each do |ci_service|
- - if ci_service.active? && ci_service.respond_to?(:builds_path)
+ - unless @project.empty_repo?
.well
%h4
- = ci_service.title
- .pull-right
- - if ci_service.respond_to?(:status_img_path)
- = link_to ci_service.builds_path, :'data-no-turbolink' => 'data-no-turbolink' do
- = image_tag ci_service.status_img_path, alt: "build status"
- - else
- = link_to 'view builds', ci_service.builds_path, :'data-no-turbolink' => 'data-no-turbolink'
+ = icon("archive fw")
+ Repository
+
+ %ul.nav.nav-pills
+ %li
+ = link_to namespace_project_commits_path(@project.namespace, @project, @ref || @repository.root_ref) do
+ = icon("history fw")
+ = pluralize(number_with_delimiter(@repository.commit_count), 'commit')
+ %li
+ = link_to namespace_project_branches_path(@project.namespace, @project) do
+ = icon("code-fork fw")
+ = pluralize(number_with_delimiter(@repository.branch_names.count), 'branch')
+ %li
+ = link_to namespace_project_tags_path(@project.namespace, @project) do
+ = icon("tags fw")
+ = pluralize(number_with_delimiter(@repository.tag_names.count), 'tag')
+
+ = render "shared/clone_panel"
+
+ .actions.prepend-top-10
+ = link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: @ref || @repository.root_ref), class: 'btn btn-sm append-right-10' do
+ %i.fa.fa-exchange
+ Compare code
+
+ - if can?(current_user, :download_code, @project)
+ = render 'projects/repositories/download_archive', split_button: true, btn_class: 'btn-group-sm'
+
+ - if @project.archived?
+ .alert.alert-warning
+ %h4
+ = icon("exclamation-triangle fw")
+ Archived project!
+ %p Repository is read-only