mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-23 11:01:49 +01:00
Merge pull request 'Improve git notes UI' (#6025) from 0ko/forgejo:ui-notes-followup into forgejo
Some checks are pending
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
/ release (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
Some checks are pending
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
/ release (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6025 Reviewed-by: Michael Kriese <michael.kriese@gmx.de> Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
This commit is contained in:
commit
3674e90c93
3 changed files with 9 additions and 8 deletions
|
@ -2622,9 +2622,9 @@ diff.browse_source = Browse source
|
|||
diff.parent = parent
|
||||
diff.commit = commit
|
||||
diff.git-notes = Notes
|
||||
diff.git-notes.add = Add Note
|
||||
diff.git-notes.remove-header = Remove Note
|
||||
diff.git-notes.remove-body = This will remove this Note
|
||||
diff.git-notes.add = Add note
|
||||
diff.git-notes.remove-header = Remove note
|
||||
diff.git-notes.remove-body = This note will be removed.
|
||||
diff.data_not_available = Diff content is not available
|
||||
diff.options_button = Diff options
|
||||
diff.show_diff_stats = Show stats
|
||||
|
|
|
@ -128,6 +128,9 @@
|
|||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="commit-notes-add-button" class="item">
|
||||
{{ctx.Locale.Tr "repo.diff.git-notes.add"}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
@ -277,20 +280,20 @@
|
|||
<span class="text grey" id="note-authored-time">{{DateUtils.TimeSince .NoteCommit.Author.When}}</span>
|
||||
{{if or ($.Permission.CanWrite $.UnitTypeCode) (not $.Repository.IsArchived) (not .IsDeleted)}}
|
||||
<div class="ui right">
|
||||
<button id="commit-notes-edit-button" class="ui tiny button yellow" data-modal="#delete-note-modal">{{ctx.Locale.Tr "edit"}}</button>
|
||||
<button id="commit-notes-edit-button" class="ui tiny primary button" data-modal="#delete-note-modal">{{ctx.Locale.Tr "edit"}}</button>
|
||||
<button class="ui tiny button red show-modal" data-modal="#delete-note-modal">{{ctx.Locale.Tr "remove"}}</button>
|
||||
</div>
|
||||
<div class="ui small modal" id="delete-note-modal">
|
||||
<div class="header">
|
||||
{{ctx.Locale.Tr "repo.diff.git-notes.remove-header"}}
|
||||
</div>
|
||||
<p>{{ctx.Locale.Tr "repo.diff.git-notes.remove-body"}}</p>
|
||||
<div class="content">
|
||||
<p>{{ctx.Locale.Tr "repo.diff.git-notes.remove-body"}}</p>
|
||||
<div class="text right actions">
|
||||
<form action="{{.Link}}/notes/remove" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<button type="button" class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
|
||||
<button type="submit" class="ui primary button red" href="{{.Link}}/notes/remove">{{ctx.Locale.Tr "remove"}}</button>
|
||||
<button type="submit" class="ui red button" href="{{.Link}}/notes/remove">{{ctx.Locale.Tr "remove"}}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -316,7 +319,6 @@
|
|||
</div>
|
||||
{{end}}
|
||||
{{else if and ($.Permission.CanWrite $.UnitTypeCode) (not $.Repository.IsArchived) (not .IsDeleted)}}
|
||||
<button id="commit-notes-add-button" class="ui primary button green tw-mt-3">{{ctx.Locale.Tr "repo.diff.git-notes.add"}}</button>
|
||||
<div id="commit-notes-add-area" class="ui tw-mt-3 segment tw-hidden">
|
||||
<form class="ui form" action="{{.Link}}/notes" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
|
|
|
@ -38,7 +38,6 @@ export function initCommitNotes() {
|
|||
const notesAddButton = document.getElementById('commit-notes-add-button');
|
||||
if (notesAddButton !== null) {
|
||||
notesAddButton.addEventListener('click', () => {
|
||||
notesAddButton.classList.add('tw-hidden');
|
||||
document.getElementById('commit-notes-add-area').classList.remove('tw-hidden');
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue