Commit b4cab11a authored by Michal Čihař's avatar Michal Čihař

Include some information in user profile

parent 9de50add
...@@ -57,13 +57,15 @@ def profile(request): ...@@ -57,13 +57,15 @@ def profile(request):
subscriptionform = SubscriptionForm(instance = request.user.get_profile()) subscriptionform = SubscriptionForm(instance = request.user.get_profile())
userform = UserForm(instance = request.user) userform = UserForm(instance = request.user)
profile = request.user.get_profile()
response = render_to_response('profile.html', RequestContext(request, { response = render_to_response('profile.html', RequestContext(request, {
'form': form, 'form': form,
'userform': userform, 'userform': userform,
'subscriptionform': subscriptionform, 'subscriptionform': subscriptionform,
'profile': profile,
'title': _('User profile'), 'title': _('User profile'),
})) }))
response.set_cookie(settings.LANGUAGE_COOKIE_NAME, request.user.get_profile().language) response.set_cookie(settings.LANGUAGE_COOKIE_NAME, profile.language)
return response return response
def contact(request): def contact(request):
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<li><a href="#subscriptions">{% trans "Subscriptions" %}</a></li> <li><a href="#subscriptions">{% trans "Subscriptions" %}</a></li>
<li><a href="#account">{% trans "Account" %}</a></li> <li><a href="#account">{% trans "Account" %}</a></li>
<li><a href="#password">{% trans "Password" %}</a></li> <li><a href="#password">{% trans "Password" %}</a></li>
<li><a href="#info">{% trans "Information" %}</a></li>
</ul> </ul>
<div id="preferences"> <div id="preferences">
<table> <table>
...@@ -44,6 +45,26 @@ ...@@ -44,6 +45,26 @@
{% url 'django.contrib.auth.views.password_change' as pw_url %} {% url 'django.contrib.auth.views.password_change' as pw_url %}
{% blocktrans %}You can change password on <a href="{{ pw_url }}">separate page</a>.{% endblocktrans %} {% blocktrans %}You can change password on <a href="{{ pw_url }}">separate page</a>.{% endblocktrans %}
</div> </div>
<div id="info">
<table>
<tr>
<th>{% trans "Suggestions made" %}</th>
<td>{{ profile.suggested }}</td>
</tr>
<tr>
<th>{% trans "Translations made" %}</th>
<td>{{ profile.translated }}</td>
</tr>
<tr>
<th>{% trans "Last login" %}</th>
<td>{{ request.user.last_login|date:"DATETIME_FORMAT" }}</td>
</tr>
<tr>
<th>{% trans "Registration date" %}</th>
<td>{{ request.user.date_joined|date:"DATETIME_FORMAT" }}</td>
</tr>
</table>
</div>
</div> </div>
<input type="submit" value="{% trans "Save" %}" class="button" /> <input type="submit" value="{% trans "Save" %}" class="button" />
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment