From be3319b3d545289b772d7a92b4b62205863954d9 Mon Sep 17 00:00:00 2001 From: Rémy Boulanouar Date: Thu, 14 Sep 2017 08:51:32 +0200 Subject: Display commit status on landing page of repo (#1784) * Display commit status on landing page of repo * improve last status of commits and add link to ci * fix last commit status since the order of ids are desc --- templates/repo/commit_status.tmpl | 15 +++++++++++++++ templates/repo/commits_table.tmpl | 16 +--------------- templates/repo/diff/page.tmpl | 2 +- templates/repo/view_list.tmpl | 3 ++- 4 files changed, 19 insertions(+), 17 deletions(-) create mode 100644 templates/repo/commit_status.tmpl (limited to 'templates') diff --git a/templates/repo/commit_status.tmpl b/templates/repo/commit_status.tmpl new file mode 100644 index 0000000000..752fd762e3 --- /dev/null +++ b/templates/repo/commit_status.tmpl @@ -0,0 +1,15 @@ +{{if eq .State "pending"}} + +{{end}} +{{if eq .State "success"}} + +{{end}} +{{if eq .State "error"}} + +{{end}} +{{if eq .State "failure"}} + +{{end}} +{{if eq .State "warning"}} + +{{end}} \ No newline at end of file diff --git a/templates/repo/commits_table.tmpl b/templates/repo/commits_table.tmpl index e33ffcdaa3..b5bd8f33d0 100644 --- a/templates/repo/commits_table.tmpl +++ b/templates/repo/commits_table.tmpl @@ -61,21 +61,7 @@ {{RenderCommitMessage false .Summary $.RepoLink $.Repository.ComposeMetas}} - {{if eq .State "pending"}} - - {{end}} - {{if eq .State "success"}} - - {{end}} - {{if eq .State "error"}} - - {{end}} - {{if eq .State "failure"}} - - {{end}} - {{if eq .State "warning"}} - - {{end}} + {{template "repo/commit_status" .Status}} {{TimeSince .Author.When $.Lang}} diff --git a/templates/repo/diff/page.tmpl b/templates/repo/diff/page.tmpl index 4ddf3ad436..2736daa7f9 100644 --- a/templates/repo/diff/page.tmpl +++ b/templates/repo/diff/page.tmpl @@ -9,7 +9,7 @@ {{.i18n.Tr "repo.diff.browse_source"}} - {{RenderCommitMessage true .Commit.Message $.RepoLink $.Repository.ComposeMetas}} +

{{RenderCommitMessage false .Commit.Message $.RepoLink $.Repository.ComposeMetas}}{{template "repo/commit_status" .CommitStatus}}

{{if .Author}} diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index 663ef41447..67164753e9 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -25,7 +25,8 @@
{{end}} - {{RenderCommitMessage false .LatestCommit.Summary .RepoLink $.Repository.ComposeMetas}} + {{RenderCommitMessage false .LatestCommit.Summary .RepoLink $.Repository.ComposeMetas}} + {{template "repo/commit_status" .LatestCommitStatus}} -- cgit v1.2.3