[Dovecot] Quota template - colored bar based on % (#3525)

* [Dovecot] Quarantine template: css for mobile devices

* [Dovecot] Colored quota bar based on %

formatting html
master
Lukáš Matula 2020-05-08 18:39:03 +02:00 committed by GitHub
parent 099be31928
commit fe05e24579
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 51 additions and 27 deletions

View File

@ -1,29 +1,53 @@
<html> <html>
<head> <head>
<style> <style>
body { body {
font-family: sans-serif; font-family: sans-serif;
} }
#progressbar { div {
background-color: #f0f0f0; /* width based on text fill*/
border-radius: 0px; display: inline-block;
padding: 0px; }
width:50%; #progressbar {
} color: #000;
#progressbar > div { background-color: #f1f1f1;
background-color: #ff9c9c; width: 100%;
width: {{percent}}%; }
height: 20px; {% if (percent >= 95) %}
border-radius: 0px; #progressbar > div {
} color: #fff;
</style> background-color: #FF0000;
</head> text-align: center;
<body> padding: 0.01em;
<p>Hi {{username}}!<br><br> width: {{percent}}%;
Your mailbox is now {{percent}}% full, please consider deleting old messages to still be able to receive new mails in the future.<br> }
<div id="progressbar"> {% elif (percent < 95) and (percent >= 80) %}
<div></div> #progressbar > div {
</div> color: #fff;
</p> background-color: #FF8C00;
</body> text-align: center;
padding: 0.01em;
width: {{percent}}%;
}
{% else %}
#progressbar > div {
color: #fff;
background-color: #00B000;
text-align: center;
padding: 0.01em;
width: {{percent}}%;
}
{% endif %}
</style>
</head>
<body>
<div>
<p>Hi {{username}}!<br><br>
Your mailbox is now {{percent}}% full, please consider deleting old messages to still be able to receive new mails in the future.<br>
<div id="progressbar">
<div>{{percent}}%</div>
</div>
</p>
</div>
</body>
</html> </html>