Skip to content

Commit

Permalink
#460 - added sub menu for transactions to navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
deadlocker8 committed Jan 7, 2023
1 parent a31991a commit 778e336
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public enum EntityType implements LocalizedEnum
ABOUT("info", "background-grey", ImportRequired.NONE, null, null),
TEMPLATE_GROUP("folder", "background-orange-dark", ImportRequired.OPTIONAL, "template groups", "template group"),
ICON("icon", "background-grey", ImportRequired.NONE, "icons", "icon"),
TRANSACTION_NAME_KEYWORD("transaction_name_keyword", "background-grey", ImportRequired.NONE, "keywords", "keyword");
TRANSACTION_NAME_KEYWORD("transaction_name_keyword", "background-grey", ImportRequired.NONE, "keywords", "keyword"),
RECURRING_TRANSACTIONS("repeat", "background-orange-dark", ImportRequired.NONE, "recurring", "recurring");

public enum ImportRequired
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ warning.empty.git.token=Bitte gib dein git-Zugriffstoken ein.
# UI
menu.home=Startseite
menu.transactions=Buchungen
menu.templates=Vorlagen
menu.transactions.templates=Vorlagen
menu.transactions.recurring=Wiederholende Buchungen
menu.template.groups=Vorlagengruppen
menu.categories=Kategorien
menu.charts=Diagramme
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ warning.empty.git.token=Please insert your git access token.
# UI
menu.home=Home
menu.transactions=Transactions
menu.templates=Templates
menu.transactions.templates=Templates
menu.transactions.recurring=Recurring Transactions
menu.template.groups=Template Groups
menu.categories=Categories
menu.charts=Charts
Expand Down
16 changes: 16 additions & 0 deletions BudgetMasterServer/src/main/resources/static/css/navbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ ul.sidenav.sidenav-fixed > li:last-child {
right: 3rem;
}

.sidenav .sub-menu-entry i {
margin-left: 2rem !important;
}

.sidenav .sub-menu {
background-color: var(--color-grey-dark-almost-transparent);
}

.sidenav li.sub-menu.active {
background-color: rgba(0, 0, 0, 0.25);
}

/* dark theme */

[data-theme="dark"] .sidenav,
Expand Down Expand Up @@ -81,6 +93,10 @@ ul.sidenav.sidenav-fixed > li:last-child {
background-color: rgba(255, 255, 255, 0.25);
}

[data-theme="dark"] .sidenav li.sub-menu.active {
background-color: rgba(255, 255, 255, 0.35);
}

