Skip to content

Commit 4265297

Browse files
committed
fix
1 parent ca47b74 commit 4265297

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

templates/repo/home.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,18 +145,18 @@
145145
{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}<button id="manage_topic" class="btn interact-fg tw-text-12">{{ctx.Locale.Tr "repo.topic.manage_topics"}}</button>{{end}}
146146
{{end}}
147147
{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}
148-
<div class="ui form tw-hidden tw-flex tw-gap-2 tw-my-2" id="topic_edit">
148+
<div class="ui form tw-hidden flex-item-body tw-gap-2 tw-my-2" id="topic_edit">
149149
<div class="ui fluid multiple search selection dropdown tw-flex-wrap tw-flex-1">
150150
<input type="hidden" name="topics" value="{{range $i, $v := .Topics}}{{.Name}}{{if Eval $i "+" 1 "<" (len $.Topics)}},{{end}}{{end}}">
151151
{{range .Topics}}
152152
{{/* keep the same layout as Fomantic UI generated labels */}}
153-
<a class="ui label transition visible tw-cursor-default tw-inline-block" data-value="{{.Name}}">{{.Name}}{{svg "octicon-x" 16 "delete icon"}}</a>
153+
<a class="ui label transition visible tw-cursor-default tw-inline-block repo-topic" data-value="{{.Name}}">{{.Name}}{{svg "octicon-x" 16 "delete icon"}}</a>
154154
{{end}}
155155
<div class="text"></div>
156156
</div>
157157
<div>
158-
<button class="ui basic button" id="cancel_topic_edit">{{ctx.Locale.Tr "cancel"}}</button>
159158
<button class="ui primary button" id="save_topic" data-link="{{.RepoLink}}/topics">{{ctx.Locale.Tr "save"}}</button>
159+
<button class="ui basic button" id="cancel_topic_edit">{{ctx.Locale.Tr "cancel"}}</button>
160160
</div>
161161
</div>
162162
{{end}}

web_src/js/features/repo-home.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ export function initRepoTopicBar() {
4646
topicArray.sort();
4747
for (const topic of topicArray) {
4848
// it should match the code in repo/home.tmpl
49+
// TODO: sort items in topicDropdown, or items in edit div will have different order to the items in view div
4950
const link = document.createElement('a');
5051
link.classList.add('repo-topic', 'ui', 'large', 'label');
5152
link.href = `${appSubUrl}/explore/repos?q=${encodeURIComponent(topic)}&topic=1`;
5253
link.textContent = topic;
53-
viewDiv.append(link); // insert all new topics before manage button
54+
viewDiv.append(link);
5455
}
5556
}
5657
hideElem(editDiv);

0 commit comments

Comments
 (0)