<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv='content-type' content='text/html; charset=iso-8859-1' />
	<title>minibooks: {% block title %}{% endblock %}</title>
	
	<link charset='UTF-8' rel="stylesheet" type="text/css" media="screen" href="{{ MEDIA_URL }}style/yahoo/reset-fonts.css" />
	<link charset='UTF-8' rel="stylesheet" type="text/css" media="screen" href="{{ MEDIA_URL }}style/yahoo/base.css" />
	<link charset='UTF-8' rel="stylesheet" type="text/css" media="screen" href="{{ MEDIA_URL }}css/jquery-ui/smoothness/jquery-ui-1.7.2.custom.css" />
	<link charset="UTF-8" rel="stylesheet" type="text/css" media="screen" href="{{ MEDIA_URL }}css/jquery.autocomplete.css" />
	<link charset='UTF-8' rel="stylesheet" type="text/css" media="screen" href="{{ MEDIA_URL }}style/books.css" />
	
	<script src="{{ MEDIA_URL }}js/jquery-1.3.2.min.js" type="text/javascript">jQuery.noConflict();</script>
	<script src="{{ MEDIA_URL }}js/jquery-ui-1.7.2.custom.min.js" type="text/javascript"></script>
	<script src="{{ MEDIA_URL }}js/mootools-1.2.1-core-yc.js" type="text/javascript"></script>
	<script src="{{ MEDIA_URL }}js/jquery.autocomplete.min.js" type="text/javascript"></script>
	<script src="{{ MEDIA_URL }}js/django-crm.js" type="text/javascript"></script>
	<script src="{{ MEDIA_URL }}js/minibooks.js" type="text/javascript"></script>
    
	{% block javascript %}{% endblock %}
	{% block css %}{% endblock %}
</head>
<body>

<div id="header-wrapper">
	<div id="header">
		<img id='minibooks-logo' src='{{ MEDIA_URL }}images/minibooks-logo.png' alt='minibooks' />
		<div id="header-sidebar">
			<ul id="site-utils">
			{% if user.is_authenticated %}
				<li>{{ user.email }}</li>
				{% if user.is_staff %}
					<li><a href="{% url admin:index %}">Admin</a></li>
				{% endif %}
				<li><a href="{% url change_password %}?next={{ request.get_full_path }}">Change Password</a></li>
				<li><a href="{% url auth_logout %}">Logout</a></li>
			{% else %}
				<li><a href="{% url register_person %}">Register</a></li>
				<li><a href="{% url auth_login %}">Login</a></li>
			{% endif %}
			</ul>
		</div>
		{% include "crm/_quick_search.html" %}
		<div class="cleaner"></div>
	</div>
	<div class="cleaner"></div>
</div>

<div id="menu-wrapper">
	<div id="menu">
		<ul>
			<li><a title="Dashboard" href="{% url crm_dashboard %}">Dashboard</a></li>
		{% if perms.crm.view_profile %}
			<li><a title="People" href="{% url list_people %}">People</a></li>
		{% endif %}
		{% if perms.crm.view_business %}
			<li><a title="Businesses" href="{% url list_businesses %}">Businesses</a></li>
		{% endif %}
		{% if perms.timepiece.view_project %}
			<li><a title="Projects" href="{% url list_projects %}">Projects</a></li>
		{% endif %}
        {% if perms.timepiece.add_entry %}
            <li><a title="Time Tracking" href="{% url timepiece-entries %}">Time Tracking</a></li>
        {% endif %}
        {# {% if perms.ledger.view_exchange %} #}
        {#  <li><a title="Exchanges" href="{% url list_exchanges %}">Exchanges</a></li> #}
        {# {% endif %} #}
        {# {% if perms.ledger.view_account %} #}
        {#  <li><a title="Accounts" href="{% url list_accounts %}">Accounts</a></li> #}
        {# {% endif %} #}
        {# {% if perms.ledger.view_account_reports %} #}
        {#  <li><a title="Reports" href="{% url list_reports %}">Reports</a></li> #}
        {# {% endif %} #}
		</ul>
	</div>
</div>

<div id="content-wrapper">
	<div id="content">
	{% block sub_navigation %}{% endblock %}
    {% if messages %}
    <ul class="message_list">
        {% for message in messages %}
        <li>{{ message }}</li>
        {% endfor %}
    </ul>
    {% endif %}
    {% if notifications %}
        <ul class="message_list">
            {% for message in notifications %}
            <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
            {% endfor %}
        </ul>
    {% endif %}
		{% block content %}{% endblock %}
		<div class="cleaner"></div>
	</div>
</div>

<div id="footer-wrapper">
	<div id="footer">
		<a href="https://secure.caktusgroup.com/projects/minibooks/">Source</a>
		|
		<a href="http://www.caktusgroup.com/">Caktus Group</a>
	</div>
</div>

</body>
</html>
