forked from forgejo/forgejo
Fix repolist icons (#12228)
Fixes: https://github.com/go-gitea/gitea/issues/12226
This commit is contained in:
parent
a60f506dd7
commit
48ad76c25e
3 changed files with 30 additions and 6 deletions
|
@ -19,6 +19,7 @@ import initTableSort from './features/tablesort.js';
|
|||
import ActivityTopAuthors from './components/ActivityTopAuthors.vue';
|
||||
import {initNotificationsTable, initNotificationCount} from './features/notification.js';
|
||||
import {createCodeEditor} from './features/codeeditor.js';
|
||||
import {svgs} from './svg.js';
|
||||
|
||||
const {AppSubUrl, StaticUrlPrefix, csrf} = window.config;
|
||||
|
||||
|
@ -2625,6 +2626,15 @@ function linkEmailAction(e) {
|
|||
}
|
||||
|
||||
function initVueComponents() {
|
||||
// register svg icon vue components, e.g. <octicon-repo size="16"/>
|
||||
for (const [name, htmlString] of Object.entries(svgs)) {
|
||||
const template = htmlString
|
||||
.replace(/height="[0-9]+"/, 'v-bind:height="size"')
|
||||
.replace(/width="[0-9]+"/, 'v-bind:width="size"');
|
||||
|
||||
Vue.component(name, {props: ['size'], template});
|
||||
}
|
||||
|
||||
const vueDelimeters = ['${', '}'];
|
||||
|
||||
Vue.component('repo-search', {
|
||||
|
@ -2950,7 +2960,7 @@ function initVueComponents() {
|
|||
});
|
||||
},
|
||||
|
||||
repoClass(repo) {
|
||||
repoIcon(repo) {
|
||||
if (repo.fork) {
|
||||
return 'octicon-repo-forked';
|
||||
} else if (repo.mirror) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue