From 4cf860d07718facac4d1b83f7db436040f2f46d0 Mon Sep 17 00:00:00 2001 From: "max.mehl" Date: Thu, 23 Mar 2017 21:37:01 +0100 Subject: [PATCH] add further checkboxes to form and improve styling --- config.toml | 4 +++- layouts/partials/sign.html | 17 +++++++++++++---- static/cgi/sign.php | 10 +++++++--- static/css/custom.css | 10 ++++++++-- 4 files changed, 31 insertions(+), 10 deletions(-) diff --git a/config.toml b/config.toml index 9698fe6..3fa730f 100644 --- a/config.toml +++ b/config.toml @@ -84,7 +84,9 @@ DefaultContentLanguage = "en" formEmail = "Email (required)" formCountry = "Country" formZip = "ZIP Code" - formPermission1 = "I have read the privacy statement and would like to stay informed about the future of this campaign" + formPermissionPriv = "I have read and accepted the [privacy statement](#)" + formPermissionNews = "I want to stay informed about the future of PMPC" + formPermissionPub = "I want my signature to appear in the [list of signatures](/signatures)" formSubmit = "Sign" # Spread the word section diff --git a/layouts/partials/sign.html b/layouts/partials/sign.html index ee4d861..62b131b 100644 --- a/layouts/partials/sign.html +++ b/layouts/partials/sign.html @@ -20,10 +20,19 @@ -
- +

+ +
+ +
+ +


diff --git a/static/cgi/sign.php b/static/cgi/sign.php index bde1ddf..0bf513c 100644 --- a/static/cgi/sign.php +++ b/static/cgi/sign.php @@ -16,10 +16,12 @@ if(empty($action)) { $email = isset($_GET['email']) ? $_GET['email'] : false; $country = isset($_GET['country']) ? $_GET['country'] : false; $zip = isset($_GET['zip']) ? $_GET['zip'] : false; - $perm = isset($_GET['permission']) ? $_GET['permission'] : false; + $permPriv = isset($_GET['permissionPriv']) ? $_GET['permissionPriv'] : false; + $permNews = isset($_GET['permissionNews']) ? $_GET['permissionNews'] : false; + $permPub = isset($_GET['permissionPub']) ? $_GET['permissionPub'] : false; // Check for missing required fields - if(empty($name) || empty($email) || empty($perm)) { + if(empty($name) || empty($email) || empty($permPriv)) { echo "At least one required variable is empty."; exit(1); } @@ -73,7 +75,9 @@ if ($action === "sign") { "email" => $email, "country" => $country, "zip" => $zip, - "perm" => $perm, + "permPriv" => $permPriv, + "permNews" => $permNews, + "permPub" => $permPub, "code" => $code, "confirmed" => "no"); $data[] = $newsig; // newsig is a separated variable for debugging purposes diff --git a/static/css/custom.css b/static/css/custom.css index 66b4605..6ff706b 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -68,8 +68,14 @@ content: "\f08d"; padding-left: 3px; } -.form-pe { - max-width: 600px; +p.form-pe { + text-align: left; + max-width: 530px; /* to not let the checkboxed go far more left than the input boxes above */ + margin: 0 auto; +} +p.form-pe a { + color: inherit; + text-decoration: underline; } input#honey { display: none;