From 2c78c2d07579186caad5519e8843a2f583fe6bc0 Mon Sep 17 00:00:00 2001
From: alex <alex@alexloehr.net>
Date: Mon, 30 Jun 2025 13:58:36 +0000
Subject: [PATCH] adding script to npm run
---
vue/src/pages/KursDetail.vue | 56 +++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 41 insertions(+), 15 deletions(-)
diff --git a/vue/src/pages/KursDetail.vue b/vue/src/pages/KursDetail.vue
index 1393176..48cca6f 100644
--- a/vue/src/pages/KursDetail.vue
+++ b/vue/src/pages/KursDetail.vue
@@ -2,7 +2,9 @@
import {useRoute} from 'vue-router'
import {onMounted, reactive, ref} from "vue"
-import {getKurs, getKursItems, getKursTn} from "../lib/api.js"
+import {getKurs, getKursItems, getKursTn, iliasBase, routerBase} from "../lib/api.js"
+import LinkExtern from "../components/LinkExtern.vue"
+import dayjs from "dayjs"
const route = useRoute()
const kursId = route.params.kursId
@@ -27,7 +29,10 @@
const dataKursTn = await getKursTn(kursId)
console.log(dataKursTn)
kursTn.value = dataKursTn
+
}
+
+const aaa = import.meta.env.VITE_TST
</script>
@@ -37,7 +42,6 @@
<h1>
Kurs
<small>{{ kurs?.title }}</small>
- <!-- <small>{{ user?.firstname }} {{ user?.lastname }}</small>-->
</h1>
<p v-if="error">{{ error }}</p>
@@ -45,7 +49,12 @@
<div class="user" v-if="kurs">
<span>ref_id</span>
- <div>{{ kurs.ref_id }}</div>
+ <div>
+ <a :href="`${iliasBase}/goto.php?target=${kurs.type}_${kurs.ref_id}`" target="_blank">
+ {{ kurs.ref_id }}
+ <LinkExtern />
+ </a>
+ </div>
<span>obj_id</span>
<div>{{ kurs.obj_id }}</div>
@@ -64,17 +73,24 @@
</h2>
<table>
<thead>
- <th>parent_id</th>
- <th>ref_id</th>
- <th>obj_id</th>
- <th>title</th>
- <th>type</th>
+ <tr>
+ <th>parent_id</th>
+ <th>ref_id</th>
+ <th>obj_id</th>
+ <th>title</th>
+ <th>type</th>
+ </tr>
</thead>
<tbody>
<!-- TODO verlinken auf Ziel in ILAS | goto.php?target=crs_ID -->
<tr v-for="item in kursItems">
<td>{{ item.parent_id }}</td>
- <td>{{ item.ref_id }}</td>
+ <td>
+ <a :href="`${iliasBase}/goto.php?target=${item.type}_${item.ref_id}`" target="_blank">
+ {{ item.ref_id }}
+ <LinkExtern />
+ </a>
+ </td>
<td>{{ item.obj_id }}</td>
<td>{{ item.title }}</td>
<td>{{ item.type }}</td>
@@ -86,20 +102,30 @@
KursTn
<small>({{ kursTn?.length }})</small>
</h2>
- <div :style="{columns: kursTn?.length > 16 ? 3 : 1}">
+ <div :style="{columns: kursTn?.length > 16 ? 1 : 1}">
<table>
<thead>
- <th>usr_id</th>
- <th>login</th>
- <th>firstname</th>
- <th>lastname</th>
+ <tr>
+ <th>usr_id</th>
+ <th>login</th>
+ <th>firstname</th>
+ <th>lastname</th>
+ <th>passed</th>
+ <th>status</th>
+ <th>status_changed</th>
+ </tr>
</thead>
<tbody>
<tr v-for="tn in kursTn">
- <td>{{ tn.usr_id }}</td>
+ <td>
+ <RouterLink :to="`${routerBase}/ui/user/${tn.usr_id}`">{{ tn.usr_id }}</RouterLink>
+ </td>
<td>{{ tn.login }}</td>
<td>{{ tn.firstname }}</td>
<td>{{ tn.lastname }}</td>
+ <td>{{ tn.passed }}</td>
+ <td>{{ tn.status }}</td>
+ <td>{{ dayjs(tn.status_changed).format("DD.MM.YYYY HH:mm:ss") }}</td>
</tr>
</tbody>
</table>
--
Gitblit v1.8.0