mirror of
https://github.com/go-gitea/gitea.git
synced 2025-04-15 05:37:46 +00:00
Merge b29d401233
into 4dca869ed1
This commit is contained in:
commit
3cf8f411c6
@ -20,6 +20,12 @@ func NewDateUtils() *DateUtils {
|
||||
return (*DateUtils)(nil) // the util is stateless, and we do not need to create an instance
|
||||
}
|
||||
|
||||
func (du *DateUtils) DaysInterval(t1, t2 time.Time) int {
|
||||
t1 = time.Date(t1.Year(), t1.Month(), t1.Day(), 0, 0, 0, 0, t1.Location())
|
||||
t2 = time.Date(t2.Year(), t2.Month(), t2.Day(), 0, 0, 0, 0, t2.Location())
|
||||
return int(t2.Sub(t1).Hours() / 24)
|
||||
}
|
||||
|
||||
// AbsoluteShort renders in "Jan 01, 2006" format
|
||||
func (du *DateUtils) AbsoluteShort(time any) template.HTML {
|
||||
return dateTimeFormat("short", time)
|
||||
|
@ -11,7 +11,13 @@
|
||||
</thead>
|
||||
<tbody class="commit-list">
|
||||
{{$commitRepoLink := $.RepoLink}}{{if $.CommitRepoLink}}{{$commitRepoLink = $.CommitRepoLink}}{{end}}
|
||||
{{$groupDate := DateUtils.ParseLegacy ""}}
|
||||
{{range .Commits}}
|
||||
{{$commitDate := ""}}{{if .Committer}}{{$commitDate = .Committer.When}}{{else}}{{$commitDate = .Author.When}}{{end}}
|
||||
{{if ne (DateUtils.DaysInterval $groupDate $commitDate) 0}}
|
||||
{{$groupDate = $commitDate}}
|
||||
<tr class="header"><td colspan="5">Commits on {{DateUtils.AbsoluteShort $groupDate}}</td></tr>
|
||||
{{end}}
|
||||
<tr>
|
||||
<td class="author">
|
||||
<div class="tw-flex">
|
||||
|
@ -916,7 +916,11 @@ td .commit-summary {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.repository #commits-table.ui.basic.striped.table tbody tr:nth-child(2n) {
|
||||
.repository #commits-table.ui.basic.striped.table tbody tr {
|
||||
background-color: inherit !important;
|
||||
}
|
||||
|
||||
.repository #commits-table.ui.basic.striped.table tbody tr:not(.header):nth-child(2n) {
|
||||
background-color: var(--color-light) !important;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user