mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 16:44:28 +00:00
Display section name only in admin mode & display source information for widgets (from which section it is) in non-admin mode
This commit is contained in:
@@ -39,9 +39,22 @@ export default {
|
|||||||
"place",
|
"place",
|
||||||
"resizeLimits",
|
"resizeLimits",
|
||||||
"dragstate",
|
"dragstate",
|
||||||
"resizeOverlay"
|
"resizeOverlay",
|
||||||
|
"source"
|
||||||
],
|
],
|
||||||
computed: {
|
computed: {
|
||||||
|
sourceInfoTooltip() {
|
||||||
|
switch (this.source) {
|
||||||
|
case null:
|
||||||
|
return '';
|
||||||
|
case 'general':
|
||||||
|
return this.$p.t('dashboard', 'widgetFromGeneralSection');
|
||||||
|
case 'custom':
|
||||||
|
return this.$p.t('dashboard', 'widgetFromCustomSection');
|
||||||
|
default:
|
||||||
|
return this.$p.t('dashboard', 'widgetFromFunktionSection', [this.source]);
|
||||||
|
}
|
||||||
|
},
|
||||||
isResizeableHorizontal() {
|
isResizeableHorizontal() {
|
||||||
if (this.resizeLimits.width === undefined)
|
if (this.resizeLimits.width === undefined)
|
||||||
return true;
|
return true;
|
||||||
@@ -193,6 +206,13 @@ export default {
|
|||||||
</span>
|
</span>
|
||||||
</Transition>
|
</Transition>
|
||||||
<span class="col mx-2 px-2">{{ widget.setup.name }}</span>
|
<span class="col mx-2 px-2">{{ widget.setup.name }}</span>
|
||||||
|
<div
|
||||||
|
v-if="source"
|
||||||
|
v-tooltip="{ class: 'w-100', value: sourceInfoTooltip }"
|
||||||
|
class="col-auto me-2"
|
||||||
|
>
|
||||||
|
<i class="fa-solid fa-circle-info" aria-hidden="true"></i>
|
||||||
|
</div>
|
||||||
<template v-if="isPinned">
|
<template v-if="isPinned">
|
||||||
<div type="button" role="button" v-if="editMode" pinned="true" @click="unpin" title="unpin item" aria-label="unpin item" class="pin cursor-pointer col-auto me-2">
|
<div type="button" role="button" v-if="editMode" pinned="true" @click="unpin" title="unpin item" aria-label="unpin item" class="pin cursor-pointer col-auto me-2">
|
||||||
<i class="fa-solid fa-thumbtack " aria-hidden="true"></i>
|
<i class="fa-solid fa-thumbtack " aria-hidden="true"></i>
|
||||||
@@ -207,8 +227,8 @@ export default {
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<a type="button" v-if="widget.setup.cis4link" :href="getWidgetC4Link(widget)" aria-label="widget link" v-tooltip="{showDelay:1000, value:'widget link'}" class="col-auto ms-auto">
|
<a type="button" v-if="widget.setup.cis4link" :href="getWidgetC4Link(widget)" aria-label="widget link" v-tooltip="{showDelay:1000, value:'widget link'}" class="col-auto ms-auto">
|
||||||
<i class="fa fa-arrow-up-right-from-square me-1" aria-hidden="true"></i>
|
<i class="fa fa-arrow-up-right-from-square me-1" aria-hidden="true"></i>
|
||||||
</a>
|
</a>
|
||||||
<a type="button" v-if="hasConfig" class="col-auto px-1" href="#" @click.prevent="openConfig" aria-label="configure widget" v-tooltip="{showDelay:1000,value:'configure widget'}"><i class="fa-solid fa-gear" aria-hidden="true"></i></a>
|
<a type="button" v-if="hasConfig" class="col-auto px-1" href="#" @click.prevent="openConfig" aria-label="configure widget" v-tooltip="{showDelay:1000,value:'configure widget'}"><i class="fa-solid fa-gear" aria-hidden="true"></i></a>
|
||||||
<a type="button" v-if="custom && editMode" class="col-auto px-1" aria-label="delete widget" v-tooltip="{showDelay:1000,value:'delete widget'}" href="#" @click.prevent="$emit('remove')">
|
<a type="button" v-if="custom && editMode" class="col-auto px-1" aria-label="delete widget" v-tooltip="{showDelay:1000,value:'delete widget'}" href="#" @click.prevent="$emit('remove')">
|
||||||
<i class="fa-solid fa-trash" aria-hidden="true"></i>
|
<i class="fa-solid fa-trash" aria-hidden="true"></i>
|
||||||
|
|||||||
@@ -52,6 +52,26 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
sectionNameTranslation() {
|
||||||
|
switch (this.name) {
|
||||||
|
case "general":
|
||||||
|
return this.$p.t('dashboard', this.name);
|
||||||
|
case "custom":
|
||||||
|
return this.$p.t('dashboard', this.name);
|
||||||
|
default:
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
showSectionInformation() {
|
||||||
|
switch (this.name) {
|
||||||
|
case "general":
|
||||||
|
return this.$p.t('dashboard', 'dashboardGeneralSectionDescription');
|
||||||
|
case "custom":
|
||||||
|
return this.$p.t('dashboard', 'dashboardCustomSectionDescription');
|
||||||
|
default:
|
||||||
|
return this.$p.t('dashboard', 'dashboardSectionDescription', [this.name]);
|
||||||
|
}
|
||||||
|
},
|
||||||
computedWidgetsSetup() {
|
computedWidgetsSetup() {
|
||||||
if (!this.widgetsSetup)
|
if (!this.widgetsSetup)
|
||||||
return {};
|
return {};
|
||||||
@@ -92,26 +112,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
sectionNameTranslation() {
|
|
||||||
switch (this.name) {
|
|
||||||
case "general":
|
|
||||||
return this.$p.t('dashboard', this.name);
|
|
||||||
case "custom":
|
|
||||||
return this.$p.t('dashboard', this.name);
|
|
||||||
default:
|
|
||||||
return this.name;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
showSectionInformation() {
|
|
||||||
switch (this.name) {
|
|
||||||
case "general":
|
|
||||||
return this.$p.t('dashboard', 'dashboardGeneralSectionDescription');
|
|
||||||
case "custom":
|
|
||||||
return this.$p.t('dashboard', 'dashboardCustomSectionDescription');
|
|
||||||
default:
|
|
||||||
return this.$p.t('dashboard', 'dashboardSectionDescription', [this.name]);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleConfigOpened() {
|
handleConfigOpened() {
|
||||||
this.configOpened = true
|
this.configOpened = true
|
||||||
},
|
},
|
||||||
@@ -225,9 +225,9 @@ export default {
|
|||||||
class="dashboard-section position-relative pb-3 mb-3 border-bottom"
|
class="dashboard-section position-relative pb-3 mb-3 border-bottom"
|
||||||
ref="container"
|
ref="container"
|
||||||
>
|
>
|
||||||
<h4 v-if="editModeIsActive" class=" mb-2">
|
<h4 v-if="adminMode" class=" mb-2">
|
||||||
<i v-tooltip="showSectionInformation(name)" class="fa-solid fa-circle-info section-info" ></i>
|
<i v-tooltip="showSectionInformation" class="fa-solid fa-circle-info section-info"></i>
|
||||||
{{ sectionNameTranslation() }}:
|
{{ sectionNameTranslation }}:
|
||||||
</h4>
|
</h4>
|
||||||
<button
|
<button
|
||||||
v-tooltip="$p.t('dashboard','addLine')"
|
v-tooltip="$p.t('dashboard','addLine')"
|
||||||
@@ -269,6 +269,7 @@ export default {
|
|||||||
:editMode="editModeIsActive"
|
:editMode="editModeIsActive"
|
||||||
:place="item.place[gridWidth]"
|
:place="item.place[gridWidth]"
|
||||||
:resize-limits="computedWidgetsSetup[item.widget]"
|
:resize-limits="computedWidgetsSetup[item.widget]"
|
||||||
|
:source="adminMode ? null : item.source || 'custom'"
|
||||||
@change="saveConfig($event, item)"
|
@change="saveConfig($event, item)"
|
||||||
@remove="removeWidget(item, $event)"
|
@remove="removeWidget(item, $event)"
|
||||||
@config-opened="handleConfigOpened"
|
@config-opened="handleConfigOpened"
|
||||||
|
|||||||
@@ -47226,6 +47226,66 @@ array(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
array(
|
||||||
|
'app' => 'core',
|
||||||
|
'category' => 'dashboard',
|
||||||
|
'phrase' => 'widgetFromGeneralSection',
|
||||||
|
'insertvon' => 'system',
|
||||||
|
'phrases' => array(
|
||||||
|
array(
|
||||||
|
'sprache' => 'German',
|
||||||
|
'text' => 'Dieses Widget ist für das Dashboard vordefiniert',
|
||||||
|
'description' => '',
|
||||||
|
'insertvon' => 'system'
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'sprache' => 'English',
|
||||||
|
'text' => 'This is a predefined widget of this dashboard',
|
||||||
|
'description' => '',
|
||||||
|
'insertvon' => 'system'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'app' => 'core',
|
||||||
|
'category' => 'dashboard',
|
||||||
|
'phrase' => 'widgetFromCustomSection',
|
||||||
|
'insertvon' => 'system',
|
||||||
|
'phrases' => array(
|
||||||
|
array(
|
||||||
|
'sprache' => 'German',
|
||||||
|
'text' => 'Dieses Widget wurde von Ihnen hinzugefügt',
|
||||||
|
'description' => '',
|
||||||
|
'insertvon' => 'system'
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'sprache' => 'English',
|
||||||
|
'text' => 'This widget has been added by you',
|
||||||
|
'description' => '',
|
||||||
|
'insertvon' => 'system'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'app' => 'core',
|
||||||
|
'category' => 'dashboard',
|
||||||
|
'phrase' => 'widgetFromFunktionSection',
|
||||||
|
'insertvon' => 'system',
|
||||||
|
'phrases' => array(
|
||||||
|
array(
|
||||||
|
'sprache' => 'German',
|
||||||
|
'text' => 'Dieses Widget wurde hinzugefügt weil Sie der "{0}" Funktion zugewiesen wurden',
|
||||||
|
'description' => '',
|
||||||
|
'insertvon' => 'system'
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'sprache' => 'English',
|
||||||
|
'text' => 'This widget has been added because you have been assigned to the "{0}" function',
|
||||||
|
'description' => '',
|
||||||
|
'insertvon' => 'system'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
// CIS4 phrases from legacy code end
|
// CIS4 phrases from legacy code end
|
||||||
// FHC4 Phrases Abschlusspruefung
|
// FHC4 Phrases Abschlusspruefung
|
||||||
array(
|
array(
|
||||||
|
|||||||
Reference in New Issue
Block a user