-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Expandable commit bodies #2980
Merged
Merged
Expandable commit bodies #2980
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
f4a48d2
Initial working state of expandable commit bodies
sondr3 67fde4d
Fix all commits having showing button for multiline commits
sondr3 524f957
Refactor checking multiline messages method
sondr3 053cc1d
Force newlines with <br> in commit body
sondr3 7afb927
Show multiple lines in the list view of repositories
sondr3 23b92b8
Fixed proper newlines and minor refactor
sondr3 7f25cd8
Fix commit list messages jumping around
sondr3 65e6a19
Fix indentation in view_list.tmpl
sondr3 ed572c2
Use vertical-align: baseline instead of top
sondr3 3767880
Refactor commit button toggle function
sondr3 2856f9e
Remove RenderCommitBodyLink function
sondr3 76e640d
Add comments
sondr3 f325cf2
Add newline at the end of _repository.less
sondr3 a452635
Fix long commit bodies not properly wrapping inside <pre>
sondr3 a47c4c1
Don't split on double newlines
sondr3 8f02f61
Show the commit body in commit view
sondr3 63fec45
Update stylesheets
sondr3 e521e8a
Merge branch 'master' into commit-message
lafriks f55878c
Add/fix comments and run make fmt
sondr3 083af01
Fix spaces not being tabs
sondr3 f7592bb
Merge branch 'master' into commit-message
lunny 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 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 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 |
---|---|---|
|
@@ -1606,3 +1606,11 @@ | |
} | ||
} | ||
} | ||
|
||
.commit-list { | ||
vertical-align: baseline; | ||
} | ||
|
||
.commit-body { | ||
white-space: pre-wrap; | ||
} |
This file contains 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 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 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<table id="repo-files-table" class="ui fixed single line table"> | ||
<thead> | ||
<tr> | ||
<tr class="commit-list"> | ||
<th class="four wide"> | ||
{{if .LatestCommitUser}} | ||
<img class="ui avatar image img-12" src="{{.LatestCommitUser.RelAvatarLink}}" /> | ||
|
@@ -28,6 +28,10 @@ | |
{{end}} | ||
</a> | ||
<span class="grey has-emoji">{{RenderCommitMessage .LatestCommit.Summary .RepoLink $.Repository.ComposeMetas}} | ||
{{if IsMultilineCommitMessage .LatestCommit.Message}} | ||
<button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button> | ||
<pre class="commit-body" style="display: none;">{{RenderCommitBody .LatestCommit.Message $.RepoLink $.Repository.ComposeMetas}}</pre> | ||
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. same as above regarding inline CSS |
||
{{end}} | ||
{{template "repo/commit_status" .LatestCommitStatus}}</span> | ||
</th> | ||
<th class="nine wide"> | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is inline CSS here, could you change it out with a CSS class?
Also this requires JS which means if someone has JS disabled then they won't be able to see the long commit message (perhaps default to open when JS is disabled?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or perhaps hide the button if the user doesn't have JS is another option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@techknowlogick I think for this inline style is ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it's not the prettiest, but the
toggle
function changes the style inline so I thought it was a decent compromise. Regarding what to do when JS is disabled, I'll leave that to the Gitea maintainers, I think Gitea depends on JS enough that if you disable it you're on your own.