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

Simplify title generating

parent d763d39e
......@@ -29,7 +29,7 @@ def profile(request):
response = render_to_response('profile.html', RequestContext(request, {
'form': form,
'userform': userform,
'title': '%s @ %s' % (_('User profile'), settings.SITE_TITLE),
'title': _('User profile'),
}))
response.set_cookie(settings.LANGUAGE_COOKIE_NAME, request.user.get_profile().language)
return response
......@@ -58,5 +58,5 @@ def contact(request):
return render_to_response('contact.html', RequestContext(request, {
'form': form,
'title': '%s @ %s' % (_('Contact'), settings.SITE_TITLE),
'title': _('Contact'),
}))
{% if title %}
{{ title }}
{{ title }} @ {{ site_title }}
{% else %}
{% if object %}
{{ object }} @ {{ site_title }}
{% else %}
{{ site_title }}
{% endif %}
{% endif %}
......@@ -35,7 +35,6 @@ def home(request):
'top_translations': top_translations,
'top_suggestions': top_suggestions,
'usertranslations': usertranslations,
'title': settings.SITE_TITLE,
}))
def show_project(request, project):
......@@ -43,7 +42,6 @@ def show_project(request, project):
return render_to_response('project.html', RequestContext(request, {
'object': obj,
'title': '%s @ %s' % (obj.__unicode__(), settings.SITE_TITLE),
}))
def show_subproject(request, project, subproject):
......@@ -51,7 +49,6 @@ def show_subproject(request, project, subproject):
return render_to_response('subproject.html', RequestContext(request, {
'object': obj,
'title': '%s @ %s' % (obj.__unicode__(), settings.SITE_TITLE),
}))
def show_translation(request, project, subproject, lang):
......@@ -61,7 +58,6 @@ def show_translation(request, project, subproject, lang):
return render_to_response('translation.html', RequestContext(request, {
'object': obj,
'title': '%s @ %s' % (obj.__unicode__(), settings.SITE_TITLE),
'form': form,
'search_form': search_form,
}))
......@@ -228,7 +224,6 @@ def translate(request, project, subproject, lang):
return render_to_response('translate.html', RequestContext(request, {
'object': obj,
'title': '%s @ %s' % (obj.__unicode__(), settings.SITE_TITLE),
'unit': unit,
'total': total,
'type': rqtype,
......
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