From 458903d755aaa5406dbe86c39ee8cb0a2ee62c41 Mon Sep 17 00:00:00 2001 From: Stephan Richter Date: Mon, 18 Apr 2022 09:47:59 +0200 Subject: [PATCH] gui work --- .../de/srsoftware/widerhall/data/ListMember.java | 13 ++++++++----- static/templates/css.st | 9 +++++++++ static/templates/footer.st | 3 +++ static/templates/index.st | 1 + 4 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 static/templates/footer.st diff --git a/src/main/java/de/srsoftware/widerhall/data/ListMember.java b/src/main/java/de/srsoftware/widerhall/data/ListMember.java index 439c1e1..cf793b3 100644 --- a/src/main/java/de/srsoftware/widerhall/data/ListMember.java +++ b/src/main/java/de/srsoftware/widerhall/data/ListMember.java @@ -3,6 +3,7 @@ package de.srsoftware.widerhall.data; import de.srsoftware.widerhall.Util; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.stringtemplate.v4.ST; import javax.xml.crypto.Data; import java.sql.SQLException; @@ -87,15 +88,17 @@ public class ListMember { var words = new ArrayList(); if ((state & STATE_OWNER) > 0) words.add("owner"); if ((state & STATE_SUBSCRIBER) > 0) words.add("subscriber"); + if ((state & STATE_AWAITING_CONFIRMATION) > 0) words.add("awaiting confirmation"); return String.join(", ",words); } private ListMember save() throws SQLException { - Database.open().insertInto(TABLE_NAME) - .values(Map.of(LIST_EMAIL,listEmail, - USER_EMAIL,userEmail, - STATE,state)) - .run(); + var vals = new HashMap(); + vals.put(LIST_EMAIL,listEmail); + vals.put(USER_EMAIL,userEmail); + vals.put(STATE,state); + if (token != null) vals.put(TOKEN,token); + Database.open().insertInto(TABLE_NAME).values(vals).run(); return this; } diff --git a/static/templates/css.st b/static/templates/css.st index 97936e7..24211fc 100644 --- a/static/templates/css.st +++ b/static/templates/css.st @@ -30,4 +30,13 @@ h1 { .user{ background: lime; float: right; +} + +.footer{ + position: absolute; + bottom: 0; + left: 0; + right: 0; + text-align: right; + margin: 5px; } \ No newline at end of file diff --git a/static/templates/footer.st b/static/templates/footer.st new file mode 100644 index 0000000..4193584 --- /dev/null +++ b/static/templates/footer.st @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/static/templates/index.st b/static/templates/index.st index e989c69..38f65a1 100644 --- a/static/templates/index.st +++ b/static/templates/index.st @@ -12,5 +12,6 @@ «messages()»

Widerhall Index page

«listlist()» + «footer()» \ No newline at end of file