]> WPIA git - gigi.git/commitdiff
add: enable that user can see all certificates issued to his account
authorINOPIAE <m.maengel@inopiae.de>
Sun, 14 Aug 2016 06:07:17 +0000 (08:07 +0200)
committerINOPIAE <m.maengel@inopiae.de>
Tue, 16 Aug 2016 09:42:59 +0000 (11:42 +0200)
fixes issue #54

Change-Id: Ib19bb63a4f787df4c2292383535f3e06b304f4df

src/org/cacert/gigi/pages/account/certs/CertificateModificationForm.java
src/org/cacert/gigi/pages/account/certs/CertificateModificationForm.templ

index a58f3a6c961e4e5ac7067a17c5c6f855a14f5ed3..fc36792091f27ce0f451937d206f5ec17d5d4085 100644 (file)
@@ -17,9 +17,9 @@ import org.cacert.gigi.pages.LoginPage;
 
 public class CertificateModificationForm extends Form {
 
-    CertificateOwner target;
+    private CertificateOwner target;
 
-    final boolean withRevoked;
+    private final boolean withRevoked;
 
     public CertificateModificationForm(HttpServletRequest hsr, boolean withRevoked) {
         super(hsr);
@@ -33,6 +33,10 @@ public class CertificateModificationForm extends Form {
 
     @Override
     public boolean submit(PrintWriter out, HttpServletRequest req) {
+        String action = req.getParameter("action");
+        if ( !"revoke".equals(action)) {
+            return false;
+        }
         String[] certs = req.getParameterValues("certs[]");
         if (certs == null) {
             // nothing to do
@@ -63,6 +67,13 @@ public class CertificateModificationForm extends Form {
     protected void outputContent(PrintWriter out, Language l, Map<String, Object> vars) {
         vars.put("certs", new CertificateIterable(target.getCertificates(withRevoked)));
         vars.put("certTable", certTable);
+        if (withRevoked) {
+            vars.put("all", "btn-primary");
+            vars.put("current", "btn-info");
+        } else {
+            vars.put("all", "btn-info");
+            vars.put("current", "btn-primary");
+        }
         myTemplate.output(out, l, vars);
     }
 
index 76f60b00b9202be1b0120299496e86a793cb70e8..d4e2f74e90ea3a0a1b29328ba4645506fe805f27 100644 (file)
@@ -1,2 +1,3 @@
+<a href="?" class="btn <?=$current?>"><?=_Show Current Certificates?></a> <a href="?withRevoked" class="btn <?=$all?>"><?=_Show All Certificates?></a>
 <?=$certTable?>
-<input type="submit" value="<?=_Revoke Selected Certificates?>"/>
\ No newline at end of file
+<button class="btn btn-danger" name="action" value="revoke"><?=_Revoke Selected Certificates?></button>