summaryrefslogtreecommitdiffstats
path: root/views/layouts/default.html.php
blob: da09a4cabbb52bcea167462272f29c9b5ffb4804 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
use \lithium\security\Auth;
?>
<!DOCTYPE html>
<html>
<head>
	<?= $this->html->charset() ?>
	<title>OtakuHub > <?= $this->title() ?></title>
	<?= $this->html->style(array('style', 'base')) ?>
	<?= $this->html->style(array('themes/light')) ?>
	<?= $this->html->style(array('prettyPhoto')) ?>

	<?= $this->html->script("/js/jquery-1.6.1.min.js") ?>

	<script type="text/javascript" >
	function clearDefault(el) {
		if (el.defaultValue == el.value)
			el.value = ""
	}
	function resetValue(el) {
		el.value = "Search..."
	}
	</script>
	<link href='http://fonts.googleapis.com/css?family=Cantarell:regular,bold&v1' rel='stylesheet' type='text/css'>
</head>
<header>
	<?php
	$links = array(
		'Home' => '/',
		'Anime' => '/anime',
		'Manga' => '/manga',
	);
	$user = Auth::check('default');
	if ($user)
	{
		$links['Feed'] = '/users/feed';
		$links['Profile'] = '/users/feed';
		$links['Logout'] = '/logout';
	}
	else
	{
		$links['Sign up'] = '/users/signup';
		$links['Login'] = '/login'; // overwritten with JS
		echo '
		<div id="login" style="display: none">
		<h2>Login</h2>
		';
		echo $this->form->create(null, array('url' => '/login', 'id' => 'login'));
		echo $this->form->field('username', array('type' => 'textbox'));
		echo $this->form->field('password', array('type' => 'password'));
		echo $this->form->submit('Login');
		echo $this->form->end();
		echo '</div>';
	}
	echo '
	<nav>
	<ul>
	';
	foreach ($links as $name => $path) {
		if ($path == '/')
			echo '<li class="current">';
		else
			echo '<li>';
		echo "<a href=\"$path\">$name</a></li>";
	}
	echo '
	</ul>
	</nav>
	';
	?>

	<?= $this->form->create(null, array('url' => '/search/index/anime', 'class' => 'search', 'method' => 'get')); ?>
	<?= $this->form->text('search', array('value' => 'Search...', 'onFocus' => 'clearDefault(this)', 'style' => 'width: 200px')); ?>
	<input type="submit" value="Go">
	<?= $this->form->end(); ?>

	<br class="cl" />
</header>
<div id="page">
  	<?= $this->content() ?>
</div>
<footer>
	<p>Copyright ©2011, <a href="http://www.melenion.org">Melenion Dev Studios</a></p>
	<br class="cl" />
</footer>

<?= $this->html->script("/js/jquery.anchor.js"); ?>
<?= $this->html->script("/js/jquery.tools.min.js"); ?>
<?= $this->html->script("/js/jquery.form.js"); ?>
<?= $this->html->script("/js/jquery.tipsy.js"); ?>
<?= $this->html->script("/js/functions.js"); ?>
<?= $this->html->script("/js/jquery.prettyPhoto.js"); ?>

<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
	var login = $("a[href='/login']");
	login.attr('href', '#login');
	login.attr('title', '');
	login.prettyPhoto({deeplinking: false, social_tools: false});
});
</script>

<?= $this->scripts(); ?>
<script type="text/javascript">
$(document).ready(function() {
	setTimeout(function() {
		$(".flash-message").fadeOut("slow", function () {
			$(".flash-message").remove();
		});
	}, 2000);
});
</script>

</body>
</html>