mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 16:44:28 +00:00
Merge branch 'feature-25999/C4_cleanup' into feature-25999/C4_cleanup_merge_anrechnungen_bs5
This commit is contained in:
@@ -2,7 +2,3 @@
|
||||
color: #565e647f !important;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.mylv_dropdown{
|
||||
margin-left: -5px !important;
|
||||
}
|
||||
@@ -123,18 +123,18 @@ export default {
|
||||
<div class="card-body " :style="bodyStyle">
|
||||
<ul class="list-group border-top-0 border-bottom-0 rounded-0">
|
||||
<template v-if="menu">
|
||||
<li :type="menuItem.c4_link ? 'button' : null" v-for="menuItem in menu" class="list-group-item border-0 ">
|
||||
<div class="d-flex flex-row" >
|
||||
<li :type="menuItem.c4_link ? 'button' : null" v-for="menuItem in menu" class="list-group-item border-0 " >
|
||||
<div class="d-flex flex-row" :data-bs-toggle="menuItem.c4_moodle_links?.length ? 'dropdown' : null">
|
||||
<div class="mx-4">
|
||||
<i :class="[menuItem.c4_icon2 ? menuItem.c4_icon2 : 'fa-solid fa-pen-to-square', !menuItem.c4_link ? 'unavailable' : null ]"></i>
|
||||
</div>
|
||||
<a class="text-decoration-none text-truncate" :id="'moodle_links_'+lehrveranstaltung_id" :data-bs-toggle="menuItem.c4_moodle_links?.length ? 'dropdown' : null" :class="{'link-dark':menuItem.c4_link, 'unavailable':!menuItem.c4_link, 'dropdown-toggle':menuItem.c4_moodle_links?.length }" :target="menuItem.c4_target" :href="menuItem.c4_link ? !menuItem.c4_moodle_links?.length && menuItem.c4_link : null">
|
||||
<a class="text-decoration-none text-truncate" :id="'moodle_links_'+lehrveranstaltung_id" :class="{'link-dark':menuItem.c4_link, 'unavailable':!menuItem.c4_link, 'dropdown-toggle':menuItem.c4_moodle_links?.length }" :target="menuItem.c4_target" :href="menuItem.c4_link ? !menuItem.c4_moodle_links?.length && menuItem.c4_link : null">
|
||||
{{menuItem.name}}
|
||||
</a>
|
||||
<ul v-if="menuItem.c4_moodle_links?.length" class="dropdown-menu p-0 mylv_dropdown" :aria-labelledby="'moodle_links_'+lehrveranstaltung_id">
|
||||
<li v-for="item in menuItem.c4_moodle_links"><a class="dropdown-item border-bottom" :href="item.url">{{item.lehrform_kurzbz}}</a></li>
|
||||
</div>
|
||||
<ul v-if="menuItem.c4_moodle_links?.length" class="dropdown-menu p-0" :aria-labelledby="'moodle_links_'+lehrveranstaltung_id">
|
||||
<li v-for="item in menuItem.c4_moodle_links"><a class="dropdown-item border-bottom" :href="item.url">{{item.lehrform}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
</template>
|
||||
<template v-else>
|
||||
|
||||
@@ -5,6 +5,7 @@ export default {
|
||||
data: () => ({
|
||||
title_input: "",
|
||||
url_input: "",
|
||||
invalidURL: false,
|
||||
}),
|
||||
mixins: [AbstractWidget],
|
||||
computed: {
|
||||
@@ -35,6 +36,15 @@ export default {
|
||||
if ((await this.$fhcAlert.confirmDelete()) === false) return;
|
||||
},
|
||||
addLink() {
|
||||
// reset is-invalid css on url input field
|
||||
this.invalidURL = false;
|
||||
|
||||
if(!URL.canParse(this.url_input))
|
||||
{
|
||||
this.$fhcAlert.alertError(this.$p.t("bookmark", "invalidUrl"));
|
||||
this.invalidURL = true;
|
||||
return;
|
||||
}
|
||||
this.$fhcApi.factory.bookmark
|
||||
.insert({
|
||||
tag: this.config.tag,
|
||||
@@ -83,7 +93,10 @@ export default {
|
||||
<header><b>{{$p.t('bookmark','newLink')}}</b></header><br>
|
||||
<div>
|
||||
<input class="form-control form-control-sm" placeholder="Titel" type="text" v-model="title_input" name="title" maxlength="50" required>
|
||||
<input class="form-control form-control-sm mt-2" type="url" placeholder="URL" v-model="url_input" name="url" required>
|
||||
<input required id="bookmark_link" class="form-control form-control-sm mt-2" :class="{'is-invalid':invalidURL}" type="url" placeholder="URL" v-model="url_input" name="url">
|
||||
<div class="invalid-feedback">
|
||||
{{$p.t("bookmark", "invalidUrl")}}.
|
||||
</div>
|
||||
<button class="btn btn-outline-secondary btn-sm w-100 mt-2" @click="addLink" type="button">{{$p.t('bookmark','saveLink')}}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user