Commit bd08ac55 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Recommend user to create README file for both empty and existing project

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 17156cf9
...@@ -259,4 +259,11 @@ module ProjectsHelper ...@@ -259,4 +259,11 @@ module ProjectsHelper
def leave_project_message(project) def leave_project_message(project)
"Are you sure you want to leave \"#{project.name}\" project?" "Are you sure you want to leave \"#{project.name}\" project?"
end end
def new_readme_path
ref = @repository.root_ref if @repository
ref ||= 'master'
namespace_project_new_blob_path(@project.namespace, @project, tree_join(ref), file_name: 'README.md')
end
end end
...@@ -8,11 +8,13 @@ ...@@ -8,11 +8,13 @@
%h3.page-title %h3.page-title
The repository for this project is empty The repository for this project is empty
%p %p
You can If you already have files you can push them using command line instructions below.
= link_to namespace_project_new_blob_path(@project.namespace, @project, 'master'), class: 'btn btn-new' do %br
add a file Otherwise you can start with
&nbsp;or do a push via the command line. = link_to "adding README", new_readme_path, class: 'underlined-link'
file to this project.
.prepend-top-20
%h3.page-title %h3.page-title
Command line instructions Command line instructions
%div.git-empty %div.git-empty
......
...@@ -50,10 +50,19 @@ ...@@ -50,10 +50,19 @@
.wiki .wiki
= render_readme(readme) = render_readme(readme)
- else - else
%h4 %h3.page-title
Please This project does not have README yet :(
= link_to "add README", namespace_project_new_blob_path(@project.namespace, @project, tree_join(@repository.root_ref), file_name: 'README.md') - if can?(current_user, :push_code, @project)
file to this repository %p.slead
A
%code README
file contains information about other files in a repository and is commonly
distributed with computer software, forming part of its documentation.
%br
We recommend you to
= link_to "add README", new_readme_path, class: 'underlined-link'
file to the repository and GitLab will render it here instead of this message.
- if current_user - if current_user
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment