summaryrefslogtreecommitdiffstats
path: root/web_src/js/components/ContextPopup.vue
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2023-09-02 16:59:07 +0200
committerGitHub <noreply@github.com>2023-09-02 16:59:07 +0200
commit9a3de436f452144933888fb1e4f336efeb93293a (patch)
treee49c4037604de030a8552a5deca180c240c28484 /web_src/js/components/ContextPopup.vue
parentMake it posible to customize nav text color via css var (#26807) (diff)
downloadforgejo-9a3de436f452144933888fb1e4f336efeb93293a.tar.xz
forgejo-9a3de436f452144933888fb1e4f336efeb93293a.zip
Reorder blocks in vue SFCs (#26874)
The [recommended order](https://vuejs.org/guide/scaling-up/sfc.html) for SFC blocks is script -> template -> style, which we were violating because template and script were swapped. I do find script first also easier to read because the imports are on top, letting me immideatly see a component's dependencies. This is a pure cut-paste refactor with some removal of some empty lines. --------- Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'web_src/js/components/ContextPopup.vue')
-rw-r--r--web_src/js/components/ContextPopup.vue49
1 files changed, 24 insertions, 25 deletions
diff --git a/web_src/js/components/ContextPopup.vue b/web_src/js/components/ContextPopup.vue
index b6852655f6..303e6d0c89 100644
--- a/web_src/js/components/ContextPopup.vue
+++ b/web_src/js/components/ContextPopup.vue
@@ -1,28 +1,3 @@
-<template>
- <div ref="root">
- <div v-if="loading" class="ui active centered inline loader"/>
- <div v-if="!loading && issue !== null">
- <p><small>{{ issue.repository.full_name }} on {{ createdAt }}</small></p>
- <p><svg-icon :name="icon" :class="['text', color]"/> <strong>{{ issue.title }}</strong> #{{ issue.number }}</p>
- <p>{{ body }}</p>
- <div>
- <div
- v-for="label in labels"
- :key="label.name"
- class="ui label"
- :style="{ color: label.textColor, backgroundColor: label.color }"
- >
- {{ label.name }}
- </div>
- </div>
- </div>
- <div v-if="!loading && issue === null">
- <p><small>{{ i18nErrorOccurred }}</small></p>
- <p>{{ i18nErrorMessage }}</p>
- </div>
- </div>
-</template>
-
<script>
import $ from 'jquery';
import {SvgIcon} from '../svg.js';
@@ -115,3 +90,27 @@ export default {
}
};
</script>
+<template>
+ <div ref="root">
+ <div v-if="loading" class="ui active centered inline loader"/>
+ <div v-if="!loading && issue !== null">
+ <p><small>{{ issue.repository.full_name }} on {{ createdAt }}</small></p>
+ <p><svg-icon :name="icon" :class="['text', color]"/> <strong>{{ issue.title }}</strong> #{{ issue.number }}</p>
+ <p>{{ body }}</p>
+ <div>
+ <div
+ v-for="label in labels"
+ :key="label.name"
+ class="ui label"
+ :style="{ color: label.textColor, backgroundColor: label.color }"
+ >
+ {{ label.name }}
+ </div>
+ </div>
+ </div>
+ <div v-if="!loading && issue === null">
+ <p><small>{{ i18nErrorOccurred }}</small></p>
+ <p>{{ i18nErrorMessage }}</p>
+ </div>
+ </div>
+</template>