From 6a66883178714f471ff95f3ff75d4caa0855c180 Mon Sep 17 00:00:00 2001 From: ewinslow Date: Sun, 13 Feb 2011 00:35:19 +0000 Subject: Progress refactoring the login dropdown and login forms -- not quite there yet, though Added another module: dropdown. git-svn-id: http://code.elgg.org/elgg/trunk@8191 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/core/account/login_box.php | 18 +++-- views/default/core/account/login_dropdown.php | 35 ++------- views/default/css/elements/layout_objects.php | 1 + views/default/css/elements/misc.php | 105 +++----------------------- views/default/css/elements/modules.php | 24 ++++++ views/default/forms/login.php | 44 ++++++----- 6 files changed, 82 insertions(+), 145 deletions(-) (limited to 'views') diff --git a/views/default/core/account/login_box.php b/views/default/core/account/login_box.php index c2d19f904..40482c3df 100644 --- a/views/default/core/account/login_box.php +++ b/views/default/core/account/login_box.php @@ -10,15 +10,17 @@ $login_url = elgg_get_site_url(); if (elgg_get_config('https_login')) { $login_url = str_replace("http:", "https:", $login_url); } + +$title = elgg_echo('login'); +$body = elgg_view_form('login', array('action' => "{$login_url}action/login")); + +echo elgg_view_module('login', $title, $body); + ?> -
-

- "{$login_url}action/login")); - ?> -
- + diff --git a/views/default/core/account/login_dropdown.php b/views/default/core/account/login_dropdown.php index a3fdab7ca..fb10ffd1d 100644 --- a/views/default/core/account/login_dropdown.php +++ b/views/default/core/account/login_dropdown.php @@ -15,44 +15,25 @@ if (elgg_is_logged_in()) { * @var unknown_type */ $form_body = elgg_view('forms/login'); -$form_body .= ""; $login_url = elgg_get_site_url(); if (elgg_get_config('https_login')) { $login_url = str_replace("http", "https", elgg_get_site_url()); } +$body = elgg_view_form('login', array('action' => "{$login_url}action/login"), array('returntoreferer' => TRUE)); ?>
- -
- $form_body, 'action' => "{$login_url}action/login")); ?> -
+ + 'elgg-togglee-login-dropdown-box', 'class' => 'hidden')); ?>
- - \ No newline at end of file diff --git a/views/default/css/elements/layout_objects.php b/views/default/css/elements/layout_objects.php index 56fba7592..50b7cf767 100644 --- a/views/default/css/elements/layout_objects.php +++ b/views/default/css/elements/layout_objects.php @@ -16,6 +16,7 @@ * without having to specify the body div's width. * * @todo check what happens with long
 tags or large images
+ * @todo Move this to its own file -- it is very complicated and should not have to be overridden.
  */
 ?>
 
diff --git a/views/default/css/elements/misc.php b/views/default/css/elements/misc.php
index 944f72bc6..f845a65eb 100644
--- a/views/default/css/elements/misc.php
+++ b/views/default/css/elements/misc.php
@@ -12,131 +12,50 @@
 /* ***************************************
 	LOGIN / REGISTER
 *************************************** */
-/* login in sidebar */
-.elgg-aside #login {
-	width:auto;
-}
-.elgg-aside #login form {
-	width:auto;
-}
-.elgg-aside #login .login-textarea {
-	width:196px;
-}
-/* default login and register forms */
-#login input[type="text"],
-#login input[type="password"],
-.register input[type="text"],
-.register input[type="password"] {
-	margin:0 0 10px 0;
-}
-.register input[type="text"],
-.register input[type="password"] {
-	width:380px;
-}
-.rememberme label {
-	font-weight:normal;
-	font-size:100%;
-}
-.loginbox .elgg-button-submit {
-	margin-right: 15px;
-}
-#login .persistent-login {
-	float:right;
-	display:block;
-	margin-top:-34px;
-	margin-left:80px;
-}
-#login .persistent-login label {
-	font-size:1.0em;
-	font-weight: normal;
-	cursor: pointer;
-}
 #login-dropdown {
-	float:right;
 	position: absolute;
-	top:10px;
+	top:0;
 	right:0;
 	z-index: 9599;
 }
