aboutsummaryrefslogtreecommitdiffstats
path: root/templates/base.html
blob: 6d4dd09987e54ad999a3c750996f85abc2fd5c58 (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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
{% load staticfiles %}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <title>{% block title %}Patchwork{% endblock %} - Patchwork</title>
  <link rel="stylesheet" type="text/css" href="{% static "css/bootstrap.min.css" %}"/>
  <link rel="stylesheet" type="text/css" href="{% static "css/selectize.bootstrap3.css" %}"/>
  <link rel="stylesheet" type="text/css" href="{% static "css/jquery.dynatable.css" %}"/>
  <link rel="stylesheet" type="text/css" href="{% static "css/style.css" %}"/>
  <style id="css-table-select" type="text/css">
   .table-select { display: none; }
  </style>
  <script type="text/javascript" src="{% static "js/common.js" %}"></script>
  <script type="text/javascript" src="{% static "js/jquery-1.10.1.min.js" %}"></script>
  <script type="text/javascript" src="{% static "js/jquery.stickytableheaders.min.js" %}"></script>
  <!-- IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js">
    </script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <script src="http://cdnjs.cloudflare.com/ajax/libs/es5-shim/2.0.8/es5-shim.min.js"></script>
  <![endif]-->
  <script type="text/javascript" src="{% static "js/bootstrap.min.js" %}"></script>
  <script type="text/javascript" src="{% static "js/selectize.min.js" %}"></script>
  <script type="text/javascript" src="{% static "js/jquery.dynatable.js" %}"></script>
{% block headers_prepatchwork %}{% endblock %}
  <script type="text/javascript" src="{% static "js/patchwork.js" %}"></script>
  <script type="text/javascript">
    $(function () {
        pw.init({
            base_url: '{% url 'root' %}'
{% if user.is_authenticated %}
            , user: {
                is_authenticated: true,
                pk: {{ user.pk }},
                items_per_page: {{ user.profile.patches_per_page }}
            }
{% endif  %}
{% if project %}
            , project: {
                pk: {{ project.pk }},
                name: '{{ project.linkname }}',
                is_editable: {{ is_editable|default:"false" }},
            },
{% endif  %}
        });
    });
  </script>
{% block headers %}{% endblock %}
 </head>
 <body>
  <nav class="navbar navbar-inverse navbar-patchwork">
   <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <span class="navbar-brand"><a
         href="{% url 'patchwork.views.projects' %}">
         Patchwork{% if project %} {{project.name}}{% endif %}</a>
         {% block heading %}{% endblock %}
      </span>
    </div>
    <div class="collapse navbar-collapse" id="navbar-collapse">
{% block navbarmenu %}
{% if project %}
      <ul class="nav navbar-nav">
        <li class="{% block series_active %}{% endblock %}">
          <a href="{% url 'series_list' project=project.linkname %}">
            <span class="glyphicon glyphicon-list"></span>
            Series</a>
        </li>
        <li class="{% block patch_active %}{% endblock %}">
          <a href="{% url 'patches_list' project_id=project.linkname %}">
            <span class="glyphicon glyphicon-file"></span>
            Patches</a>
        </li>
        <li class="{% block bundle_active %}{% endblock %}">
          <a href="{% url 'bundle_list' project_id=project.linkname %}">
            <span class="glyphicon glyphicon-gift"></span>
            Bundles</a>
        </li>
        <li class="{% block info_active %}{% endblock %}">
          <a href="{% url 'patchwork.views.project.project' project_id=project.linkname %}">
            <span class="glyphicon glyphicon-info-sign"></span>
            About this project</a>
        </li>
        <li>
          <a href="{% url 'patchwork.views.projects' %}">
            <span class="glyphicon glyphicon-home"></span>
            All projects</a>
        </li>
     </ul>
{% endif %}
{% endblock %}
     <ul class="nav navbar-nav navbar-right">
{% if user.is_authenticated %}
     <li class="dropdown">
       <a href="#" class="dropdown-toggle" data-toggle="dropdown">
         <span class="badge">{{ user.profile.n_todo }}</span>
         <strong>{{ user.username }}</strong>&nbsp;<span class="caret"></span>
       </a>
       <ul class="dropdown-menu" role="menu">
         <li>
           <a href="{% url 'patchwork.views.user.todo_lists' %}">
             Reviews pending
             <span class="badge">{{ user.profile.n_todo }}</span>
           </a>
         </li>
         <li>
           <a href="{% url 'patchwork.views.bundle.bundles' %}">
             Bundles
           </a>
         </li>
         <li role="separator" class="divider"></li>
{% if user.is_staff %}
         <li><a href="{% url 'admin:index' %}">Administration</a></li>
{% endif %}
         <li><a href="{% url 'patchwork.views.user.profile' %}">View profile</a></li>
         <li><a href="{% url 'auth_logout' %}">Logout</a></li>
       </ul>
     </li>
{% else %}
     <li><a href="{% url 'auth_login' %}">Login</a></li>
     <li><a href="{% url 'patchwork.views.user.register' %}">Register</a></li>
     <li><a href="{% url 'patchwork.views.mail.settings' %}">Mail settings</a></li>
{% endif %}
     </ul>
    </div>
   </div>
  </nav>
{% if messages %}
  <div id="messages">
  {% for message in messages %}
   <div class="message">{{ message }}</div>
  {% endfor %}
  </div>
{% endif %}
  <div class="container-fluid">
{% block body %}
{% endblock %}
  </div>
  <div id="footer">
   <a href="http://jk.ozlabs.org/projects/patchwork/">patchwork</a>
   patch tracking system | <a
   href="{% url 'patchwork.views.help' path="about/" %}">about patchwork</a>
  </div>
 </body>
</html>