aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo
diff options
context:
space:
mode:
authorRémy Boulanouar <rboulanouar@gmail.com>2017-09-14 08:51:32 +0200
committerLunny Xiao <xiaolunwen@gmail.com>2017-09-14 14:51:31 +0800
commitbe3319b3d545289b772d7a92b4b62205863954d9 (patch)
tree89473f47f6303ea5ab57ade7901de1a3a48dd673 /templates/repo
parenta89692d15884271a2927b5f7332ed074116d324c (diff)
downloadgitea-be3319b3d545289b772d7a92b4b62205863954d9.tar.gz
gitea-be3319b3d545289b772d7a92b4b62205863954d9.zip
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
Diffstat (limited to 'templates/repo')
-rw-r--r--templates/repo/commit_status.tmpl15
-rw-r--r--templates/repo/commits_table.tmpl16
-rw-r--r--templates/repo/diff/page.tmpl2
-rw-r--r--templates/repo/view_list.tmpl3
4 files changed, 19 insertions, 17 deletions
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"}}
+ <a href="{{.TargetURL}}" target=_blank><i class="commit-status circle icon yellow"></i></a>
+{{end}}
+{{if eq .State "success"}}
+ <a href="{{.TargetURL}}" target=_blank><i class="commit-status check icon green"></i></a>
+{{end}}
+{{if eq .State "error"}}
+ <a href="{{.TargetURL}}" target=_blank><i class="commit-status warning icon red"></i></a>
+{{end}}
+{{if eq .State "failure"}}
+ <a href="{{.TargetURL}}" target=_blank><i class="commit-status remove icon red"></i></a>
+{{end}}
+{{if eq .State "warning"}}
+ <a href="{{.TargetURL}}" target=_blank><i class="commit-status warning sign icon yellow"></i></a>
+{{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 @@
</td>
<td class="message collapsing">
<span class="has-emoji{{if gt .ParentCount 1}} grey text{{end}}">{{RenderCommitMessage false .Summary $.RepoLink $.Repository.ComposeMetas}}</span>
- {{if eq .State "pending"}}
- <i class="commit-status circle icon yellow"></i>
- {{end}}
- {{if eq .State "success"}}
- <i class="commit-status check icon green"></i>
- {{end}}
- {{if eq .State "error"}}
- <i class="commit-status warning icon red"></i>
- {{end}}
- {{if eq .State "failure"}}
- <i class="commit-status remove icon red"></i>
- {{end}}
- {{if eq .State "warning"}}
- <i class="commit-status warning sign icon yellow"></i>
- {{end}}
+ {{template "repo/commit_status" .Status}}
</td>
<td class="grey text right aligned">{{TimeSince .Author.When $.Lang}}</td>
</tr>
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 @@
<a class="ui floated right blue tiny button" href="{{EscapePound .SourcePath}}">
{{.i18n.Tr "repo.diff.browse_source"}}
</a>
- {{RenderCommitMessage true .Commit.Message $.RepoLink $.Repository.ComposeMetas}}
+ <h3>{{RenderCommitMessage false .Commit.Message $.RepoLink $.Repository.ComposeMetas}}{{template "repo/commit_status" .CommitStatus}}</h3>
</div>
<div class="ui attached info segment {{if .Commit.Signature}} isSigned {{if .Verification.Verified }} isVerified {{end}}{{end}}">
{{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 @@
</div>
{{end}}
</a>
- <span class="grey has-emoji">{{RenderCommitMessage false .LatestCommit.Summary .RepoLink $.Repository.ComposeMetas}}</span>
+ <span class="grey has-emoji">{{RenderCommitMessage false .LatestCommit.Summary .RepoLink $.Repository.ComposeMetas}}
+ {{template "repo/commit_status" .LatestCommitStatus}}</span>
</th>
<th class="nine wide">
</th>