-#login-dropdown #signin-button {
-	padding:10px 0px 12px;
-	line-height:23px;
-	text-align:right;
-}
-#login-dropdown #signin-button a.signin {
+
+.signin {
 	padding:2px 6px 3px 6px;
 	text-decoration:none;
 	font-weight:bold;
 	position:relative;
 	margin-left:0;
-	color:white;
+	color: white;
 	border:1px solid #71B9F7;
 	-webkit-border-radius:4px;
 	-moz-border-radius:4px;
 	border-radius:4px;
 }
-#login-dropdown #signin-button a.signin span {
+
+.signin span {
 	padding:4px 0 6px 12px;
 	background-image:url(_graphics/elgg_sprites.png);
 	background-position:-150px -51px;
 	background-repeat:no-repeat;
 }
-#login-dropdown #signin-button a.signin:hover {
+
+.signin:hover {
 	background-color:#71B9F7;
 	/* color:black; */
 }
-#login-dropdown #signin-button a.signin:hover span {
+.signin:hover span {
 	/* background-position:-150px -71px; */
 }
-#login-dropdown #signin-button a.signin.menu-open {
+.signin.elgg-state-active {
 	background:#cccccc !important;
 	color:#666666 !important;
 	border:1px solid #cccccc;
 	outline:none;
 }
-#login-dropdown #signin-button a.signin.menu-open span {
-	background-position:-150px -71px;
-	color:#333333;
-}
-#login-dropdown #signin-menu {
-	-moz-border-radius-topleft:5px;
-	-moz-border-radius-bottomleft:5px;
-	-moz-border-radius-bottomright:5px;
-	-webkit-border-top-left-radius:5px;
-	-webkit-border-bottom-left-radius:5px;
-	-webkit-border-bottom-right-radius:5px;
-	display:none;
-	background-color:white;
-	position:absolute;
-	width:210px;
-	z-index:100;
-	border:5px solid #CCCCCC;
-	text-align:left;
-	padding:12px;
-	top: 26px;
-	right: 0px;
-	margin-top:5px;
-	margin-right: 0px;
+.signin.elgg-state-active {
+	background-position: -150px -71px;
 	color:#333333;
-	-webkit-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.45);
-	-moz-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.45);
-}
-#login-dropdown #signin-menu input[type=text],
-#login-dropdown #signin-menu input[type=password] {
-	width:203px;
-	margin:0 0 5px;
 }
-#login-dropdown #signin-menu p {
-	margin:0;
-}
-#login-dropdown #signin-menu label {
-	font-weight:normal;
-	font-size: 100%;
-}
-#login-dropdown #signin-menu .elgg-button-submit {
-	margin-right:15px;
-}
-
 
 
 /* ***************************************
diff --git a/views/default/css/elements/modules.php b/views/default/css/elements/modules.php
index 0f59e2cad..b16a99d83 100644
--- a/views/default/css/elements/modules.php
+++ b/views/default/css/elements/modules.php
@@ -43,6 +43,30 @@
 	color: #0054A7;
 }
 
+.elgg-module-dropdown {
+	-moz-border-radius-topleft:5px;
+	-moz-border-radius-bottomleft:5px;
+	-moz-border-radius-bottomright:5px;
+	-webkit-border-top-left-radius:5px;
+	-webkit-border-bottom-left-radius:5px;
+	-webkit-border-bottom-right-radius:5px;
+	display:none;
+	background-color:white;
+	position:absolute;
+	width:210px;
+	z-index:100;
+	border:5px solid #CCCCCC;
+	text-align:left;
+	padding:12px;
+	top: 26px;
+	right: 0px;
+	margin-top:5px;
+	margin-right: 0px;
+	color:#333333;
+	-webkit-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.45);
+	-moz-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.45);
+}
+
 /* Featured */
 .elgg-module-featured {
 	border: 1px solid #4690D6;
diff --git a/views/default/forms/login.php b/views/default/forms/login.php
index 862b5ab9d..44d134ba8 100644
--- a/views/default/forms/login.php
+++ b/views/default/forms/login.php
@@ -7,29 +7,39 @@
  */
 ?>
 
-
-
- 'username', 'class' => 'login-textarea')); ?> -
- 'password', 'class' => 'login-textarea')); ?>
+
+ + 'username')); ?> +
+
+ + 'password')); ?> +
- elgg_echo('login'))); ?> + - - -
+
+ elgg_echo('login'))); ?> - + + + 'returntoreferer', 'value' => 'true')); + } + ?> +
+
\ No newline at end of file + + \ No newline at end of file -- cgit v1.2.3