diff --git a/src/main/java/de/deadlocker8/budgetmaster/charts/ChartController.java b/src/main/java/de/deadlocker8/budgetmaster/charts/ChartController.java index 2e0df73d0bc9655e02cd196da8c96372a79eefc9..1cc9c8a132c6e6dc61b69fc05b818125c4ddf66a 100644 --- a/src/main/java/de/deadlocker8/budgetmaster/charts/ChartController.java +++ b/src/main/java/de/deadlocker8/budgetmaster/charts/ChartController.java @@ -159,7 +159,7 @@ public class ChartController extends BaseController { Chart emptyChart = DefaultCharts.CHART_DEFAULT; model.addAttribute(ModelAttributes.ONE_ENTITY, emptyChart); - return ReturnValues.REDIRECT_MANAGE; + return ReturnValues.NEW_ENTITY; } @GetMapping("/{ID}/edit") diff --git a/src/main/resources/languages/base_de.properties b/src/main/resources/languages/base_de.properties index 70e0994e2532cac7122d77b85310d5c5dcd65b0f..33e37c56a95f2a2926998f1c2fd8bba080a5648a 100644 --- a/src/main/resources/languages/base_de.properties +++ b/src/main/resources/languages/base_de.properties @@ -524,11 +524,13 @@ hotkeys.global.datepicker.today=Aktueller Monat # charts +chart.display.type=Anzeigetyp chart.display.type.pie=Torte chart.display.type.bar=Balken chart.display.type.line=Linien chart.display.type.custom=Benutzerdefiniert +chart.group.type=Gruppentyp chart.group.type.none=keine chart.group.type.month=Monat chart.group.type.year=Jahr diff --git a/src/main/resources/languages/base_en.properties b/src/main/resources/languages/base_en.properties index 058a4d3216d76d86ca0b19f072d9911a81dd728f..00169876efb8fb4fefdc1eb7f0b88a4c391388a7 100644 --- a/src/main/resources/languages/base_en.properties +++ b/src/main/resources/languages/base_en.properties @@ -524,11 +524,13 @@ hotkeys.global.datepicker.today.key=0 hotkeys.global.datepicker.today=Current month # charts +chart.dispay.type=Display type chart.display.type.pie=Pie chart.display.type.bar=Bar chart.display.type.line=Line chart.display.type.custom=Custom +chart.group.type=Group type chart.group.type.none=None chart.group.type.month=Month chart.group.type.year=Year diff --git a/src/main/resources/templates/charts/chartFunctions.ftl b/src/main/resources/templates/charts/chartFunctions.ftl index 04cfc38109f424a214a279ed71fc4d6eca8ea7db..faa899749090c59576690adeec1e0d5bbd54725e 100644 --- a/src/main/resources/templates/charts/chartFunctions.ftl +++ b/src/main/resources/templates/charts/chartFunctions.ftl @@ -56,4 +56,12 @@ </div> </div> </div> -</#macro> \ No newline at end of file +</#macro> + +<#macro iconForItem item> + <#if item.hasFontAwesomeIcon()> + <i class="${item.getIcon()} left"></i> ${locale.getString(item.getLocalizationKey())} + <#else> + <i class="material-icons left">${item.getIcon()}</i> ${locale.getString(item.getLocalizationKey())} + </#if> +</#macro> diff --git a/src/main/resources/templates/charts/charts.ftl b/src/main/resources/templates/charts/charts.ftl index 5db5d1610ae940669323a59e1b86e7d7e8132544..7027e3864c5ad962ac7f70eaca34403bc2a8f9e5 100644 --- a/src/main/resources/templates/charts/charts.ftl +++ b/src/main/resources/templates/charts/charts.ftl @@ -132,11 +132,7 @@ <#assign isInitialItem=item.name()==initialItem.name()/> <a class="waves-effect waves-light btn-large text-black ${buttonClass} <#if isInitialItem>active</#if>" data-value="${item.name()}"> - <#if item.hasFontAwesomeIcon()> - <i class="${item.getIcon()} left"></i> ${locale.getString(item.getLocalizationKey())} - <#else> - <i class="material-icons left">${item.getIcon()}</i> ${locale.getString(item.getLocalizationKey())} - </#if> + <@chartFunctions.iconForItem item/> </a> </#macro> diff --git a/src/main/resources/templates/charts/manage.ftl b/src/main/resources/templates/charts/manage.ftl index 85b4acac5b207821d841198d4a4f49950e875c0b..2cea7f8e61871368a276dc417b995687820c513e 100644 --- a/src/main/resources/templates/charts/manage.ftl +++ b/src/main/resources/templates/charts/manage.ftl @@ -28,6 +28,8 @@ <thead> <tr> <th>${locale.getString("chart.new.label.name")}</th> + <th>${locale.getString("chart.display.type")}</th> + <th>${locale.getString("chart.group.type")}</th> <th>${locale.getString("chart.type")}</th> <th>${locale.getString("chart.actions")}</th> </tr> @@ -36,6 +38,8 @@ <#assign chartName=chartFunctions.getChartName(chart)> <tr> <td>${chartName}</td> + <td><@chartFunctions.iconForItem item=chart.getDisplayType()/></td> + <td><@chartFunctions.iconForItem item=chart.getGroupType()/></td> <td> <#if chart.getType().name() == "DEFAULT"> <a class="no-padding text-default"><i class="material-icons left">lock</i></a>