/*active nav bar sub list items*/
[data-theme="dark"] .sidenav .collapsible-body > ul:not(.collapsible) > li.active,
[data-theme="dark"] .sidenav.fixed .collapsible-body > ul:not(.collapsible) > li.active {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<div class="row left-align">
<div class="col s12">
<@indexFunctions.stepContent headline="home.first.use.step.5.headline" contentText="home.first.use.step.5.contentText" actionUrl="" actionName="">
<h5>${locale.getString("menu.templates")}</h5>
<h5>${locale.getString("menu.transactions.templates")}</h5>
<p>
${locale.getString("home.first.use.step.5.sub.1")}
</p>
Expand Down
13 changes: 11 additions & 2 deletions BudgetMasterServer/src/main/resources/templates/helpers/navbar.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
<@itemDivider/>

<@itemWithIcon "home", "/", locale.getString("menu.home"), entityType.HOME.getIcon(), entityType.HOME.getColor(), activeID/>
<@itemWithIcon "transactions", "/transactions", locale.getString("menu.transactions"), entityType.TRANSACTION.getIcon(), entityType.TRANSACTION.getColor(), activeID/>
<@itemWithIcon "templates", "/templates", locale.getString("menu.templates"), entityType.TEMPLATE.getIcon(), entityType.TEMPLATE.getColor(), activeID/>
<@transactionsMenu "/transactions", locale.getString("menu.transactions"), entityType.TRANSACTION.getIcon(), entityType.TRANSACTION.getColor(), activeID/>
<@itemWithIcon "charts" "/charts" locale.getString("menu.charts"), entityType.CHART.getIcon(), entityType.CHART.getColor(), activeID/>
<@itemWithIcon "reports", "/reports", locale.getString("menu.reports"), entityType.REPORT.getIcon(), entityType.REPORT.getColor(), activeID/>
<@itemWithIcon "categories", "/categories", locale.getString("menu.categories"), entityType.CATEGORY.getIcon(), entityType.CATEGORY.getColor(), activeID/>
Expand Down Expand Up @@ -146,6 +145,16 @@
<li><a class="waves-effect background-red budgetmaster-text-update"><i class="material-icons" id="icon-update">${icon}</i>${text}</a></li>
</#macro>

<#macro transactionsMenu link text icon activeColor activeID>
<#if activeID == "transactions" || activeID == "templates" || activeID == "recurring">
<li class="sub-menu <#if activeID == "transactions">active</#if>"><a href="<@s.url '${link}'/>" class="waves-effect no-padding"><div class="stripe ${activeColor}"></div><i class="material-icons">${icon}</i>${text}</a></li>
<li class="sub-menu sub-menu-entry <#if activeID == "templates">active</#if>"><a href="<@s.url '/templates'/>" class="waves-effect no-padding"><div class="stripe ${activeColor}"></div><i class="material-icons">${entityType.TEMPLATE.getIcon()}</i>${locale.getString("menu.transactions.templates")}</a></li>
<li class="sub-menu sub-menu-entry <#if activeID == "recurring">active</#if>"><a href="<@s.url '/templates'/>" class="waves-effect no-padding"><div class="stripe ${activeColor}"></div><i class="material-icons">${entityType.RECURRING_TRANSACTIONS.getIcon()}</i>${locale.getString("menu.transactions.recurring")}</a></li>
<#else>
<li><a href="<@s.url '${link}'/>" class="waves-effect"><i class="material-icons">${icon}</i>${text}</a></li>
</#if>
</#macro>

<#macro backupReminder settings>
<#if settings.needToShowBackupReminder()>
<div id="modalBackupReminder" class="modal background-color">
Expand Down
2 changes: 1 addition & 1 deletion BudgetMasterServer/src/main/resources/templates/index.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<@indexFunctions.action url="/transactions/newTransaction/normal" name="home.menu.transactions.action.new"/>
</@indexFunctions.homeEntry>

<@indexFunctions.homeEntry url="/templates" icon=entityType.TEMPLATE.getIcon() iconColor=entityType.TEMPLATE.getColorAsTextColor() headlineText="menu.templates" bodyText="home.menu.templates">
<@indexFunctions.homeEntry url="/templates" icon=entityType.TEMPLATE.getIcon() iconColor=entityType.TEMPLATE.getColorAsTextColor() headlineText="menu.transactions.templates" bodyText="home.menu.templates">
<@indexFunctions.action url="/templates" name="home.menu.templates.action.manage"/>
</@indexFunctions.homeEntry>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</#macro>

<#macro buttonEditTemplateGroups>
<@header.buttonLink url='/templates' icon='file_copy' localizationKey='menu.templates'/>
<@header.buttonLink url='/templates' icon='file_copy' localizationKey='menu.transactions.templates'/>
</#macro>

<#macro buttons>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<head>
<#import "../helpers/header.ftl" as header>
<@header.globals/>
<@header.header "BudgetMaster - ${locale.getString('menu.templates')}"/>
<@header.header "BudgetMaster - ${locale.getString('menu.transactions.templates')}"/>
<@header.style "collapsible"/>
<@header.style "templates"/>
<#import "/spring.ftl" as s>
Expand All @@ -18,7 +18,7 @@
<div class="card main-card background-color">
<div class="container">
<div class="section center-align">
<div class="headline"><i class="material-icons">file_copy</i> ${locale.getString("menu.templates")}</div>
<div class="headline"><i class="material-icons">file_copy</i> ${locale.getString("menu.transactions.templates")}</div>
</div>

<@header.content>
Expand Down

0 comments on commit 778e336

Please sign in to comment.