mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 08:22:17 +00:00
always show card header of widgets as in editMode but enable certain tools only when actually in editMode. editMode is active for dashboard not for section; less paddings overall in dashboard; deleted Section headers and put cog besides personal greeting; reformatted name var for greeting into generic viewData property;
This commit is contained in:
@@ -34,7 +34,10 @@ class Cis4 extends Auth_Controller
|
||||
show_error("name couldn't be loaded for username ".getAuthUID());
|
||||
}
|
||||
$begruesung = getData($begruesung);
|
||||
$viewData = array(
|
||||
'name' => $begruesung
|
||||
);
|
||||
|
||||
$this->load->view('CisVue/Dashboard.php',["name"=> $begruesung]);
|
||||
$this->load->view('CisVue/Dashboard.php',['viewData' => $viewData]);
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,11 @@ class Dashboard extends Auth_Controller
|
||||
show_error("name couldn't be loaded for username ".getAuthUID());
|
||||
}
|
||||
$begruesung = getData($begruesung);
|
||||
$this->load->view('CisVue/Dashboard.php',["name"=> $begruesung]);
|
||||
$viewData = array(
|
||||
'name' => $begruesung
|
||||
);
|
||||
|
||||
$this->load->view('CisVue/Dashboard.php', ['viewData' => $viewData]);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -13,9 +13,7 @@ $this->load->view('templates/CISVUE-Header', $includesArray);
|
||||
?>
|
||||
|
||||
<div id="content">
|
||||
<h2>Hallo <?= $name?>!</h2>
|
||||
<hr>
|
||||
<fhc-dashboard dashboard="CIS"/>
|
||||
<fhc-dashboard dashboard="CIS" view-data-string='<?php echo json_encode($viewData) ?>' />
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('templates/CISVUE-Footer', $includesArray); ?>
|
||||
|
||||
@@ -48,7 +48,7 @@ export default {
|
||||
template: /*html*/`
|
||||
<div class="calendar-header card-header w-100" :class="classHeader">
|
||||
<div class="row align-items-center ">
|
||||
<div class="col offset-0 offset-md-3" :style="{'padding-left':headerPadding}">
|
||||
<div class="col offset-0" :style="{'padding-left':headerPadding}">
|
||||
<div class="row align-items-center justify-content-center">
|
||||
<div class="col-auto ">
|
||||
<button class="btn btn-outline-secondary border-0" :class="{'btn-sm':!this.size}" @click="$emit('prev')"><i class="fa fa-chevron-left"></i></button>
|
||||
|
||||
@@ -9,11 +9,21 @@ export default {
|
||||
},
|
||||
props: [
|
||||
"dashboard",
|
||||
"viewDataString"
|
||||
],
|
||||
data: () => ({
|
||||
sections: [],
|
||||
widgets: null
|
||||
}),
|
||||
data() {
|
||||
return {
|
||||
sections: [],
|
||||
widgets: null,
|
||||
viewData: JSON.parse(this.viewDataString),
|
||||
editMode: false
|
||||
}
|
||||
},
|
||||
provide() {
|
||||
return {
|
||||
editMode: Vue.computed(()=>this.editMode),
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
apiurl() {
|
||||
return FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/dashboard';
|
||||
@@ -142,6 +152,10 @@ export default {
|
||||
},
|
||||
template: `
|
||||
<div class="core-dashboard">
|
||||
<h3>
|
||||
{{ $p.t('global/personalGreeting', [ viewData?.name ]) }}
|
||||
<button style="margin-left: 8px;" class="btn" @click="editMode = !editMode"><i class="fa-solid fa-gear"></i></button>
|
||||
</h3>
|
||||
<dashboard-section v-for="(section, index) in sections" :key="section.name" :seperator="index" :name="section.name" :widgets="section.widgets" @widgetAdd="widgetAdd" @widgetUpdate="widgetUpdate" @widgetRemove="widgetRemove"></dashboard-section>
|
||||
<dashboard-widget-picker ref="widgetpicker" :widgets="widgets"></dashboard-widget-picker>
|
||||
</div>`
|
||||
|
||||
@@ -113,19 +113,19 @@ export default {
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="!hidden || editMode" class="dashboard-item card overflow-hidden h-100" :class="arguments && arguments.className ? arguments.className : ''">
|
||||
<div v-if="editMode && widget" class="card-header d-flex ps-0 pe-2">
|
||||
<span drag-action="move" class="col-auto mx-2 px-2 cursor-move"><i class="fa-solid fa-grip-vertical"></i></span>
|
||||
<span class="col">{{ widget.setup.name }}</span>
|
||||
<div v-if="widget" class="card-header d-flex ps-0 pe-2">
|
||||
<span v-if="editMode" drag-action="move" class="col-auto mx-2 px-2 cursor-move"><i class="fa-solid fa-grip-vertical"></i></span>
|
||||
<span class="col mx-2 px-2">{{ widget.setup.name }}</span>
|
||||
<a v-if="hasConfig" class="col-auto px-1" href="#" @click.prevent="openConfig"><i class="fa-solid fa-gear"></i></a>
|
||||
<a v-if="custom" class="col-auto px-1" href="#" @click.prevent="$emit('remove')">
|
||||
<a v-if="custom && editMode" class="col-auto px-1" href="#" @click.prevent="$emit('remove')">
|
||||
<i class="fa-solid fa-trash"></i>
|
||||
</a>
|
||||
<div v-else class="col-auto px-1 form-switch">
|
||||
<div v-else-if="editMode" class="col-auto px-1 form-switch">
|
||||
<input class="form-check-input ms-0" type="checkbox" role="switch" id="flexSwitchCheckChecked" :checked="!hidden" @input="$emit('remove', hidden)">
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="ready" class="card-body overflow-hidden">
|
||||
<component :is="component" v-model:shared-data="sharedData" :config="arguments" :width="width" :height="height" @setConfig="setConfig" @change="changeConfigManually"></component>
|
||||
<div v-if="ready" class="card-body overflow-hidden" style="padding: 0px;">
|
||||
<component :is="component" v-model:shared-data="sharedData" :config="arguments" :width="width" :height="height" @setConfig="setConfig" @change="changeConfigManually"></component>
|
||||
</div>
|
||||
<div v-else class="card-body overflow-hidden text-center d-flex flex-column justify-content-center"><i class="fa-solid fa-spinner fa-pulse fa-3x"></i></div>
|
||||
<bs-modal v-if="hasConfig" ref="config" @hideBsModal="handleHideBsModal" @showBsModal="handleShowBsModal">
|
||||
|
||||
@@ -12,12 +12,15 @@ export default {
|
||||
adminMode: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
editMode: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
props: [
|
||||
"name",
|
||||
"widgets",
|
||||
"seperator"
|
||||
"widgets"
|
||||
],
|
||||
emits: [
|
||||
"widgetAdd",
|
||||
@@ -29,7 +32,6 @@ export default {
|
||||
configOpened: false,
|
||||
gridWidth: 1,
|
||||
gridHeight: null,
|
||||
editMode: this.adminMode
|
||||
}
|
||||
},
|
||||
provide() {
|
||||
@@ -41,7 +43,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
editModeIsActive() {
|
||||
return this.editMode && !this.configOpened
|
||||
return (this.editMode || this.adminMode) && !this.configOpened
|
||||
},
|
||||
getSectionStyle() {
|
||||
return 'margin-bottom: 8px;';
|
||||
@@ -191,12 +193,7 @@ export default {
|
||||
});
|
||||
},
|
||||
template: `
|
||||
<div v-if="seperator" class="fhc-seperator"/>
|
||||
<div class="dashboard-section" ref="container" :style="getSectionStyle">
|
||||
<h3>
|
||||
<span >{{$p.t('ui/section' + name)}}</span>
|
||||
<button style="margin-left: 8px;" class="btn" @click="editMode = !editMode"><i class="fa-solid fa-gear"></i></button>
|
||||
</h3>
|
||||
<drop-grid v-model:cols="gridWidth" :items="items" :placeholders="items_placeholders" :active="editModeIsActive" :resize-limit="checkResizeLimit" :margin-for-extra-row=".01" @rearrange-items="updatePositions" @gridHeight="gridHeight=$event" >
|
||||
<template #default="item" #default>
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ export default {
|
||||
}
|
||||
},
|
||||
template: /*html*/`
|
||||
<div class="widgets-ampel w-100 h-100">
|
||||
<div class="widgets-ampel w-100 h-100" style="padding: 1rem 1rem;">
|
||||
<div v-if="!configMode">
|
||||
<div v-if="activeAmpeln" class="d-flex flex-column justify-content-between">
|
||||
<div class="d-flex">
|
||||
|
||||
@@ -11,6 +11,9 @@ export default {
|
||||
}),
|
||||
mixins: [AbstractWidget],
|
||||
computed: {
|
||||
getNewsWidgetStyle() {
|
||||
return this.width == 1 ? "padding: 1rem 1rem;" : "padding: 0px;"
|
||||
},
|
||||
newsList() {
|
||||
//Return news amount depending on widget width and size
|
||||
let quantity = this.width;
|
||||
@@ -61,33 +64,26 @@ export default {
|
||||
this.$refs.newsModal.show();
|
||||
},
|
||||
},
|
||||
template: /*html*/ `<div class="widgets-news h-100">
|
||||
template: /*html*/ `<div class="widgets-news h-100" :style="getNewsWidgetStyle">
|
||||
|
||||
<div class="d-flex flex-column h-100 ">
|
||||
<div class="d-flex">
|
||||
<header><b>{{$p.t('news','topNews')}}</b></header>
|
||||
<a :href="allNewsURI()" class="ms-auto mb-2">
|
||||
<i class="fa fa-arrow-up-right-from-square me-1"></i>{{$p.t('news','allNews')}}</a>
|
||||
</div>
|
||||
<div class="h-100" style="overflow-y: auto" v-if="width == 1">
|
||||
<div v-for="news in newsList" :key="news.id" class="mt-2">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<a :href="contentURI(news.content_id)" class="stretched-link" >{{ news.content_obj.betreff?news.content_obj.betreff:getDate(news.insertamum) }}</a><br>
|
||||
<span class="small text-muted">{{ formatDateTime(news.insertamum) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-for="(news, index) in newsList" :key="news.id" class="mt-2">
|
||||
<div v-if="index > 0 " class="fhc-seperator"></div>
|
||||
<a :href="contentURI(news.content_id)" >{{ news.content_obj.betreff?news.content_obj.betreff:getDate(news.insertamum) }}</a><br>
|
||||
<span class="small text-muted">{{ formatDateTime(news.insertamum) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="width > 1 && height === 1" class="h-100" :class="'row row-cols-' + width">
|
||||
<div class="h-100" v-for="news in newsList" :key="news.id">
|
||||
|
||||
<div class="news-content h-100" :style="'--news-widget-height: '+height" ref="htmlContent" v-html="news.content_obj.content"></div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="h-100" :class="'row row-cols-' + width">
|
||||
<div class="news-content h-100" :style="'--news-widget-height: '+height" ref="htmlContent" v-html="news.content_obj.content"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="h-100" :class="'row row-cols-' + width + ' gx-2'">
|
||||
<div class="h-100" v-for="news in newsList" :key="news.id">
|
||||
<div class="news-content h-100" :style="'--news-widget-height: '+height" ref="htmlContent" v-html="news.content_obj.content"></div>
|
||||
</div>
|
||||
|
||||
@@ -189,7 +189,6 @@ export default {
|
||||
<div class="dashboard-widget-stundenplan d-flex flex-column h-100">
|
||||
<lv-modal v-if="selectedEvent" ref="lvmodal" :event="selectedEvent" />
|
||||
<content-modal :contentID="roomInfoContentID" :ort_kurzbz="" dialogClass="modal-lg" ref="contentModal"/>
|
||||
<header><b>{{ $p.t('lehre/stundenplan') }}</b></header>
|
||||
<fhc-calendar @change:range="updateRange" :initial-date="currentDay" class="border-0" class-header="p-0" @select:day="selectDay" v-model:minimized="minimized" :events="events" no-week-view :show-weeks="false" >
|
||||
<template #minimizedPage >
|
||||
<div class="flex-grow-1" style="overflow-y: auto; overflow-x: hidden">
|
||||
|
||||
@@ -108,11 +108,10 @@ export default {
|
||||
// this.$emit('setConfig', true); -> use this to enable widget config mode if needed
|
||||
},
|
||||
template: /*html*/ `
|
||||
<div class="widgets-url w-100 h-100">
|
||||
<div class="widgets-url w-100 h-100" style="padding: 1rem 1rem;">
|
||||
<div class="d-flex flex-column justify-content-between">
|
||||
<!-- todo: widgetTag ?? -->
|
||||
<template v-if="shared">
|
||||
<header><b>{{ tagName }}</b></header>
|
||||
<template v-if="!emptyBookmarks">
|
||||
<div v-for="link in shared" :key="link.id" class="d-flex mt-2">
|
||||
<a target="_blank" :href="link.url">
|
||||
|
||||
@@ -61,7 +61,7 @@ export default {
|
||||
return {
|
||||
'--fhc-dg-row-height': 100/(this.rows + addH) + '%',
|
||||
'--fhc-dg-col-width': 100/this.cols + '%',
|
||||
'--fhc-dg-item-padding-horizontal': '0.5%',
|
||||
'--fhc-dg-item-padding-horizontal': '0.25%',
|
||||
'--fhc-dg-item-padding-top': '0.5%',
|
||||
'padding-bottom': 100 * (this.rows + addH)/this.cols + '%'
|
||||
}
|
||||
|
||||
@@ -37136,6 +37136,26 @@ array(
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'global',
|
||||
'phrase' => 'personalGreeting',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => "{0}'s persönliches Dashboard",
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => "{0}'s personal Dashboard",
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
)
|
||||
// CIS4 phrases from legacy code end
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user