=== added file 'lava_server/templates/me.html'
@@ -0,0 +1,17 @@
+{% extends "layouts/content_with_sidebar.html" %}
+{% load i18n %}
+
+{% block sidebar %}
+<h3>{% trans "Actions" %}</h3>
+<ul>
+ <li><a href="{% url django.contrib.auth.views.logout %}"
+ >{% trans "Sign out" %}</a></li>
+ <li><a href="{% url django.contrib.auth.views.password_change %}"
+ >{% trans "Change your password" %}</a></li>
+</ul>
+{% endblock %}
+
+{% block content %}
+<h2>Welcome</h2>
+<p>This is a placeholder for more interesting content</p>
+{% endblock %}
=== modified file 'lava_server/urls.py'
@@ -24,7 +24,7 @@
from linaro_django_xmlrpc import urls as api_urls
from lava_server.extension import loader
-from lava_server.views import index, version
+from lava_server.views import index, me, version
# Enable admin stuff
@@ -37,6 +37,9 @@
url(r'^' + settings.APP_URL_PREFIX + r'$',
index,
name='lava.home'),
+ url(r'^' + settings.APP_URL_PREFIX + r'me/$',
+ me,
+ name='lava.me'),
url(r'^' + settings.APP_URL_PREFIX + r'version/$',
version,
name='lava.version_details'),
=== modified file 'lava_server/views.py'
@@ -16,16 +16,26 @@
# You should have received a copy of the GNU Affero General Public License
# along with LAVA Server. If not, see <http://www.gnu.org/licenses/>.
+from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.template import loader, RequestContext
+from django.utils.translation import ugettext as _
from django.views.generic.simple import direct_to_template
+from lava_server.bread_crumbs import (
+ BreadCrumb,
+ BreadCrumbTrail,
+)
from lava_server.extension import loader as extension_loader
+@BreadCrumb(_("LAVA"))
def index(request):
# Start with a list of extensions
- data = {'extension_list': extension_loader.extensions}
+ data = {
+ 'extension_list': extension_loader.extensions,
+ 'bread_crumb_trail': BreadCrumbTrail.leading_to(index),
+ }
# Append each extension context data
for extension in extension_loader.extensions:
data.update(extension.get_front_page_context())
@@ -35,5 +45,24 @@
return HttpResponse(template.render(context))
+@BreadCrumb(_("About you ({you})"),
+ parent=index)
+@login_required
+def me(request):
+ data = {
+ 'bread_crumb_trail': BreadCrumbTrail.leading_to(me, you=request.user.get_full_name())
+ }
+ context = RequestContext(request, data)
+ template = loader.get_template('me.html')
+ return HttpResponse(template.render(context))
+
+
+@BreadCrumb(_("Version details"),
+ parent=index)
def version(request):
- return direct_to_template(request, 'version_details.html')
+ data = {
+ 'bread_crumb_trail': BreadCrumbTrail.leading_to(version)
+ }
+ context = RequestContext(request, data)
+ template = loader.get_template('version_details.html')
+ return HttpResponse(template.render(context))