1
0
Fork 0
forked from forgejo/forgejo

Dropdowns, Labels fixes and more CSS tweaks (#13733)

* Dropdowns and Labels fixes

- Rework dropdown, menu and label styles
- Improve issue sidebar milestone and label sections
- Fix archived repo and private org badge
- Move more colors to CSS vars
- Move issue number to end of title on issue page

* more dropdown fixes

* fix basic blue labels - fixes #13731

* improve class setting on svg

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
silverwind 2020-11-29 07:22:04 +01:00 committed by GitHub
parent da4bb6fc4e
commit e00a355427
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 416 additions and 520 deletions

View file

@ -517,20 +517,23 @@ function initCommentForm() {
$(this).data('id'),
).then(reload);
}
switch (input_id) {
case '#milestone_id':
$list.find('.selected').html(`<a class="item" href=${$(this).data('href')}>${
htmlEscape($(this).text())}</a>`);
break;
case '#project_id':
$list.find('.selected').html(`<a class="item" href=${$(this).data('href')}>${
htmlEscape($(this).text())}</a>`);
break;
case '#assignee_id':
$list.find('.selected').html(`<a class="item" href=${$(this).data('href')}>` +
`<img class="ui avatar image" src=${$(this).data('avatar')}>${
htmlEscape($(this).text())}</a>`);
let icon = '';
if (input_id === '#milestone_id') {
icon = svg('octicon-milestone', 18, 'mr-3');
} else if (input_id === '#project_id') {
icon = svg('octicon-project', 18, 'mr-3');
} else if (input_id === '#assignee_id') {
icon = `<img class="ui avatar image mr-3" src=${$(this).data('avatar')}>`;
}
$list.find('.selected').html(`
<a class="item muted sidebar-item-link" href=${$(this).data('href')}>
${icon}
${htmlEscape($(this).text())}
</a>
`);
$(`.ui${select_id}.list .no-select`).addClass('hide');
$(input_id).val($(this).data('id'));
});
@ -3324,7 +3327,7 @@ function initTopicbar() {
const last = viewDiv.children('a').last();
for (let i = 0; i < topicArray.length; i++) {
const link = $('<a class="ui repo-topic small label topic"></a>');
const link = $('<a class="ui repo-topic large label topic"></a>');
link.attr('href', `${AppSubUrl}/explore/repos?q=${encodeURIComponent(topicArray[i])}&topic=1`);
link.text(topicArray[i]);
link.insertBefore(last);