mirror of
https://github.com/go-gitea/gitea.git
synced 2025-04-08 17:05:45 +02:00
fix: add methods of status
This commit is contained in:
parent
25fe4f6d9e
commit
9292e9ebdb
@ -27,6 +27,30 @@ func (s Status) IsDone() bool {
|
||||
return s > StatusUnknown && s <= StatusSkipped
|
||||
}
|
||||
|
||||
func (s Status) IsSuccess() bool {
|
||||
return s == StatusSuccess
|
||||
}
|
||||
|
||||
func (s Status) IsFailure() bool {
|
||||
return s == StatusFailure
|
||||
}
|
||||
|
||||
func (s Status) IsCancelled() bool {
|
||||
return s == StatusCancelled
|
||||
}
|
||||
|
||||
func (s Status) IsSkipped() bool {
|
||||
return s == StatusSkipped
|
||||
}
|
||||
|
||||
func (s Status) IsWaiting() bool {
|
||||
return s == StatusWaiting
|
||||
}
|
||||
|
||||
func (s Status) IsRunning() bool {
|
||||
return s == StatusRunning
|
||||
}
|
||||
|
||||
var statusNames = map[Status]string{
|
||||
StatusUnknown: "unknown",
|
||||
StatusWaiting: "waiting",
|
||||
|
@ -1,4 +1,4 @@
|
||||
{{if .IsPending}}
|
||||
{{if .IsWaiting}}
|
||||
<i class="commit-status circle icon gray"></i>
|
||||
{{end}}
|
||||
{{if .IsRunning}}
|
||||
@ -7,6 +7,6 @@
|
||||
{{if .IsSuccess}}
|
||||
<i class="commit-status check icon green"></i>
|
||||
{{end}}
|
||||
{{if .IsFailed}}
|
||||
{{if .IsFailure}}
|
||||
<i class="commit-status warning icon red"></i>
|
||||
{{end}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user