Skip to content
Snippets Groups Projects
Unverified Commit bd08ac55 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

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

parent 17156cf9
No related branches found
No related tags found
1 merge request!938New project home page
Pipeline #
Loading
@@ -259,4 +259,11 @@ module ProjectsHelper
Loading
@@ -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
Loading
@@ -8,11 +8,13 @@
Loading
@@ -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
 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
Loading
Loading
Loading
@@ -50,10 +50,19 @@
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment