From 612332a1a75e1fdddbabae1608a7ee52520511ef Mon Sep 17 00:00:00 2001
From: Shish <shish@shishnet.org>
Date: Sun, 3 Jan 2010 09:36:53 +0000
Subject: [PATCH] more danbooru updates

---
 themes/danbooru/layout.class.php |  9 +++++++--
 themes/danbooru/style.css        |  7 +++++--
 themes/danbooru/user.theme.php   | 31 ++++++++++++++++++++++++++-----
 3 files changed, 38 insertions(+), 9 deletions(-)

diff --git a/themes/danbooru/layout.class.php b/themes/danbooru/layout.class.php
index 75fc5edf..af2aa468 100644
--- a/themes/danbooru/layout.class.php
+++ b/themes/danbooru/layout.class.php
@@ -44,7 +44,7 @@ Tips
 
 class Layout {
 	public function display_page($page) {
-		global $config;
+		global $config, $user;
 
 		$theme_name = $config->get_string('theme');
 		$base_href = $config->get_string('base_href');
@@ -98,7 +98,12 @@ class Layout {
 
 		// bzchan: CUSTOM LINKS are prepared here, change these to whatever you like
 		$custom_links = "";
-		$custom_links .= "<li><a href='".make_link('user')."'>My Account</a></li>";
+		if($user->is_anonymous()) {
+			$custom_links .= "<li><a href='".make_link('user_admin/login')."'>My Account</a></li>";
+		}
+		else {
+			$custom_links .= "<li><a href='".make_link('user')."'>My Account</a></li>";
+		}
 		$custom_links .= "<li><a href='".make_link('post/list')."'>Posts</a></li>";
 		$custom_links .= "<li><a href='".make_link('comment/list')."'>Comments</a></li>";
 		$custom_links .= "<li><a href='".make_link('tags')."'>Tags</a></li>";
diff --git a/themes/danbooru/style.css b/themes/danbooru/style.css
index 0cbb2a79..1b9412a7 100644
--- a/themes/danbooru/style.css
+++ b/themes/danbooru/style.css
@@ -66,15 +66,18 @@ font-size:1.4em;
 h5 {
 font-size:1.2em;
 }
+table.zebra {border-collapse: collapse;border-spacing: 0;}
+table.zebra > tbody > tr:hover {background: #FFD;}
+table.zebra th {color: #171BB3; padding-right: 8px;}
+table.zebra td {border: 1px dotted #EEE;margin: 0;padding-right: 8px;}
+table.zebra th {margin: 0;text-align: left;}
 thead {
 -moz-background-clip:border;
 -moz-background-inline-policy:continuous;
 -moz-background-origin:padding;
-background:#DEDEDE none repeat scroll 0 0;
 font-weight:bold;
 }
 td {
-text-align:center;
 vertical-align:top;
 }
 #subtitle {
diff --git a/themes/danbooru/user.theme.php b/themes/danbooru/user.theme.php
index 0f149704..d1bd459a 100644
--- a/themes/danbooru/user.theme.php
+++ b/themes/danbooru/user.theme.php
@@ -2,15 +2,36 @@
 
 class CustomUserPageTheme extends UserPageTheme {
 	public function display_login_page($page) {
+		global $config;
 		$page->set_title("Login");
 		$page->set_heading("Login");
-		$page->add_block(new NavBlock());
-		$page->add_block(new Block("Login There",
-			"There should be a login box to the left"));
+		$page->disable_left();
+		$html = "
+			<form action='".make_link("user_admin/login")."' method='POST'>
+				<table summary='Login Form'>
+					<tr>
+						<td width='70'><label for='user'>Name</label></td>
+						<td width='70'><input id='user' type='text' name='user'></td>
+					</tr>
+					<tr>
+						<td><label for='pass'>Password</label></td>
+						<td><input id='pass' type='password' name='pass'></td>
+					</tr>
+					<tr><td colspan='2'><input type='submit' value='Log In'></td></tr>
+				</table>
+			</form>
+		";
+		if($config->get_bool("login_signup_enabled")) {
+			$html .= "<small><a href='".make_link("user_admin/create")."'>Create Account</a></small>";
+		}
+		$page->add_block(new Block("Login", $html, "main", 90));
 	}
 
 	public function display_user_links($page, $user, $parts) {
-	//	$page->add_block(new Block("User Links", join("<br>", $parts), "left", 10));
+		// no block in this theme
+	}
+	public function display_login_block(Page $page) {
+		// no block in this theme
 	}
 
 	public function display_user_block($page, $user, $parts) {
@@ -49,7 +70,7 @@ class CustomUserPageTheme extends UserPageTheme {
 
 		$page->set_title("Create Account");
 		$page->set_heading("Create Account");
-		$page->add_block(new NavBlock());
+		$page->disable_left();
 		$page->add_block(new Block("Signup", $html));
 	}