diff options
author | George Tsiolis <tsiolis.g@gmail.com> | 2018-01-22 14:13:07 +0200 |
---|---|---|
committer | George Tsiolis <tsiolis.g@gmail.com> | 2018-01-25 16:15:35 +0200 |
commit | a8ebe3670f3e4ab622ca177785f5cceacf75d3bd (patch) | |
tree | 6efa4ccf424e3cbcf9198ee87112ccf7ec3f0ffb | |
parent | d2bf53942fdb7368c914482ebdfdf1dc1a145cce (diff) | |
download | gitlab-ce-a8ebe3670f3e4ab622ca177785f5cceacf75d3bd.tar.gz |
Improve empty project overview
- Add section headers to project repo buttons
- Add primary button to content to add file when the repository is empty
- Change project removal primary button from project overview to secondary button
- Update headings for better alignment
- Add primary button for readme only user preference
-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 | ||||
-rw-r--r-- | changelogs/unreleased/feat-add-section-headers-to-project-repo-buttons.yml | 5 |
4 files changed, 22 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" diff --git a/changelogs/unreleased/feat-add-section-headers-to-project-repo-buttons.yml b/changelogs/unreleased/feat-add-section-headers-to-project-repo-buttons.yml new file mode 100644 index 00000000000..8f3459a7381 --- /dev/null +++ b/changelogs/unreleased/feat-add-section-headers-to-project-repo-buttons.yml @@ -0,0 +1,5 @@ +--- +title: Improve empty project overview +merge_request: 16617 +author: George Tsiolis +type: added |