-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Group commit list page by date #34098
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
kerwin612
wants to merge
17
commits into
go-gitea:main
Choose a base branch
from
kerwin612:refactor-commit-list-page-group-by-date
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 6 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
b29d401
Complete the grouping design within the existing table.
kerwin612 98157ad
Merge branch 'main' into refactor-commit-list-page-group-by-date
kerwin612 073c593
revert
kerwin612 0581b27
Refactor the structure of the commit list page to grouping by date.
kerwin612 b9dfd3e
Merge branch main into refactor-commit-list-page-group-by-date
kerwin612 b1efeae
Merge branch 'main' into refactor-commit-list-page-group-by-date
kerwin612 d63aca0
fix
kerwin612 69e0505
fix
kerwin612 22f9a51
fix
kerwin612 fca0992
fix
kerwin612 1228d48
Merge branch 'main' into refactor-commit-list-page-group-by-date
kerwin612 948ff41
fix
kerwin612 c81ab46
Merge branch 'main' into refactor-commit-list-page-group-by-date
kerwin612 5d0f6a0
Merge branch 'main' into refactor-commit-list-page-group-by-date
kerwin612 dd62a17
Update templates/repo/commits_list_group_by_date.tmpl
kerwin612 90dcac2
fix
kerwin612 fe9be75
use utctime group; add unit test;
kerwin612 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
{{$index := 0}} | ||
{{range .GroupCommits}} | ||
{{$index = Eval $index "+" 1}} | ||
<div class="ui timeline commits_list_group_by_date" data-index="{{$index}}"> | ||
|
||
<div class="timeline-badge-wrapper"> | ||
<div class="timeline-badge"> | ||
{{svg "octicon-git-commit"}} | ||
</div> | ||
</div> | ||
|
||
<div class="timeline-body"> | ||
<h3 class="flex-text-block tw-py-2 timeline-heading"> | ||
Commits on {{DateUtils.AbsoluteShort .Date}} | ||
kerwin612 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</h3> | ||
<div class="tw-flex tw-mt-2 timeline-list-container"> | ||
<ul class="commits-list"> | ||
{{range .Commits}} | ||
{{$commitRepoLink := $.RepoLink}}{{if $.CommitRepoLink}}{{$commitRepoLink = $.CommitRepoLink}}{{end}} | ||
<li class="commits-list-item"> | ||
<div class="tw-pt-4 tw-pl-4 title"> | ||
<h4> | ||
<span class="message-wrapper"> | ||
{{if $.PageIsWiki}} | ||
<span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary | ctx.RenderUtils.RenderEmoji}}</span> | ||
{{else}} | ||
{{$commitLink:= printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String)}} | ||
<span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{ctx.RenderUtils.RenderCommitMessageLinkSubject .Message $commitLink ($.Repository.ComposeCommentMetas ctx)}}</span> | ||
{{end}} | ||
</span> | ||
{{if IsMultilineCommitMessage .Message}} | ||
<button class="ui button ellipsis-button" aria-expanded="false" data-global-click="onRepoEllipsisButtonClick">...</button> | ||
{{end}} | ||
{{if IsMultilineCommitMessage .Message}} | ||
<pre class="commit-body tw-hidden">{{ctx.RenderUtils.RenderCommitBody .Message ($.Repository.ComposeCommentMetas ctx)}}</pre> | ||
{{end}} | ||
{{if $.CommitsTagsMap}} | ||
{{range (index $.CommitsTagsMap .ID.String)}} | ||
{{- template "repo/tag/name" dict "RepoLink" $.Repository.Link "TagName" .TagName "IsRelease" (not .IsTag) -}} | ||
{{end}} | ||
{{end}} | ||
</h4> | ||
</div> | ||
<div class="tw-flex tw-items-center tw-gap-1 tw-pb-4 tw-pl-4 description"> | ||
<div class="author"> | ||
{{$userName := .Author.Name}} | ||
{{if .User}} | ||
{{if and .User.FullName DefaultShowFullName}} | ||
{{$userName = .User.FullName}} | ||
{{end}} | ||
{{ctx.AvatarUtils.Avatar .User 28 "tw-mr-2"}}<a class="muted author-wrapper" href="{{.User.HomeLink}}">{{$userName}}</a> | ||
{{else}} | ||
{{ctx.AvatarUtils.AvatarByEmail .Author.Email .Author.Name 28 "tw-mr-2"}} | ||
<span class="author-wrapper">{{$userName}}</span> | ||
{{end}} | ||
</div> | ||
<span> | ||
{{if .Committer}} | ||
committed | ||
{{else}} | ||
authored | ||
{{end}} | ||
</span> | ||
{{if .Committer}} | ||
{{DateUtils.TimeSince .Committer.When}} | ||
{{else}} | ||
{{DateUtils.TimeSince .Author.When}} | ||
{{end}} | ||
{{if .Statuses}} | ||
<span>·</span> | ||
{{end}} | ||
{{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses}} | ||
</div> | ||
<div class="tw-flex tw-flex-wrap tw-items-center tw-gap-2 tw-pr-4 metadata"> | ||
{{$commitBaseLink := ""}} | ||
{{if $.PageIsWiki}} | ||
{{$commitBaseLink = printf "%s/wiki/commit" $commitRepoLink}} | ||
{{else if $.PageIsPullCommits}} | ||
{{$commitBaseLink = printf "%s/pulls/%d/commits" $commitRepoLink $.Issue.Index}} | ||
{{else if $.Reponame}} | ||
{{$commitBaseLink = printf "%s/commit" $commitRepoLink}} | ||
{{end}} | ||
<div class="commit_sign_badge"> | ||
kerwin612 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{{template "repo/commit_sign_badge" dict "Commit" . "CommitBaseLink" $commitBaseLink "CommitSignVerification" .Verification}} | ||
</div> | ||
<div class="tw-flex tw-flex-wrap tw-items-center tw-gap-2"> | ||
<div> | ||
<button class="btn interact-bg tw-p-2 copy-commit-id" data-tooltip-content="{{ctx.Locale.Tr "copy_hash"}}" data-clipboard-text="{{.ID}}">{{svg "octicon-copy"}}</button> | ||
</div> | ||
{{/* at the moment, wiki doesn't support these "view" links like "view at history point" */}} | ||
{{if not $.PageIsWiki}} | ||
{{/* view single file diff */}} | ||
{{if $.FileTreePath}} | ||
<a class="btn interact-bg tw-p-2 view-single-diff" data-tooltip-content="{{ctx.Locale.Tr "repo.commits.view_file_diff"}}" | ||
href="{{$commitRepoLink}}/commit/{{.ID.String}}?files={{$.FileTreePath}}" | ||
>{{svg "octicon-file-diff"}}</a> | ||
{{end}} | ||
|
||
{{/* view at history point */}} | ||
{{$viewCommitLink := printf "%s/src/commit/%s" $commitRepoLink (PathEscape .ID.String)}} | ||
{{if $.FileTreePath}}{{$viewCommitLink = printf "%s/%s" $viewCommitLink (PathEscapeSegments $.FileTreePath)}}{{end}} | ||
<a class="btn interact-bg tw-p-2 view-commit-path" data-tooltip-content="{{ctx.Locale.Tr "repo.commits.view_path"}}" href="{{$viewCommitLink}}">{{svg "octicon-file-code"}}</a> | ||
{{end}} | ||
</div> | ||
</div> | ||
</li> | ||
{{end}} | ||
</ul> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
{{end}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,8 +29,8 @@ | |
</div> | ||
{{end}} | ||
|
||
{{if and .Commits (gt .CommitCount 0)}} | ||
{{template "repo/commits_list" .}} | ||
kerwin612 marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Still the question, it seems that "wiki" is still using the |
||
{{if and .GroupCommits (gt .CommitCount 0)}} | ||
{{template "repo/commits_list_group_by_date" .}} | ||
{{end}} | ||
|
||
{{template "base/paginate" .}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.