diff options
author | Rémy Coutable <remy@rymai.me> | 2018-01-25 16:04:55 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-01-25 16:04:55 +0000 |
commit | a7a240177bb9c6543775aeb3415b7b2cce848e5f (patch) | |
tree | 74fcbc2133646e5278869c9cb46263618f9f2d0f /app | |
parent | 7d8c624bbbba338386d75c0d9c3fa71b59b27e01 (diff) | |
parent | a8ebe3670f3e4ab622ca177785f5cceacf75d3bd (diff) | |
download | gitlab-ce-a7a240177bb9c6543775aeb3415b7b2cce848e5f.tar.gz |
Merge branch 'feat/add-section-headers-to-project-repo-buttons' into 'master'
Improve empty project overview
See merge request gitlab-org/gitlab-ce!16617
Diffstat (limited to 'app')
-rw-r--r-- | app/views/projects/_readme.html.haml | 8 | ||||
-rw-r--r-- | app/views/projects/buttons/_dropdown.html.haml | 13 | ||||
-rw-r--r-- | app/views/projects/empty.html.haml | 9 |
3 files changed, 17 insertions, 13 deletions
diff --git a/app/views/projects/_readme.html.haml b/app/views/projects/_readme.html.haml index 32901d30b96..aebdfbc8218 100644 --- a/app/views/projects/_readme.html.haml +++ b/app/views/projects/_readme.html.haml @@ -9,15 +9,15 @@ - else .row-content-block.second-block.center - %h3.page-title + %h4 This project does not have a README yet + - if can?(current_user, :push_code, @project) %p A %code README file contains information about other files in a repository and is commonly distributed with computer software, forming part of its documentation. + GitLab will render it here instead of this message. %p - We recommend you to - = link_to "add a README", add_special_file_path(@project, file_name: 'README.md') - file to the repository and GitLab will render it here instead of this message. + = link_to "Add Readme", add_special_file_path(@project, file_name: 'README.md'), class: 'btn btn-new' diff --git a/app/views/projects/buttons/_dropdown.html.haml b/app/views/projects/buttons/_dropdown.html.haml index dab94d10bb1..18e948ce35a 100644 --- a/app/views/projects/buttons/_dropdown.html.haml +++ b/app/views/projects/buttons/_dropdown.html.haml @@ -6,7 +6,10 @@ %ul.dropdown-menu.dropdown-menu-align-right.project-home-dropdown - can_create_issue = can?(current_user, :create_issue, @project) - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - - can_create_snippet = can?(current_user, :create_snippet, @project) + - can_create_project_snippet = can?(current_user, :create_project_snippet, @project) + + - if can_create_issue || merge_project || can_create_project_snippet + %li.dropdown-header= _('This project') - if can_create_issue %li= link_to _('New issue'), new_project_issue_path(@project) @@ -14,11 +17,11 @@ - if merge_project %li= link_to _('New merge request'), project_new_merge_request_path(merge_project) - - if can_create_snippet + - if can_create_project_snippet %li= link_to _('New snippet'), new_project_snippet_path(@project) - - if can_create_issue || merge_project || can_create_snippet - %li.divider + - if can?(current_user, :push_code, @project) + %li.dropdown-header= _('This repository') - if can?(current_user, :push_code, @project) %li= link_to _('New file'), project_new_blob_path(@project, @project.default_branch || 'master') @@ -31,5 +34,5 @@ - continue_params = { to: project_new_blob_path(@project, @project.default_branch || 'master'), notice: edit_in_new_fork_notice, notice_now: edit_in_new_fork_notice_now } - - fork_path = project_forks_path(@project, namespace_key: current_user.namespace.id, continue: continue_params) + - fork_path = project_forks_path(@project, namespace_key: current_user.namespace.id, continue: continue_params) %li= link_to _('New file'), fork_path, method: :post diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml index 58e89a481a9..ab225796b12 100644 --- a/app/views/projects/empty.html.haml +++ b/app/views/projects/empty.html.haml @@ -6,8 +6,9 @@ = render "home_panel" .row-content-block.second-block.center - %h3.page-title + %h4 The repository for this project is empty + - if can?(current_user, :push_code, @project) %p If you already have files you can push them using command line instructions below. @@ -28,8 +29,8 @@ %p - link = link_to(s_('AutoDevOps|Auto DevOps (Beta)'), project_settings_ci_cd_path(@project, anchor: 'js-general-pipeline-settings')) = s_('AutoDevOps|You can activate %{link_to_settings} for this project.').html_safe % { link_to_settings: link } - %p - = s_('AutoDevOps|It will automatically build, test, and deploy your application based on a predefined CI/CD configuration.') + %p= s_('AutoDevOps|It will automatically build, test, and deploy your application based on a predefined CI/CD configuration.') + %p= link_to _('New file'), project_new_blob_path(@project, @project.default_branch || 'master'), class: 'btn btn-new' - if can?(current_user, :push_code, @project) %div{ class: container_class } @@ -79,4 +80,4 @@ - if can? current_user, :remove_project, @project .prepend-top-20 - = link_to 'Remove project', [@project.namespace.becomes(Namespace), @project], data: { confirm: remove_project_message(@project)}, method: :delete, class: "btn btn-remove pull-right" + = link_to 'Remove project', [@project.namespace.becomes(Namespace), @project], data: { confirm: remove_project_message(@project)}, method: :delete, class: "btn btn-inverted btn-remove pull-right" |