Fix mising page titles

master
Alice 8 years ago
parent a8e0a2b15b
commit 36bfdf64d0

@ -25,7 +25,8 @@ def chat(request):
username = request.user.username + '|cc'
else:
username = "cc?"
return render(request, 'ccvpn/chat.html', dict(username=username))
ctx = dict(username=username, title=_("Live Chat"))
return render(request, 'ccvpn/chat.html', ctx)
def set_lang(request):

@ -284,7 +284,7 @@ def logs(request):
@login_required
def config(request):
return render(request, 'lambdainst/config.html', dict(
titla=_("Config"),
title=_("Config"),
config_os=openvpn.CONFIG_OS,
config_countries=(c for _, c in get_locations()),
config_protocols=openvpn.PROTOCOLS,

@ -4,7 +4,11 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ LANGUAGE_CODE }}">
<head>
<title>{{ title | default:'CCrypto VPN' }}</title>
{% if title %}
<title>{{ title }} - CCrypto VPN</title>
{% else %}
<title>CCrypto VPN</title>
{% endif %}
<meta charset="UTF-8" />
<link rel="stylesheet" href="{% static 'css/pure-min.css' %}" media="screen" />
<link rel="stylesheet" href="{% static 'css/grids-responsive-min.css' %}" media="screen" />

@ -3,6 +3,7 @@ from django.contrib.auth.decorators import login_required
from django.http.response import HttpResponseNotFound
from django.utils import timezone
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.utils.translation import ugettext as _
from .models import Ticket, TicketMessage
from .forms import NewTicketForm, ReplyForm, StaffReplyForm
@ -45,7 +46,12 @@ def index(request, f=None, all=False):
except EmptyPage:
tickets = paginator.page(paginator.num_pages)
context = dict(tickets=tickets, filter=f, single_user=single_user)
context = dict(
tickets=tickets,
filter=f,
single_user=single_user,
title=_("Tickets"),
)
context.update(common_context(request))
if not f:
return render(request, 'tickets/index.html', context)
@ -56,6 +62,7 @@ def index(request, f=None, all=False):
@login_required
def new(request):
context = common_context(request)
context['title'] = _("New Ticket")
if request.method != 'POST':
context['form'] = NewTicketForm()
return render(request, 'tickets/new.html', context)
@ -105,7 +112,12 @@ def view(request, id):
else:
form = ReplyForm()
ctx = dict(ticket=ticket, ticket_messages=messages, form=form)
ctx = dict(
ticket=ticket,
ticket_messages=messages,
form=form,
title=_("Ticket:") + " " + ticket.subject,
)
ctx.update(common_context(request))
return render(request, 'tickets/view.html', ctx)
@ -130,7 +142,12 @@ def view(request, id):
form = ReplyForm(request.POST)
if not form.is_valid():
ctx = dict(ticket=ticket, ticket_messages=messages, form=form)
ctx = dict(
ticket=ticket,
ticket_messages=messages,
form=form,
title=_("Ticket:") + " " + ticket.subject,
)
ctx.update(common_context(request))
return render(request, 'tickets/view.html', ctx)

Loading…
Cancel
Save