Fix label list divider (#25312)

We only needs 2 lines to hide the dividers.

```
  $dropdownLabelFilter.dropdown('setting', {'hideDividers': 'empty'});
  $dropdownLabelFilter.dropdown('refreshItems');
```

Other code blocks are refactored by the way.


![image](https://github.com/go-gitea/gitea/assets/2114189/74989996-fcea-4df4-b534-b06f7957939a)


![image](https://github.com/go-gitea/gitea/assets/2114189/ee3b3761-b96e-4fb5-b646-e9d3117e5f40)
pull/25327/head^2
wxiaoguang 1 year ago committed by GitHub
parent a5d0246fff
commit bfab129fb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      templates/repo/issue/list.tmpl
  2. 1
      web_src/css/repo.css
  3. 1
      web_src/js/features/repo-issue.js

@ -102,12 +102,13 @@
<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_label"}}"> <input type="text" placeholder="{{.locale.Tr "repo.issues.filter_label"}}">
</div> </div>
<span class="info">{{.locale.Tr "repo.issues.filter_label_exclude" | Safe}}</span> <span class="info">{{.locale.Tr "repo.issues.filter_label_exclude" | Safe}}</span>
<div class="ui divider"></div>
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels=0&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_label_select_no_label"}}</a> <a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels=0&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_label_select_no_label"}}</a>
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_label_no_select"}}</a> <a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_label_no_select"}}</a>
{{$previousExclusiveScope := "_no_scope"}} {{$previousExclusiveScope := "_no_scope"}}
{{range .Labels}} {{range .Labels}}
{{$exclusiveScope := .ExclusiveScope}} {{$exclusiveScope := .ExclusiveScope}}
{{if and (ne $previousExclusiveScope "_no_scope") (ne $previousExclusiveScope $exclusiveScope)}} {{if and (ne $previousExclusiveScope $exclusiveScope)}}
<div class="ui divider"></div> <div class="ui divider"></div>
{{end}} {{end}}
{{$previousExclusiveScope = $exclusiveScope}} {{$previousExclusiveScope = $exclusiveScope}}

@ -149,7 +149,6 @@
.repository .filter.menu.labels .label-filter .menu .info { .repository .filter.menu.labels .label-filter .menu .info {
display: inline-block; display: inline-block;
padding: 0.5rem 0.25rem; padding: 0.5rem 0.25rem;
border-bottom: 1px solid var(--color-secondary);
font-size: 12px; font-size: 12px;
width: 100%; width: 100%;
white-space: nowrap; white-space: nowrap;

@ -149,6 +149,7 @@ export function initRepoIssueSidebarList() {
} }
} }
}); });
$('.ui.dropdown.label-filter').dropdown('setting', {'hideDividers': 'empty'}).dropdown('refreshItems');
} }
export function initRepoIssueCommentDelete() { export function initRepoIssueCommentDelete() {

Loading…
Cancel
Save