Improve "Reference in new issue" modal (#30547) (#30574)

Backport #30547 by @silverwind

Fixes: https://github.com/go-gitea/gitea/issues/29994

Also some misc enhancements done to the form in the modal.

<img width="840" alt="Screenshot 2024-04-17 at 23 02 55"
src="https://github.com/go-gitea/gitea/assets/115237/e71fba55-55cd-4e48-a497-6b1025c36a43">

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 42019677e6cce6ae44a922e68b91d2a002450fa0)
This commit is contained in:
Giteabot 2024-04-19 03:58:37 +08:00 committed by Earl Warren
parent 6ad7758117
commit f31879069f
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
2 changed files with 23 additions and 18 deletions

View file

@ -5,26 +5,24 @@
<div class="content tw-text-left"> <div class="content tw-text-left">
<form class="ui form form-fetch-action" action="{{printf "%s/issues/new" .Repository.Link}}" method="post"> <form class="ui form form-fetch-action" action="{{printf "%s/issues/new" .Repository.Link}}" method="post">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<div class="ui segment content">
<div class="field"> <div class="field">
<span class="text"><strong>{{ctx.Locale.Tr "repository"}}</strong></span> <label><strong>{{ctx.Locale.Tr "repository"}}</strong></label>
<div class="ui search normal selection dropdown issue_reference_repository_search"> <div class="ui search selection dropdown issue_reference_repository_search">
<div class="default text">{{.Repository.FullName}}</div> <div class="default text">{{.Repository.FullName}}</div>
<div class="menu"></div> <div class="menu"></div>
</div> </div>
</div> </div>
<div class="field"> <div class="field">
<span class="text"><strong>{{ctx.Locale.Tr "repo.milestones.title"}}</strong></span> <label><strong>{{ctx.Locale.Tr "repo.milestones.title"}}</strong></label>
<input name="title" value="" autofocus required maxlength="255" autocomplete="off"> <input name="title" value="" autofocus required maxlength="255" autocomplete="off">
</div> </div>
<div class="field"> <div class="field">
<span class="text"><strong>{{ctx.Locale.Tr "repo.issues.reference_issue.body"}}</strong></span> <label><strong>{{ctx.Locale.Tr "repo.issues.reference_issue.body"}}</strong></label>
<textarea name="content" class="form-control"></textarea> <textarea name="content" class="form-control"></textarea>
</div> </div>
<div class="text right"> <div class="text right">
<button class="ui primary button">{{ctx.Locale.Tr "repo.issues.create"}}</button> <button class="ui primary button">{{ctx.Locale.Tr "repo.issues.create"}}</button>
</div> </div>
</div>
</form> </form>
</div> </div>
</div> </div>

View file

@ -496,6 +496,7 @@ ol.ui.list li,
.ui.selection.dropdown .menu > .item { .ui.selection.dropdown .menu > .item {
border-color: var(--color-secondary); border-color: var(--color-secondary);
white-space: nowrap;
} }
.ui.selection.visible.dropdown > .text:not(.default) { .ui.selection.visible.dropdown > .text:not(.default) {
@ -517,6 +518,12 @@ ol.ui.list li,
color: var(--color-text-light-2); color: var(--color-text-light-2);
} }
.ui.dropdown > .text {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* extend fomantic style '.ui.dropdown > .text > img' to include svg.img */ /* extend fomantic style '.ui.dropdown > .text > img' to include svg.img */
.ui.dropdown > .text > .img { .ui.dropdown > .text > .img {
margin-left: 0; margin-left: 0;