Mercurial > personas_backend
changeset 53:7a20574bedc8
Made templates more robust, fixed broken links, etc.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Wed, 05 Mar 2008 09:30:26 -0600 |
parents | 9063eb46391d |
children | f19c2a2987cc |
files | PersonasBackend/personas/templates/personas/base.html PersonasBackend/personas/templates/personas/home.html PersonasBackend/personas/templates/personas/login.html PersonasBackend/personas/templates/personas/todo.html PersonasBackend/personas/urls.py PersonasBackend/personas/views.py media/img/personas.png |
diffstat | 7 files changed, 77 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/PersonasBackend/personas/templates/personas/base.html Tue Mar 04 23:45:58 2008 -0600 +++ b/PersonasBackend/personas/templates/personas/base.html Wed Mar 05 09:30:26 2008 -0600 @@ -7,12 +7,13 @@ href="{{ MEDIA_URL }}css/rustico.css" /> <link rel="shortcut icon" href="{{ MEDIA_URL }}img/favicon.ico" type="image/x-icon" /> - <title>{% block title %}Firefox Personas{% endblock %}</title> + <title>{% block title %}{{ title }} ::{% endblock %}Firefox + Personas</title> </head> <body> <div id="header"> <div> - <h1><a href="http://www.mozilla.com/en-US" + <h1><a href="http://www.mozilla.com" title="mozilla.com" accesskey="1"> <img src="{{ MEDIA_URL }}img/template/moz-com-logo.png" alt="Mozilla Corporation" title="Mozilla Corporation" @@ -24,14 +25,15 @@ <div id="breadcrumbs"> <div id="breadcrumbs_container"> <div style="float: left;"> - <a href="http://www.mozilla.com" >Personas Home</a> - » <a href="/en-US/firefox/" >Browse Personas</a> + <a href="{% url personas-home %}" >Personas Home</a> + {% block breadcrumb %} + » {{ title }} + {% endblock %} </div> <div style="text-align: right; padding-right: 4px;"> - <a href="/en-US/firefox/users/register" >Register</a> | - <a href="/en-US/firefox/users/login?to=en-US/firefox/browse" - >Log in</a> + <a href="https://services.mozilla.com/" >Register</a> | + <a href="{% url login %}">Log in</a> </div> </div> </div> @@ -41,9 +43,9 @@ <div> <h2> <img src="{{ MEDIA_URL }}img/app-icons/personas.png" - alt="Firefox" /> - Firefox Personas: - <span>TODO: Insert title here</span> + alt="Personas" /> + Firefox Personas{% block pagetitle %}: + <span>{{ title }}</span>{% endblock %} </h2> </div> </div> @@ -52,8 +54,9 @@ <div id="sidebar"> <div class="menu-box"> <ul> - <li><a href="/en-US/firefox/" >Home</a></li> - <li class="selected"><a href="/en-US/firefox/browse">Browse</a></li> + <li><a href="{% url personas-home %}" >Home</a></li> + <li><a href="{% url list-personas %}">Browse</a></li> + <li><a href="{% url new-persona %}">Create</a></li> </ul> </div> </div> @@ -73,10 +76,10 @@ 2008 Mozilla. All rights reserved. </p> <p> - <a href="/en-US/firefox/pages/privacy" >Privacy Policy</a> + <a href="{% url TODO %}" >Privacy Policy</a> <a href="http://www.mozilla.com/en-US/about/legal.html">Legal Notices</a> - <a href="/en-US/firefox/pages/credits" >Credits</a> + <a href="{% url TODO %}" >Credits</a> </p> </div>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PersonasBackend/personas/templates/personas/home.html Wed Mar 05 09:30:26 2008 -0600 @@ -0,0 +1,17 @@ +{% extends "personas/base.html" %} + +{% block title %}{% endblock %} +{% block breadcrumb %}{% endblock %} +{% block pagetitle %}{% endblock %} + +{% block content %} +<h1>What are Personas?</h1> +<p>Personas for Firefox is an extension that adds lightweight theming to your browser.</p> +<p>Personas is a prototype that builds upon the ideas that:</p> +<ul> +<li>themes today are too hard to find, install and use</li> +<li>graphic designers should be able to style the browser without having to code</li> +<li>browsers can be more than just desktop software, they can include online components</li> +<li>people just want their computer to be a little more fun and personal</li> +</ul> +{% endblock %}
--- a/PersonasBackend/personas/templates/personas/login.html Tue Mar 04 23:45:58 2008 -0600 +++ b/PersonasBackend/personas/templates/personas/login.html Wed Mar 05 09:30:26 2008 -0600 @@ -1,6 +1,8 @@ {% extends "personas/base.html" %} -{% block title %}Personas Login{% endblock %} +{% block title %}Log in ::{% endblock %} +{% block breadcrumb %}» Log in{% endblock %} +{% block pagetitle %}: <span>Log in</span>{% endblock %} {% block content %} {% if form.has_errors %}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PersonasBackend/personas/templates/personas/todo.html Wed Mar 05 09:30:26 2008 -0600 @@ -0,0 +1,5 @@ +{% extends "personas/base.html" %} + +{% block content %} +This page is under construction. +{% endblock %}
--- a/PersonasBackend/personas/urls.py Tue Mar 04 23:45:58 2008 -0600 +++ b/PersonasBackend/personas/urls.py Wed Mar 05 09:30:26 2008 -0600 @@ -8,10 +8,12 @@ 'PersonasBackend.personas.json_feeds.personas'), # Auth - (r'^login/$', 'django.contrib.auth.views.login', - {'template_name':'personas/login.html'}), - (r'^logout/$', 'django.contrib.auth.views.logout', - {'template_name':'personas/logged_out.html'}), + url(r'^login/$', 'django.contrib.auth.views.login', + {'template_name':'personas/login.html'}, + name='login'), + url(r'^logout/$', 'django.contrib.auth.views.logout', + {'template_name':'personas/logged_out.html'}, + name='logout'), # Personas UI url(r'^new/$', @@ -20,5 +22,13 @@ url(r'^(?P<persona_id>\d+)/edit/$', 'PersonasBackend.personas.views.edit_view', name='edit-persona'), - (r'^$', 'PersonasBackend.personas.views.list_view'), + url(r'^list/$', 'PersonasBackend.personas.views.list_view', + name='list-personas'), + url(r'^$', 'PersonasBackend.personas.views.home_view', + name='personas-home'), + + # 'Fake' scaffolding view for pages that still need to be + # constructed. + url(r'^TODO/$', 'PersonasBackend.personas.views.todo_view', + name='TODO'), )
--- a/PersonasBackend/personas/views.py Tue Mar 04 23:45:58 2008 -0600 +++ b/PersonasBackend/personas/views.py Wed Mar 05 09:30:26 2008 -0600 @@ -12,7 +12,22 @@ "personas/list.html", # TODO: Show only the personas that the currently # logged-in user has access to viewing. - { "personas" : models.Persona.objects.all() }, + { "personas" : models.Persona.objects.all(), + "title" : "Browse Personas" }, + context_instance = RequestContext(request) + ) + +def home_view( request ): + return render_to_response( + "personas/home.html", + { "title" : "Home" }, + context_instance = RequestContext(request) + ) + +def todo_view( request ): + return render_to_response( + "personas/todo.html", + { "title" : "Under Construction" }, context_instance = RequestContext(request) ) @@ -42,8 +57,10 @@ # the rights to edit the persona or create a new one. if persona_id is None: persona = None + pageTitle = "Create a new Persona" else: persona = get_object_or_404( models.Persona, id=persona_id ) + pageTitle = "Edit Persona" if request.method == "POST": for img_name in request.FILES: @@ -66,6 +83,7 @@ return render_to_response( "personas/edit.html", - { "form" : form }, + { "form" : form, + "title" : pageTitle }, context_instance = RequestContext(request) )