From 7e201c01c06c2090fc22c6399f08c862b3127b35 Mon Sep 17 00:00:00 2001 From: Mariusz Dziemianowicz Date: Sat, 12 Oct 2013 19:28:52 +0200 Subject: [PATCH] Worked on #25: Login/register pages --- public_html/media/css/auth.css | 50 ++++++++++++++++++++++++++++++ public_html/media/css/core.css | 17 ++++++++++ src/Controllers/AuthController.php | 2 ++ src/Views/auth-login.phtml | 17 ++++++---- src/Views/auth-register.phtml | 28 +++++++++++------ 5 files changed, 99 insertions(+), 15 deletions(-) create mode 100644 public_html/media/css/auth.css diff --git a/public_html/media/css/auth.css b/public_html/media/css/auth.css new file mode 100644 index 00000000..d0916ac0 --- /dev/null +++ b/public_html/media/css/auth.css @@ -0,0 +1,50 @@ +form.auth { + display: table; + border-collapse:separate; + border-spacing: 0 0.5em; + width: 400px; +} + +form.auth div { + display: table-row; +} + +form.auth label { + display: table-cell; + text-align: right; + float: left; + width: 144px; + margin: 5px 16px 0 0; +} + +form.auth input { + display: table-cell; + font-family: inherit; + display: block; +} + +form.auth input:not([type="submit"]) { + width: 156px; + padding: 5px; + border-width: 2px; + margin: 0; +} + +form.auth input[type="submit"] { + margin: 0 auto; + background-color: #77f; + border: 0; + color: white; + font-weight: bold; + font-size: 1em; + padding: 8px 16px; +} + +form.auth input[type="submit"]:hover { + background-color: #55f; +} + +form.auth p { + text-align: center; + margin: 10px 0; +} diff --git a/public_html/media/css/core.css b/public_html/media/css/core.css index 29b68317..e2697986 100644 --- a/public_html/media/css/core.css +++ b/public_html/media/css/core.css @@ -130,3 +130,20 @@ a:focus i[class*='icon-'], a:hover i[class*='icon-'] { background-color: red; } + +.alert { + text-align: center; + padding: 10px; + border-style: solid; + border-width: 1px; +} + +.alert-error { + border-color: #faa; + background-color: #fdd; +} + +.alert-warning { + border-color: #ffa; + background-color: #ffd; +} diff --git a/src/Controllers/AuthController.php b/src/Controllers/AuthController.php index a65b67bc..cd2625bc 100644 --- a/src/Controllers/AuthController.php +++ b/src/Controllers/AuthController.php @@ -12,6 +12,7 @@ class AuthController */ public function loginAction() { + $this->context->stylesheets []= 'auth.css'; $this->context->subTitle = 'authentication form'; //check if already logged in @@ -61,6 +62,7 @@ class AuthController */ public function registerAction() { + $this->context->stylesheets []= 'auth.css'; $this->context->subTitle = 'registration form'; //check if already logged in diff --git a/src/Views/auth-login.phtml b/src/Views/auth-login.phtml index 13c45b61..3727e2c7 100644 --- a/src/Views/auth-login.phtml +++ b/src/Views/auth-login.phtml @@ -1,6 +1,11 @@ -
+ +
- +

If you don't have an account yet,
click here to create a new one.

+
+ +
+
@@ -9,11 +14,11 @@ + context->transport->errorMessage)): ?> +

Error: context->transport->errorMessage ?>

+ +
- -context->transport->errorMessage)): ?> -

context->transport->errorMessage ?>

- diff --git a/src/Views/auth-register.phtml b/src/Views/auth-register.phtml index b00d2986..7dd159d9 100644 --- a/src/Views/auth-register.phtml +++ b/src/Views/auth-register.phtml @@ -7,15 +7,14 @@

After this, an admin will have to confirm your registration.

-
+
- - +

Registered users can view more content,
upload files and add posts to favorites.

- - + +
@@ -28,12 +27,23 @@
+
+ + +
+ +
+

Your e-mail will be used to show your Gravatar.
Leave blank for random Gravatar.

+
+ + context->transport->errorMessage)): ?> +
+

Error: context->transport->errorMessage ?>

+
+ +
- - context->transport->errorMessage)): ?> -

context->transport->errorMessage ?>

-