From 9f36888b9945970e8aa14282f0ea70286350679c Mon Sep 17 00:00:00 2001 From: Sytse Sijbrandij Date: Mon, 23 Jun 2014 09:16:38 +0200 Subject: [PATCH 1/3] Link to readme from description if you don't have edit rights on the repository. --- app/views/projects/_home_panel.html.haml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml index 81bb0e20a35..2384f3eaa76 100644 --- a/app/views/projects/_home_panel.html.haml +++ b/app/views/projects/_home_panel.html.haml @@ -21,6 +21,10 @@ - if can?(current_user, :admin_project, @project) – %strong= link_to 'Edit', edit_project_path + - else + - readme = @repository.readme + = link_to project_blob_path(@project, tree_join(@repository.root_ref, readme.name)), class: 'btn btn-block' do + = readme.name - unless empty_repo .col-md-5 From 882c7b50b81644be8e8e4be5bcf4b5432d9abb14 Mon Sep 17 00:00:00 2001 From: Sytse Sijbrandij Date: Mon, 23 Jun 2014 09:50:29 +0200 Subject: [PATCH 2/3] Allow for the readme not to exist. --- app/views/projects/_home_panel.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml index 2384f3eaa76..0f733dadb2e 100644 --- a/app/views/projects/_home_panel.html.haml +++ b/app/views/projects/_home_panel.html.haml @@ -21,7 +21,7 @@ - if can?(current_user, :admin_project, @project) – %strong= link_to 'Edit', edit_project_path - - else + - elsif @repository.readme - readme = @repository.readme = link_to project_blob_path(@project, tree_join(@repository.root_ref, readme.name)), class: 'btn btn-block' do = readme.name From 7ed11fded5862bd7c03448e48ba17efdabdbc218 Mon Sep 17 00:00:00 2001 From: Sytse Sijbrandij Date: Tue, 24 Jun 2014 08:43:55 +0200 Subject: [PATCH 3/3] Remove button code from readme link. --- app/views/projects/_home_panel.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml index 0f733dadb2e..273a8493f44 100644 --- a/app/views/projects/_home_panel.html.haml +++ b/app/views/projects/_home_panel.html.haml @@ -23,7 +23,7 @@ %strong= link_to 'Edit', edit_project_path - elsif @repository.readme - readme = @repository.readme - = link_to project_blob_path(@project, tree_join(@repository.root_ref, readme.name)), class: 'btn btn-block' do + = link_to project_blob_path(@project, tree_join(@repository.root_ref, readme.name)) do = readme.name - unless empty_repo