summaryrefslogtreecommitdiffstats
path: root/forum/skins/default/templates/header.html
blob: efc0d8f22c4562babe5c9d70aa9dc8a1b90e11d1 (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
<!-- template header.html -->
{% load extra_tags %}
{% load smart_if %}
{% load i18n %}
	<div id="roof">
		<div id="navBar">
			<div id="top">
                {% if request.user.is_authenticated %}
                    <a href="{% url user_profile id=request.user.id,slug=request.user.username|slugify %}">{{ request.user.username }}</a> {% get_score_badge request.user %} 
                    <a href="{% url logout %}">{% trans "logout" %}</a>
                {% else %}
                    <a href="{% url user_signin %}">{% trans "login" %}</a>
                {% endif %}
                <a href="{% url about %}">{% trans "about" %}</a>
                <a href="{% url faq %}">{% trans "faq" %}</a>
			</div>
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
			  <tr>
        <td width="23%">
            <div id="logo">
                <a href="{% url questions %}?start_over=true"><img 
                    src="{% media  "/media/images/logo.png" %}" title="{% trans "back to home page" %}" alt="{{settings.APP_TITLE}} logo"/></a>
            </div>
        </td>
        <td width="77%" valign="bottom">
            <div class="nav">
                <a id="nav_questions" href="{% url questions %}" >{% trans "questions" %}</a>
                <a id="nav_tags" href="{% url tags %}">{% trans "tags" %}</a>
                <a id="nav_users" href="{% url users %}">{% trans "users" %}</a>
                {% if settings.BOOKS_ON %}
                <a id="nav_books" href="{% url books %}">{% trans "books" %}</a>
                {% endif %}
                <a id="nav_badges" href="{% url badges %}">{% trans "badges" %}</a>
                <a id="nav_ask" href="{% url ask %}" class="special">{% trans "ask a question" %}</a>
                {% comment %}
                <a id="nav_unanswered" href="{% url unanswered %}">{% trans "unanswered questions" %}</a>
                <div class="focus">
                <a id="nav_ask" href="{% url ask %}" class="special">{% trans "ask a question" %}</a>
                </div>
                {% endcomment %}
            </div>
        </td>
			  </tr>
			</table>
		</div>
    {% if active_tab != "ask" %}
		<div id="searchBar">
        {% comment %}url action depends on which tab is active{% endcomment %}
        <form 
            {% if active_tab == "tags" or active_tab == "users" %}
                action="{% url search %}" 
            {% else %}
                action="{% url questions %}" 
            {% endif %}
            method="get">
                {% comment %} class was searchInput {% endcomment %}
                <input 
                    {% if query %}
                    class="searchInputCancelable"
                    {% else %}
                    class="searchInput" 
                    {% endif %}
                    type="text" 
                    value="{{ query|default_if_none:"" }}" 
                    name="query" 
                    id="keywords"/>
                {% if active_tab == "tags" %}
                    <input type="hidden" name="t" value="tag"/>
                {% else %}
                    {% if active_tab == "users" %}
                        <input type="hidden" name="t" value="user"/>
                    {% endif %}
                {% endif %}
                {% if query %}{% comment %}query is only defined by questions view{% endcomment %}
                <input type="button" 
                    value="x" 
                    name="reset_query" 
                    {% comment %}todo - make sure it works on Enter keypress{% endcomment %}
                    onclick="window.location.href='{% url questions %}?reset_query=true'" 
                    value="true" 
                    class="cancelSearchBtn"/>
                {% endif %}
                <input type="submit" value="{% trans "search" %}" name="search" class="searchBtn" default />
        </form>
		</div>
    {% else %}
    <div id="fakeSearchBar"></div>
    {% endif %}
	</div>
<!-- end template header.html -->