diff options
author | silverwind <me@silverwind.io> | 2020-11-15 19:11:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-15 13:11:58 -0500 |
commit | 50cbb204812f465ea00b2ffd31db58378e17f27b (patch) | |
tree | 345b4ac7d08abf0a959be7b1271b1b9991d425b9 /templates | |
parent | f0ed71251ec1bd71f1f3c9cb12e17ca8f5e1cf3c (diff) | |
download | gitea-50cbb204812f465ea00b2ffd31db58378e17f27b.tar.gz gitea-50cbb204812f465ea00b2ffd31db58378e17f27b.zip |
Fix issue label rendering (#13570)
* Fix issue label rendering
Prevent rendering of inactive labels and make them wrap inline.
Fixes: https://github.com/go-gitea/gitea/issues/13566
* also don't render the placeholder
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/issue/new_form.tmpl | 8 | ||||
-rw-r--r-- | templates/repo/issue/view_content/sidebar.tmpl | 21 |
2 files changed, 19 insertions, 10 deletions
diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl index 9540716e54..e585fc7359 100644 --- a/templates/repo/issue/new_form.tmpl +++ b/templates/repo/issue/new_form.tmpl @@ -73,10 +73,14 @@ <div class="ui labels list"> <span class="no-select item {{if .HasSelectedLabel}}hide{{end}}">{{.i18n.Tr "repo.issues.new.no_label"}}</span> {{range .Labels}} - <a class="{{if not .IsChecked}}hide{{end}} item" id="label_{{.ID}}" href="{{$.RepoLink}}/issues?labels={{.ID}}"><span class="label color" style="background-color: {{.Color}}"></span> <span class="text">{{.Name | RenderEmoji}}</span></a> + {{if .IsChecked}} + <a class="item" id="label_{{.ID}}" href="{{$.RepoLink}}/issues?labels={{.ID}}"><span class="label color" style="background-color: {{.Color}}"></span> <span class="text">{{.Name | RenderEmoji}}</span></a> + {{end}} {{end}} {{range .OrgLabels}} - <a class="{{if not .IsChecked}}hide{{end}} item" id="label_{{.ID}}" href="/issues?labels={{.ID}}"><span class="label color" style="background-color: {{.Color}}"></span> <span class="text">{{.Name | RenderEmoji}}</span></a> + {{if .IsChecked}} + <a class="item" id="label_{{.ID}}" href="/issues?labels={{.ID}}"><span class="label color" style="background-color: {{.Color}}"></span> <span class="text">{{.Name | RenderEmoji}}</span></a> + {{end}} {{end}} </div> diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index 55884f3fa1..21c7a9d365 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -126,17 +126,22 @@ </div> </div> <div class="ui labels list"> - <span class="no-select item {{if .HasSelectedLabel}}hide{{end}}">{{.i18n.Tr "repo.issues.new.no_label"}}</span> + {{if not .HasSelectedLabel}} + <span class="no-select item">{{.i18n.Tr "repo.issues.new.no_label"}}</span> + {{end}} {{range .Labels}} - <div class="item"> - <a class="ui label {{if not .IsChecked}}hide{{end}}" id="label_{{.ID}}" href="{{$.RepoLink}}/{{if $.Issue.IsPull}}pulls{{else}}issues{{end}}?labels={{.ID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}}" title="{{.Description | RenderEmojiPlain}}">{{.Name | RenderEmoji}}</a> - </div> + {{if .IsChecked}} + <div class="item"> + <a class="ui label" id="label_{{.ID}}" href="{{$.RepoLink}}/{{if $.Issue.IsPull}}pulls{{else}}issues{{end}}?labels={{.ID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}}" title="{{.Description | RenderEmojiPlain}}">{{.Name | RenderEmoji}}</a> + </div> + {{end}} {{end}} {{range .OrgLabels}} - <div class="item"> - <a class="ui label {{if not .IsChecked}}hide{{end}}" id="label_{{.ID}}" href="{{$.RepoLink}}/{{if $.Issue.IsPull}}pulls{{else}}issues{{end}}?labels={{.ID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}}" title="{{.Description | RenderEmojiPlain}}">{{.Name | RenderEmoji}}</a> - </div> - + {{if .IsChecked}} + <div class="item"> + <a class="ui label" id="label_{{.ID}}" href="{{$.RepoLink}}/{{if $.Issue.IsPull}}pulls{{else}}issues{{end}}?labels={{.ID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}}" title="{{.Description | RenderEmojiPlain}}">{{.Name | RenderEmoji}}</a> + </div> + {{end}} {{end}} </div> |