Skip to content
Snippets Groups Projects
Commit 807e30f6 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

#582 - added new macro for notifications

parent 330839c5
Branches
Tags
No related merge requests found
package de.deadlocker8.budgetmaster.utils;
public class Notification
{
private final String message;
private final String icon;
private final String backgroundColor;
private final String textColor;
public Notification(String message, String icon, String backgroundColor, String textColor)
{
this.message = message;
this.icon = icon;
this.backgroundColor = backgroundColor;
this.textColor = textColor;
}
public String getMessage()
{
return message;
}
public String getIcon()
{
return icon;
}
public String getBackgroundColor()
{
return backgroundColor;
}
public String getTextColor()
{
return textColor;
}
@Override
public String toString()
{
return "Notification{" +
"message='" + message + '\'' +
", icon='" + icon + '\'' +
", backgroundColor='" + backgroundColor + '\'' +
", textColor='" + textColor + '\'' +
'}';
}
}
...@@ -206,7 +206,6 @@ main { ...@@ -206,7 +206,6 @@ main {
} }
.notification { .notification {
border: 2px solid var(--color-text);
border-radius: 5px; border-radius: 5px;
padding: 0 1vmin; padding: 0 1vmin;
display: flex; display: flex;
...@@ -216,6 +215,10 @@ main { ...@@ -216,6 +215,10 @@ main {
font-size: 1.8vmin; font-size: 1.8vmin;
} }
.notification-border {
border: 2px solid var(--color-text);
}
.notification-item { .notification-item {
padding: 10px 0 10px 10px; padding: 10px 0 10px 10px;
} }
...@@ -224,10 +227,14 @@ main { ...@@ -224,10 +227,14 @@ main {
font-size: 2.5vmin; font-size: 2.5vmin;
} }
.notification-wrapper-clear i { .notification-clear i {
font-size: 1.8vmin; font-size: 1.8vmin;
} }
.notification-clear:hover {
cursor: pointer;
}
.break-all { .break-all {
word-break: break-all; word-break: break-all;
} }
......
...@@ -60,6 +60,24 @@ ...@@ -60,6 +60,24 @@
</body> </body>
</#macro> </#macro>
<#macro showNotification notification>
<div class="row">
<div class="col s12 center-align">
<div class="notification-wrapper">
<div class="notification ${notification.getBackgroundColor()} ${notification.getTextColor()}">
<div>
<i class="${notification.getIcon()} notification-item"></i>
<span class="notification-item">${notification.getMessage()}</span>
</div>
<a class="notification-item notification-clear ${notification.getTextColor()}">
<i class="material-icons">clear</i>
</a>
</div>
</div>
</div>
</div>
</#macro>
<#macro buttonLink url icon localizationKey id="" color="background-blue" classes="" isDataUrl=false noUrl=false> <#macro buttonLink url icon localizationKey id="" color="background-blue" classes="" isDataUrl=false noUrl=false>
<a <#if !isDataUrl && !noUrl>href="<@s.url url/>"</#if> <a <#if !isDataUrl && !noUrl>href="<@s.url url/>"</#if>
id="${id}" id="${id}"
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<div class="row" id="firstUseBanner"> <div class="row" id="firstUseBanner">
<div class="col s12 center-align"> <div class="col s12 center-align">
<div class="notification-wrapper"> <div class="notification-wrapper">
<div class="notification text-default"> <div class="notification notification-border text-default">
<a href="<@s.url "/firstUse"/>" class="text-default"> <a href="<@s.url "/firstUse"/>" class="text-default">
<i class="fas fa-graduation-cap notification-item"></i> <i class="fas fa-graduation-cap notification-item"></i>
<span class="notification-item">${locale.getString("home.first.use.teaser")}</span> <span class="notification-item">${locale.getString("home.first.use.teaser")}</span>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment