Phrases & cleanup

This commit is contained in:
chfhtw
2026-09-14 12:52:15 +02:00
parent 8c82c046dc
commit e64c998b7a
18 changed files with 634 additions and 59 deletions
+3 -1
View File
@@ -23,7 +23,9 @@ const app = Vue.createApp({
<div class="content d-flex flex-column gap-3 w-100 h-100 overflow-hidden">
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3">
<h1 class="h2 pb-3 border-bottom mb-0 w-100">Widgets</h1>
<h1 class="h2 pb-3 border-bottom mb-0 w-100">
{{ $p.t('dashboard/widgets') }}
</h1>
</div>
<widget-admin class="h-100 overflow-hidden" />
</div>
@@ -31,7 +31,6 @@ export default {
this.currentData = JSON.parse(JSON.stringify(data));
},
create(data) {
// TODO(chris): modify data with base info
this.currentData = JSON.parse(JSON.stringify(data));
this.save();
},
@@ -69,7 +68,7 @@ export default {
@saved="save"
/>
<div v-else class="h-100 d-flex justify-content-center align-items-center">
Please select a widget
{{ $p.t('dashboard/no_widget_selected') }}
</div>
</template>
</vertical-split>
@@ -32,11 +32,11 @@ export default {
<div class="col">
<div class="d-flex gap-3 mb-2">
<div class="col">
<b>{{ $p.t('mobility/kurzbz') }}: </b>
<b>{{ $p.t('dashboard/widget_kurzbz') }}: </b>
{{ modelValue.widget_kurzbz }}
</div>
<div v-if="modelValue.widget_id !== undefined" class="col-auto">
<b>{{ $p.t('zeitaufzeichnung/id') }}: </b>
<b>{{ $p.t('dashboard/widget_id') }}: </b>
{{ modelValue.widget_id }}
</div>
</div>
@@ -72,14 +72,14 @@ export default {
:aria-controls="'aggregator_' + myId + '_' + i"
>
<span v-if="agg.label">{{ agg.label }}</span>
<i v-else>new</i>
<i v-else>{{ $p.t('ui/neu') }}</i>
<div class="flex-grow-1">
<form-input
type="radio"
name="aggregatordefault"
v-model="aggregatorDefault"
class="btn-check"
:label="$p.t('ui/defaultoption')"
:label="$p.t('ui/default')"
:value="i"
label-class="btn"
container-class="text-end pe-4"
@@ -1,7 +1,5 @@
import FormInput from '../../../../../Form/Input.js';
// TODO(chris): phrases
export default {
name: "WidgetsGenteratorReportAggregatorsAggregator",
components: {
@@ -16,31 +14,27 @@ export default {
emits: [
"update:modelValue",
],
methods: {
},
created() {
},
template: /*html*/ `
<div class="widgets-report-config-aggregators-aggregator">
<form-input
type="text"
v-model="modelValue.label"
label="label"
:label="$p.t('global/label')"
/>
<form-input
type="select"
v-model="modelValue.type"
label="type"
:label="$p.t('global/typ')"
>
<option value="sum">Sum</option>
<option value="count">Count</option>
<option value="sum">{{ $p.t('dashboard/widget_report_kpi_aggregator_type_sum') }}</option>
<option value="count">{{ $p.t('dashboard/widget_report_kpi_aggregator_type_count') }}</option>
</form-input>
<form-input
v-if="modelValue.type == 'sum'"
type="text"
v-model="modelValue.fields"
label="fields"
placeholder="fields (comma separated)"
:label="$p.t('dashboard/widget_report_kpi_aggregator_fields')"
:placeholder="$p.t('dashboard/widget_report_kpi_aggregator_fields_placeholder')"
/>
</div>
`,
@@ -24,14 +24,13 @@ export default {
},
},
},
// TODO(chris): phrases: placeholder
template: /*html*/ `
<form-input
v-model="modelValueCmp"
class="widgets-report-config-vars-var-calc-date"
type="text"
input-group
placeholder="Duration (add '-' at the beginning to substract) from current date"
:placeholder="$p.t('dashboard/widget_report_vars_calc_date_placeholder')"
>
</form-input>
`,
@@ -24,14 +24,13 @@ export default {
},
},
},
// TODO(chris): phrases: placeholder
template: /*html*/ `
<form-input
v-model="modelValueCmp"
class="widgets-report-config-vars-var-calc-right"
type="text"
input-group
placeholder="Access Right (comma separated)"
:placeholder="$p.t('dashboard/widget_report_vars_calc_right_placeholder')"
>
</form-input>
`,
@@ -131,9 +131,9 @@ export default {
input-group
@update:modelValue="setType"
>
<option value="fix">Fixed</option>
<option value="calc">Calculated</option>
<option value="user">User Defined</option>
<option value="fix">{{ $p.t('dashboard/widget_report_vars_var_type_fix') }}</option>
<option value="calc">{{ $p.t('dashboard/widget_report_vars_var_type_calc') }}</option>
<option value="user">{{ $p.t('dashboard/widget_report_vars_var_type_user') }}</option>
</form-input>
<form-input
v-if="modelValue.type == 'fix' || noType"
@@ -22,16 +22,16 @@ export default {
v-model="modelValue.name"
type="text"
container-class="mb-3"
:label="$p.t('ui/name')"
:label="$p.t('global/name')"
:disabled="!editName"
/>
<label>{{ $p.t('ui/size') }}</label>
<label>{{ $p.t('dashboard/widget_setup_size') }}</label>
<div class="d-flex gap-3 mb-3">
<edit-size v-model="modelValue.width" :disabled="!editSize">
{{ $p.t('ui/width') }}
{{ $p.t('dashboard/widget_setup_width') }}
</edit-size>
<edit-size v-model="modelValue.height" :disabled="!editSize">
{{ $p.t('ui/height') }}
{{ $p.t('dashboard/widget_setup_height') }}
</edit-size>
</div>
<form-input
@@ -25,6 +25,7 @@ export default {
{
field: 'setup.icon',
title: 'Icon',
titlePhrase: 'dashboard/widget_icon',
mutator: value => {
if (!value)
return FHC_JS_DATA_STORAGE_OBJECT.app_root + 'skin/images/fh_technikum_wien_illustration_klein.png';
@@ -41,14 +42,17 @@ export default {
{
field: 'setup.name',
title: 'Name',
titlePhrase: 'global/name',
},
{
field: 'widget_kurzbz',
title: 'Kurzbz',
titlePhrase: 'dashboard/widget_kurzbz',
},
{
field: 'berechtigung_kurzbz',
title: 'Berechtigung',
titlePhrase: 'global/permission',
},
],
locale: true,
@@ -74,7 +78,7 @@ export default {
return true;
BsConfirm
.popup('selectablecheck' + row.getData().widget_id)
.popup(this.$p.t('dashboard/confirm_unsaved_progress'))
.then(() => {
const currentRows = row.getTable().getSelectedRows();
if (currentRows.length)
@@ -88,7 +92,7 @@ export default {
newWidget() {
if (this.unsavedProgress) {
BsConfirm
.popup('newcheck')
.popup(this.$p.t('dashboard/confirm_unsaved_progress'))
.then(() => this.$emit('new'))
.catch(() => {});
} else {
@@ -109,7 +113,7 @@ export default {
table-only
reload
new-btn-show
new-btn-label="Widget"
:new-btn-label="$p.t('dashboard/widget')"
@click:new="newWidget"
>
</core-filter-cmpt>
@@ -58,24 +58,33 @@ export default {
<bs-modal ref="modal">
<template #default>
<form-input
type="select"
:label="'Generator:'"
v-model="result.setup.generator"
type="select"
:label="$p.t('dashboard/generator')"
class="mb-3"
>
<option v-for="(generator, name) in generators" :key="name" :value="generator">
{{ generator }}
</option>
</form-input>
<form-input
v-model="result.widget_kurzbz"
type="text"
name="widget_kurzbz"
:label="$p.t('mobility/kurzbz') + ':'"
v-model="result.widget_kurzbz"
:label="$p.t('dashboard/widget_kurzbz') + ':'"
/>
</template>
<template #footer>
<button type="submit" class="btn btn-primary">OK</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary">
{{ $p.t('ui/ok') }}
</button>
<button
type="button"
class="btn btn-secondary"
data-bs-dismiss="modal"
>
{{ $p.t('ui/cancel') }}
</button>
</template>
</bs-modal>
</core-form>
@@ -25,8 +25,6 @@ export default {
details: null,
};
},
computed: {
},
methods: {
attemptReportChange(value) {
if (this.modelValue.arguments.statistik_kurzbz == value)
@@ -37,7 +35,7 @@ export default {
if (hasVars || hasAggregators) {
BsConfirm
.popup('change') // TODO(chris): phrase
.popup($p.t('dashboard/widget_report_statistik_change'))
.then(() => {
this.modelValue.arguments.statistik_kurzbz = value;
this.modelValue.arguments.aggregators = [];
@@ -69,7 +67,6 @@ export default {
this.modelValue.arguments.vars[detail.kurzbz] = { type: 'fix' };
});
// TODO(chris): emit update:modelValue
this.details = result.data;
})
.catch(this.$fhcAlert.handleSystemErrors)
@@ -61,8 +61,8 @@ export default {
},
template: /*html*/ `
<div class="widgets-report-kpi-config-kpi">
<template v-if="hasCustomVars">
// TODO(chris): label: vars
<div v-if="hasCustomVars" :class="config.aggregators.length > 1 ? 'mb-3' : ''">
<label class="form-label">{{ $p.t('dashboard/widget_report_vars') }}</label>
<vars-var
v-for="(variable, key) in customVars"
:key="key"
@@ -70,7 +70,7 @@ export default {
no-type
@update:model-value="updateUserVar(key, $event)"
/>
</template>
</div>
<form-input
v-if="config.aggregators.length > 1"
type="select"
@@ -172,15 +172,7 @@ export default {
}
},
template: /*html*/ `
<div
class="widgets-report-kpi w-100 h-100"
:class="{
'd-flex': !configMode,
'flex-column': !configMode,
'justify-content-center': !configMode,
'align-items-center': !configMode
}"
>
<div class="widgets-report-kpi w-100 h-100 d-flex flex-column justify-content-center align-items-center">
<div
v-if="hasErrors === true"
class="alert alert-danger m-0 h-100 w-100 border-0 rounded-0 d-flex justify-content-center align-items-center"
@@ -18,7 +18,7 @@
import CalcDate from '../../../../components/Dashboard/WidgetAdmin/Edit/Report/Vars/Calc/Date.js';
export default {
label: 'CalcDate',
label: [ 'dashboard', 'widget_report_vars_calc_date' ],
component: CalcDate,
async calculate(instructions) {
let duration = instructions[2] || 'P';
@@ -18,7 +18,7 @@
import ApiStudienjahr from '../../../../api/factory/studienjahr.js';
export default {
label: 'CurrentStudienjahr',
label: [ 'dashboard', 'widget_report_vars_calc_currentstudienjahr' ],
async calculate(instructions) {
try {
const result = await this.$api.call(ApiStudienjahr.getAktNext());
@@ -20,7 +20,7 @@ import CalcRight from '../../../../components/Dashboard/WidgetAdmin/Edit/Report/
import ApiStudiengang from '../../../../api/factory/studiengang.js';
export default {
label: 'UserStgs',
label: [ 'dashboard', 'widget_report_vars_calc_stgs' ],
component: CalcRight,
async calculate(instructions) {
try {
+581 -1
View File
@@ -748,6 +748,26 @@ $phrases = array(
)
)
),
array(
'app' => 'core',
'category' => 'global',
'phrase' => 'label',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Bezeichnung',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Label',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'global',
@@ -1353,6 +1373,26 @@ $phrases = array(
)
)
),
array(
'app' => 'core',
'category' => 'global',
'phrase' => 'permission',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Berechtigung',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Permission',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'global',
@@ -1361,7 +1401,7 @@ $phrases = array(
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Rechte',
'text' => 'Berechtigungen',
'description' => '',
'insertvon' => 'system'
),
@@ -60750,6 +60790,86 @@ I have been informed that I am under no obligation to consent to the transmissio
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'widgets',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Widgets',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Widgets',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'widget',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Widget',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Widget',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'no_widget_selected',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Bitte ein Widget markieren!',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Please select a widget!',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'confirm_unsaved_progress',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Das Widget wurde geändert! Änderungen verwerfen?',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'The widget has been modified! Discard changes?',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
@@ -60790,6 +60910,26 @@ I have been informed that I am under no obligation to consent to the transmissio
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'widget_icon',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Icon',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Icon',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
@@ -60810,6 +60950,446 @@ I have been informed that I am under no obligation to consent to the transmissio
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'widget_setup_size',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Größe',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Size',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'widget_setup_width',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Breite',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Width',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'widget_setup_height',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Höhe',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Height',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'widget_setup_hidefooter',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Footer verstecken',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Hide footer',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'widget_report_statistik',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Statistik',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Statistic',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'widget_report_statistik_change',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Die Statistik wurde geändert! Einstellungen für vorherige Statistik verwerfen?',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'The Statistic has been changed! Discard settings for the previous Statistic?',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'widget_report_vars',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Variablen',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Variables',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'widget_report_vars_var_type_fix',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Fester Wert',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Fixed',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'widget_report_vars_var_type_calc',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Berechnet',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Calculated',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'widget_report_vars_var_type_user',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Benutzerdefiniert',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'User defined',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'widget_report_vars_calc_date',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Berechnetes Datum',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Calculated date',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'widget_report_vars_calc_currentstudienjahr',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Aktuelles Studienjahr',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Current academic year',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'widget_report_vars_calc_stgs',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Studiengang des Users',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Users degree program',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'widget_report_vars_calc_date',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Berechnetes Datum',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Calculated date',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'widget_report_vars_calc_date_placeholder',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Dauer (fügen Sie am Anfang ein \'-\' hinzu, um es abzuziehen) ab dem aktuellen Datum',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Duration (add \'-\' at the beginning to substract) from current date',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'widget_report_vars_calc_right_placeholder',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Berechtigungen (Komma getrennt)',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Access Rights (comma separated)',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'widget_report_kpi_aggregators',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Aggregatoren',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Aggregators',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'widget_report_kpi_aggregator',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Aggregator',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Aggregator',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'widget_report_kpi_aggregator_type_sum',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Summe',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Sum',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'widget_report_kpi_aggregator_type_count',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Zeilenanzahl',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Row count',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'widget_report_kpi_aggregator_fields',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Felder',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Fields',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'widget_report_kpi_aggregator_fields_placeholder',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Felder (Komma getrennt)',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Fields (comma separated)',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ui',