Updated several page titles to contain more information.
Fixes Issue 437.
--- a/app/soc/templates/soc/notification/public.html Mon Aug 10 16:35:01 2009 -0700
+++ b/app/soc/templates/soc/notification/public.html Mon Aug 10 16:58:51 2009 -0700
@@ -14,10 +14,6 @@
{% endcomment %}
{% load forms_helpers %}
-{% block page_title %}
-Notification
-{% endblock %}
-
{% block header_title %}
Notification about: {{ entity.subject }}
{% endblock %}
--- a/app/soc/templates/soc/request/process_invite.html Mon Aug 10 16:35:01 2009 -0700
+++ b/app/soc/templates/soc/request/process_invite.html Mon Aug 10 16:58:51 2009 -0700
@@ -14,10 +14,6 @@
{% endcomment %}
{% load forms_helpers %}
-{% block header_title %}
-{{ page_name }} for {{ entity.scope.link_id }}
-{% endblock %}
-
{% block body %}
<p>
<div="text">
--- a/app/soc/templates/soc/request/process_request.html Mon Aug 10 16:35:01 2009 -0700
+++ b/app/soc/templates/soc/request/process_request.html Mon Aug 10 16:58:51 2009 -0700
@@ -14,10 +14,6 @@
{% endcomment %}
{% load forms_helpers %}
-{% block header_title %}
-{{ page_name }} for {{ entity.requester.link_id }}
-{% endblock %}
-
{% block body %}
<p>
<div="text">
--- a/app/soc/views/models/document.py Mon Aug 10 16:35:01 2009 -0700
+++ b/app/soc/views/models/document.py Mon Aug 10 16:58:51 2009 -0700
@@ -151,6 +151,19 @@
return super(View, self)._public(request, entity, context)
+ def _edit(self, request, entity, context, params):
+ """Hook for edit View.
+
+ Adds the title of the document to the edit View.
+
+ For args see base.View._edit().
+ """
+
+ context['page_name'] = "%s titled '%s'" %(context['page_name'],
+ entity.title)
+
+ return super(View, self)._edit(request, entity, context, params)
+
def _editPost(self, request, entity, fields):
"""See base.View._editPost().
"""
--- a/app/soc/views/models/notification.py Mon Aug 10 16:35:01 2009 -0700
+++ b/app/soc/views/models/notification.py Mon Aug 10 16:58:51 2009 -0700
@@ -188,7 +188,7 @@
if entity.unread:
# get the current user
user = user_logic.getForCurrentAccount()
-
+
# if the message is meant for the user that is reading it
# pylint: disable-msg=E1103
if entity.scope.key() == user.key():
@@ -197,6 +197,7 @@
context['entity_type_url'] = self._params['url_name']
context['entity_suffix'] = entity.key().id_or_name() if entity else None
+ context['page_name'] = 'Notification - %s' %(entity.subject)
return True
--- a/app/soc/views/models/request.py Mon Aug 10 16:35:01 2009 -0700
+++ b/app/soc/views/models/request.py Mon Aug 10 16:58:51 2009 -0700
@@ -124,6 +124,16 @@
self._params['request_form'] = request_form
+ def _edit(self, request, entity, context, params):
+ """Hook for edit View.
+
+ Changes the page name to contain request information.
+
+ For args see base.View._edit().
+ """
+ context['page_name'] = '%s to become a %s for %s' %(context['page_name'],
+ entity.role_verbose,
+ entity.scope.name)
@decorators.merge_params
@decorators.check_access
@@ -153,8 +163,8 @@
request_entity = request_logic.getForFields(fields, unique=True)
# set the page name using the request_entity
- context['page_name'] = '%s %s' % (page_name,
- request_entity.role_verbose)
+ context['page_name'] = '%s %s for %s' % (page_name,
+ request_entity.role_verbose, request_entity.scope.name)
get_dict = request.GET
--- a/app/soc/views/models/role.py Mon Aug 10 16:35:01 2009 -0700
+++ b/app/soc/views/models/role.py Mon Aug 10 16:58:51 2009 -0700
@@ -105,7 +105,7 @@
'Accept invite for %(name)s'),
(r'^%(url_name)s/(?P<access_type>process_request)/%(scope)s/%(lnp)s$',
'soc.views.models.%(module_name)s.process_request',
- 'Process request for %(name)s'),
+ 'Process request'),
(r'^%(url_name)s/(?P<access_type>request)/%(scope)s$',
'soc.views.models.%(module_name)s.role_request',
'Create a Request to become %(name)s')]
@@ -575,10 +575,6 @@
kwargs: the Key Fields for the specified entity
"""
- # get the context for this webpage
- context = responses.getUniversalContext(request)
- responses.useJavaScript(context, params['js_uses_all'])
- context['page_name'] = page_name
# get the request entity using the information from kwargs
fields = {'link_id': kwargs['link_id'],
@@ -586,9 +582,16 @@
'role': params['logic'].role_name}
request_entity = request_logic.logic.getForFields(fields, unique=True)
+ # get the context for this webpage
+ context = responses.getUniversalContext(request)
+ responses.useJavaScript(context, params['js_uses_all'])
+
# pylint: disable-msg=E1103
user_entity = user_logic.logic.getFromKeyNameOr404(request_entity.link_id)
+ context['page_name'] = '%s from %s to become a %s' %(
+ page_name, user_entity.name, request_entity.role_verbose)
+
get_dict = request.GET
if 'status' in get_dict.keys():
--- a/app/soc/views/models/student_proposal.py Mon Aug 10 16:35:01 2009 -0700
+++ b/app/soc/views/models/student_proposal.py Mon Aug 10 16:58:51 2009 -0700
@@ -311,19 +311,19 @@
For params see base.view.Public().
"""
- context = helper.responses.getUniversalContext(request)
- helper.responses.useJavaScript(context, params['js_uses_all'])
- context['page_name'] = page_name
-
try:
entity = self._logic.getFromKeyFieldsOr404(kwargs)
except out_of_band.Error, error:
return helper.responses.errorResponse(
error, request, template=params['error_public'], context=context)
+ context = helper.responses.getUniversalContext(request)
+ helper.responses.useJavaScript(context, params['js_uses_all'])
context['entity'] = entity
context['entity_type'] = params['name']
context['entity_type_url'] = params['url_name']
+ context['page_name'] = 'Proposal titled "%s" from %s' % (
+ entity.title, entity.scope.name())
if request.method == 'POST':
return self.publicPost(request, context, params, entity, **kwargs)