f743f4099d176f8d878d237d2be161bd4e1b6cc3
[redakcja.git] / redakcja / templates / registration / head_login.html
1 {% load i18n %}
2
3 <ul class="nav navbar-nav navbar-right">
4
5
6 <li><a style="color: white">
7   <form action="{% url 'django.views.i18n.set_language' %}" method="post" style="display: inline">
8   {% csrf_token %}
9   <input type="hidden" name="language" value="en" /><button type="submit" style="border: 0; background: none">en</button></form> |
10   <form action="{% url 'django.views.i18n.set_language' %}" method="post" style="display: inline">
11   {% csrf_token %}
12   <input type="hidden" name="language" value="pl" /><button type="submit" style="border: 0; background: none">pl</button></form> |
13 </a>
14 </li>
15
16 <li><a href="/platform/" style="color: white">{% trans "About" %}</a></li>
17 <li><a href="/appyourschool/" style="color: white">{% trans "App Your School" %}</a></li>
18 {#<li><a href="/competition/" style="color: white">{% trans "Competition" %}</a></li>#}
19 <li><a href="{% url 'organizations_new' %}" style="color: white"
20     {% if request.path == '/' %}
21     data-toggle="tutorial" data-tutorial="1" data-placement="bottom"
22     data-content='{% trans "Create an organization here. Organizations help manage team's work." %}'
23     {% endif %}
24 >{% trans "New organization" %}</a></li>
25 <li><a href="{% url 'catalogue_create_missing' %}" style="color: white"
26     {% if request.path == '/' %}
27     data-toggle="tutorial" data-tutorial="2" data-placement="bottom"
28     data-content="{% trans 'Start editing a new resource.' %}"
29     {% endif %}
30 >{% trans "New resource" %}</a></li>
31
32 {% if user.is_authenticated %}
33 <li><a href="{% url 'catalogue_user' %}" style="color: white">{% trans "My resources" %}</a></li>
34
35     <li class="dropdown">
36         <style>
37             #main-navbar .dropdown.open > a {
38                 background: #888
39             }
40         </style>
41         <a href="#" class="dropdown-toggle" type="button" data-toggle="dropdown" style="color: white">
42             {{ user.username }}
43             <span class="caret"></span>
44         </a>
45         <ul class="dropdown-menu" style="">
46             {% if user.membership_set.all.exists %}
47             <li role="presentation" class="dropdown-header">{% trans "My organizations" %}:</li>
48             {% for membership in user.membership_set.all %}
49                 <li><a href="{% url 'organizations_main' membership.organization.pk %}">{{ membership.organization }}</a></li>
50             {% endfor %}
51             {% else %}
52             <li role="presentation" class="dropdown-header">{% trans "You are not a member of any organizations" %}</li>
53             {% endif %}
54             <li><a href="{% url 'organizations_new' %}">{% trans "New organization" %}</a></li>
55             <li role="presentation" class="divider"></li>
56             <li><a href="{% url 'organizations_user_edit' %}">{% trans "Edit my data" %}</a></li>
57             {% if user.is_staff %}
58                 <li><a href="{% url 'admin:index' %}">{% trans "Admin" %}</a></li>
59             {% endif %}
60             <li><a href="{% url 'logout' %}">{% trans "Logout" %}</a></li>
61         </ul>
62     </li>
63
64
65 {% else %}
66 {% url "login" as login_url %}
67 {% ifnotequal login_url request.path %}
68     <li class="dropdown"
69             data-toggle="tutorial" data-tutorial="0" data-placement="bottom"
70             data-content="{% trans 'First, you will need an account.' %}"
71     >
72         <button class="btn btn-default navbar-btn dropdown-toggle" type="button" data-toggle="dropdown" style=""
73         >
74             {% trans "Log in / Register" %}
75         </button>
76       <div class="dropdown-menu" style="padding:0;margin-top:-5px; border:none;box-shadow:none; min-width:240px">
77         <div class="panel panel-default" style="color: #333;">
78           <div class="panel-heading">
79             <h3 class="panel-title">{% trans "Log in / Register" %}</h3>
80           </div>
81           <div class="panel-body">
82             <form method="POST" action="{% url 'login' %}">
83                 {% csrf_token %}
84                 <label for="email">
85                     {% trans "E-mail" %}</label>
86                     <input name="username" class="form-control" type="email">
87                 
88                 <label for="password">
89                     {% trans "Password" %}</label>
90                     <input name="password" class="form-control" type="password">
91                 
92                 
93                     <!--input type="checkbox" name="keep">
94                     <label for="keep">Keep me logged in</label-->
95                 
96                 <div><button class="btn btn-default">
97                     {% trans "Log in" %}
98                 </button>
99                 </div>
100             </form>
101             <p><a href="{% url 'password_reset' %}">{% trans "I forgot my password" %}</a></p>
102             <hr>
103             <p style="margin-bottom:1em">{% trans "<strong>Register now</strong> to start editing your own materials." %}</p>
104             <a class="btn btn-default" href="{% url 'register' %}">{% trans "Register" %}</a>
105           </div>
106         </div>
107       </div>
108     </li>
109 {% endifnotequal %}
110 {% endif %}
111
112 </ul>
113