-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Add UI to delete tracked times #14100
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
Merged
Merged
Changes from 37 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
99d977f
add DeleteTime issue action
noerw 864651a
store time ID for CommentTypeAddTimeManual & StopTracking
noerw 083bb1e
add template to render delete time button on comments
noerw a322b60
code review
noerw 0ee2dce
make linter happy
noerw 0bfc614
Update routers/repo/issue_timetrack.go
noerw 3cab4a8
Update routers/repo/issue_timetrack.go
noerw ba50f18
Merge branch 'master' into delete-times-ui
6543 7470f8a
add confirmation dialog
noerw 78f4b2c
revert vscode shenanigans
noerw dd0a7d7
make linter happy
noerw 6a37c2f
(╯°□°)╯︵ ┻━┻
noerw 3548da4
Merge branch 'master' into delete-times-ui
6543 7d2f0d3
Add migration
6543 c8e6271
Merge branch 'master' into delete-times-ui
noerw d360901
rename to comments_delete_time template
noerw e0a11f4
rectangular button
noerw c97d667
submit add time on enter
noerw 0bd16c9
revert -> Revert Time Log
noerw acf5a84
Merge branch 'master' into delete-times-ui
6543 209304e
revert -> delete, trashcan icon
noerw b655885
move migration for curr master
noerw 1f6f28a
Merge remote-tracking branch 'origin/master' into delete-times-ui
noerw 432127b
Merge remote-tracking branch 'noerw/delete-times-ui' into delete-time…
noerw 12ba398
Merge remote-tracking branch 'origin/master' into delete-times-ui
noerw c0396e5
fixup! Merge remote-tracking branch 'origin/master' into delete-times-ui
noerw d35eb22
fixup! Merge remote-tracking branch 'origin/master' into delete-times-ui
noerw a1260a3
Merge remote-tracking branch 'origin/master' into delete-times-ui
noerw f2c8542
Merge branch 'master' into delete-times-ui
noerw 498f15f
Merge branch 'master' into delete-times-ui
6543 18d62ef
Merge branch 'master' into delete-times-ui
6543 a2b0b66
Merge branch 'master' into delete-times-ui
6543 2041c93
migrate to chi
6543 0955919
Merge branch 'master' into delete-times-ui
6543 fbf4a1d
add
6543 4543349
Merge branch 'master' into delete-times-ui
6543 040cea4
Merge branch 'master' into delete-times-ui
6543 bc0fc82
Merge branch 'master' into delete-times-ui
6543 2a2dd93
Flash Success
6543 574fad2
imports
6543 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
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,22 @@ | ||
// Copyright 2021 The Gitea Authors. All rights reserved. | ||
// Use of this source code is governed by a MIT-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package migrations | ||
|
||
import ( | ||
"fmt" | ||
|
||
"xorm.io/xorm" | ||
) | ||
|
||
func addTimeIDCommentColumn(x *xorm.Engine) error { | ||
type Comment struct { | ||
TimeID int64 | ||
} | ||
|
||
if err := x.Sync2(new(Comment)); err != nil { | ||
return fmt.Errorf("Sync2: %v", err) | ||
} | ||
return nil | ||
} |
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
21 changes: 21 additions & 0 deletions
21
templates/repo/issue/view_content/comments_delete_time.tmpl
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,21 @@ | ||
{{ if .comment.Time }} {{/* compatibility with time comments made before v1.14 */}} | ||
{{ if (not .comment.Time.Deleted) }} | ||
{{ if (or .ctx.IsAdmin (and .ctx.IsSigned (eq .ctx.SignedUserID .comment.PosterID))) }} | ||
<span class="ui float right"> | ||
<div class="ui mini modal issue-delete-time-modal" data-id="{{.comment.Time.ID}}"> | ||
<form method="POST" class="delete-time-form" action="{{.ctx.RepoLink}}/issues/{{.ctx.Issue.Index}}/times/{{.comment.TimeID}}/delete"> | ||
{{.ctx.CsrfTokenHtml}} | ||
</form> | ||
<div class="header">{{.ctx.i18n.Tr "repo.issues.del_time"}}</div> | ||
<div class="actions"> | ||
<div class="ui red approve button">{{.ctx.i18n.Tr "repo.issues.context.delete"}}</div> | ||
<div class="ui cancel button">{{.ctx.i18n.Tr "repo.issues.add_time_cancel"}}</div> | ||
</div> | ||
</div> | ||
<button class="ui icon button compact mini issue-delete-time poping up" data-id="{{.comment.Time.ID}}" data-content="{{.ctx.i18n.Tr "repo.issues.del_time"}}" data-position="top right" data-variation="tiny inverted"> | ||
{{svg "octicon-trashcan"}} | ||
</button> | ||
</span> | ||
{{end}} | ||
{{end}} | ||
{{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
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
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.