Browse Source

minor code improvement

drop_old_mail
Stephan Richter 3 years ago
parent
commit
df1e4c5840
  1. 2
      pom.xml
  2. 6
      src/main/java/de/srsoftware/widerhall/web/Web.java
  3. 3
      static/templates/unsubscribe.st

2
pom.xml

@ -6,7 +6,7 @@
<groupId>org.example</groupId> <groupId>org.example</groupId>
<artifactId>Widerhall</artifactId> <artifactId>Widerhall</artifactId>
<version>0.2.16</version> <version>0.2.17</version>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>

6
src/main/java/de/srsoftware/widerhall/web/Web.java

@ -26,6 +26,7 @@ public class Web extends TemplateServlet {
public static final String WEB_ROOT = "/web"; public static final String WEB_ROOT = "/web";
private static final String ADD_LIST = "add_list"; private static final String ADD_LIST = "add_list";
private static final String CONFIRM = "confirm"; private static final String CONFIRM = "confirm";
private static final String CSS = "css";
private static final Logger LOG = LoggerFactory.getLogger(Web.class); private static final Logger LOG = LoggerFactory.getLogger(Web.class);
private static final String ADMIN = "admin"; private static final String ADMIN = "admin";
private static final String INSPECT = "inspect"; private static final String INSPECT = "inspect";
@ -197,9 +198,10 @@ public class Web extends TemplateServlet {
loadTemplates(); loadTemplates();
data.put(NOTES,t("Templates have been reloaded")); data.put(NOTES,t("Templates have been reloaded"));
path = INDEX; path = INDEX;
case "css":
case INDEX:
case UNSUBSCRIBE: case UNSUBSCRIBE:
data.put(LIST,list.email());
case CSS:
case INDEX:
return loadTemplate(path,data,resp); return loadTemplate(path,data,resp);
case SUBSCRIBE: case SUBSCRIBE:
if (list.isOpenFor(user)) { if (list.isOpenFor(user)) {

3
static/templates/unsubscribe.st

@ -12,9 +12,8 @@
«messages()» «messages()»
<h1>Widerhall Subscription</h1> <h1>Widerhall Subscription</h1>
<form method="POST"> <form method="POST">
<input type="hidden" name="list" value="«data.list.email.prefix»@«data.list.email.domain»" />
<fieldset> <fieldset>
<legend>Un-subscribe from "«data.list.email.prefix»@«data.list.email.domain»"</legend> <legend>Un-subscribe from "«data.list»"</legend>
<label> <label>
<input type="text" name="email" value="«if(data.email)»«data.email»«else»«data.user.email»«endif»"> <input type="text" name="email" value="«if(data.email)»«data.email»«else»«data.user.email»«endif»">
Email Email

Loading…
Cancel
Save