From ef7f56ffab576bf784948baa3eaa898fc4529081 Mon Sep 17 00:00:00 2001 From: Janis Streib Date: Fri, 27 Jun 2014 10:53:05 +0200 Subject: [PATCH] Added dummy mail add --- src/org/cacert/gigi/Gigi.java | 2 ++ .../cacert/gigi/pages/account/MailAdd.java | 33 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 src/org/cacert/gigi/pages/account/MailAdd.java diff --git a/src/org/cacert/gigi/Gigi.java b/src/org/cacert/gigi/Gigi.java index 8cc076e1..85d17ea0 100644 --- a/src/org/cacert/gigi/Gigi.java +++ b/src/org/cacert/gigi/Gigi.java @@ -23,6 +23,7 @@ import org.cacert.gigi.pages.Page; import org.cacert.gigi.pages.PolicyRedir; import org.cacert.gigi.pages.TestSecure; import org.cacert.gigi.pages.Verify; +import org.cacert.gigi.pages.account.MailAdd; import org.cacert.gigi.pages.account.MailCertificates; import org.cacert.gigi.pages.account.MailOverview; import org.cacert.gigi.pages.account.MyDetails; @@ -54,6 +55,7 @@ public class Gigi extends HttpServlet { pages.put(PolicyRedir.PATH, new PolicyRedir()); pages.put(MailOverview.DEFAULT_PATH, new MailOverview( "My email addresses")); + pages.put(MailAdd.DEFAULT_PATH, new MailAdd("Add new email")); String templ = ""; try (BufferedReader reader = new BufferedReader(new InputStreamReader( new FileInputStream(new File("templates/base.html"))))) { diff --git a/src/org/cacert/gigi/pages/account/MailAdd.java b/src/org/cacert/gigi/pages/account/MailAdd.java new file mode 100644 index 00000000..6c5e1711 --- /dev/null +++ b/src/org/cacert/gigi/pages/account/MailAdd.java @@ -0,0 +1,33 @@ +package org.cacert.gigi.pages.account; + +import java.io.IOException; +import java.util.LinkedList; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.cacert.gigi.output.DataTable; +import org.cacert.gigi.output.DataTable.Cell; +import org.cacert.gigi.pages.Page; + +public class MailAdd extends Page{ + public static final String DEFAULT_PATH = "/account/mail/new"; + public MailAdd(String title) { + super(title); + } + + @Override + public void doGet(HttpServletRequest req, HttpServletResponse resp) + throws IOException { + LinkedList cells = new LinkedList<>(); + cells.add(new Cell("Add Email", true, 2, "class=\"title\"")); + cells.add(new Cell("Email Address", true)); + cells.add(new Cell("", false)); + String trans = getLanguage(req).getTranslation("I own or am authorised to control this email address"); + cells.add(new Cell("", false, 2)); + DataTable dt = new DataTable(2, cells); + dt.output(resp.getWriter(), getLanguage(req)); + } + +} -- 2.39.2