From: Felix Dörre Date: Tue, 8 Jul 2014 22:22:25 +0000 (+0200) Subject: Draft for "Add mail certificate" X-Git-Url: https://code.wpia.club/?p=gigi.git;a=commitdiff_plain;h=7f22ccdc95d968a3f8a5affcab74687c22823d74 Draft for "Add mail certificate" --- diff --git a/src/org/cacert/gigi/Gigi.java b/src/org/cacert/gigi/Gigi.java index 4f51029c..2ede0a52 100644 --- a/src/org/cacert/gigi/Gigi.java +++ b/src/org/cacert/gigi/Gigi.java @@ -27,6 +27,7 @@ import org.cacert.gigi.pages.TestSecure; import org.cacert.gigi.pages.Verify; import org.cacert.gigi.pages.account.ChangePasswordPage; import org.cacert.gigi.pages.account.MailAdd; +import org.cacert.gigi.pages.account.MailCertificateAdd; import org.cacert.gigi.pages.account.MailCertificates; import org.cacert.gigi.pages.account.MailOverview; import org.cacert.gigi.pages.account.MyDetails; @@ -57,6 +58,7 @@ public class Gigi extends HttpServlet { pages.put(MyDetails.PATH, new MyDetails()); pages.put(ChangePasswordPage.PATH, new ChangePasswordPage()); pages.put(RegisterPage.PATH, new RegisterPage()); + pages.put(MailCertificateAdd.PATH, new MailCertificateAdd()); pages.put(MailOverview.DEFAULT_PATH, new MailOverview( "My email addresses")); pages.put(MailAdd.DEFAULT_PATH, new MailAdd("Add new email")); diff --git a/src/org/cacert/gigi/pages/account/MailCertificateAdd.java b/src/org/cacert/gigi/pages/account/MailCertificateAdd.java new file mode 100644 index 00000000..7d8a8777 --- /dev/null +++ b/src/org/cacert/gigi/pages/account/MailCertificateAdd.java @@ -0,0 +1,25 @@ +package org.cacert.gigi.pages.account; + +import java.io.IOException; +import java.util.HashMap; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.cacert.gigi.pages.Page; + +public class MailCertificateAdd extends Page { + public static final String PATH = "/account/certs/email/new"; + + public MailCertificateAdd() { + super("Create Email certificate"); + } + + @Override + public void doGet(HttpServletRequest req, HttpServletResponse resp) + throws IOException { + HashMap vars = new HashMap(); + getDefaultTemplate().output(resp.getWriter(), getLanguage(req), vars); + } + +} diff --git a/src/org/cacert/gigi/pages/account/MailCertificateAdd.templ b/src/org/cacert/gigi/pages/account/MailCertificateAdd.templ new file mode 100644 index 00000000..553ddda9 --- /dev/null +++ b/src/org/cacert/gigi/pages/account/MailCertificateAdd.templ @@ -0,0 +1,121 @@ +

+

+ +

+ +

http://www.cacert.org/cps.php

+ +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+
+ +
+
+
+ +
+
+ +
+ + + +
+ + + +
+
+ +
+ + + + +
+
\ No newline at end of file diff --git a/static/static/default.css b/static/static/default.css index fe09d6f3..5372aa13 100644 --- a/static/static/default.css +++ b/static/static/default.css @@ -582,6 +582,7 @@ td.storyLeft { text-align: center; margin-left:auto; margin-right:auto; + width: 700px; } td.greytxt { @@ -737,4 +738,10 @@ img{ } formMandatory{ color: red; +} +.experthidden{ + display:none; +} +.expertoff{ + display:none; } \ No newline at end of file diff --git a/static/static/menu.js b/static/static/menu.js index b73827eb..12c3a30f 100644 --- a/static/static/menu.js +++ b/static/static/menu.js @@ -21,12 +21,35 @@ } } } + function showExpert(a) + { + b=document.getElementsByClassName("expert"); + for(i=0;b.length>i;i++) + { + if(!a) {b[i].setAttribute("class","expert experthidden"); } + else {b[i].setAttribute("class","expert");} + } + b=document.getElementsByClassName("expertoff"); + for(i=0;b.length>i;i++) + { + b[i].setAttribute("class",""); + } + + } + function init(){ + initMenu(); + showExpert(false); + var expert = document.getElementById("expertbox"); + if(expert !== null) { + expert.onchange = (function(expert){return function(){showExpert(expert.checked)}})(expert); + } + } (function(oldLoad) { if (oldLoad == undefined) { - window.onload = initMenu; + window.onload = init; } else { window.onload = function() { - initMenu(); + init(); oldLoad(); } }