Recommend user to create README file for both empty and existing project
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
17156cf909
commit
bd08ac55c7
3 changed files with 26 additions and 8 deletions
|
@ -259,4 +259,11 @@ module ProjectsHelper
|
|||
def leave_project_message(project)
|
||||
"Are you sure you want to leave \"#{project.name}\" project?"
|
||||
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
|
||||
|
|
|
@ -8,11 +8,13 @@
|
|||
%h3.page-title
|
||||
The repository for this project is empty
|
||||
%p
|
||||
You can
|
||||
= link_to namespace_project_new_blob_path(@project.namespace, @project, 'master'), class: 'btn btn-new' do
|
||||
add a file
|
||||
or do a push via the command line.
|
||||
If you already have files you can push them using command line instructions below.
|
||||
%br
|
||||
Otherwise you can start with
|
||||
= link_to "adding README", new_readme_path, class: 'underlined-link'
|
||||
file to this project.
|
||||
|
||||
.prepend-top-20
|
||||
%h3.page-title
|
||||
Command line instructions
|
||||
%div.git-empty
|
||||
|
|
|
@ -50,10 +50,19 @@
|
|||
.wiki
|
||||
= render_readme(readme)
|
||||
- else
|
||||
%h4
|
||||
Please
|
||||
= link_to "add README", namespace_project_new_blob_path(@project.namespace, @project, tree_join(@repository.root_ref), file_name: 'README.md')
|
||||
file to this repository
|
||||
%h3.page-title
|
||||
This project does not have README yet :(
|
||||
- if can?(current_user, :push_code, @project)
|
||||
%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
|
||||
|
|
Loading…
Reference in a new issue