# HG changeset patch # User Sverre Rabbelier # Date 1227362499 0 # Node ID 68c7a1dd3c52a52e6d67ec6fc9dce2b7579c82b9 # Parent c0cc20b4afc91ef9e05cbaeeb0c16bbd08c131a8 Renamed templates/soc/entity/list/entity_*.html to *.html This makes it possible to generalize list template positions. Patch by: Sverre Rabbelier diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/document/list/docs_heading.html --- a/app/soc/templates/soc/document/list/docs_heading.html Sat Nov 22 13:59:34 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ - - Path - Title - Link ID - Featured - Created By - Created On - Modified - diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/document/list/docs_row.html --- a/app/soc/templates/soc/document/list/docs_row.html Sat Nov 22 13:59:34 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ - - -
- {{ list.item.scope_path}}/{{ list.item.link_id }} -
- -
{{ list.item.title }}
- - -
{{ list.item.author.link_id }}
-
{{ list.item.created }}
-
{{ list.item.modified }}
- diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/document/list/heading.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/templates/soc/document/list/heading.html Sat Nov 22 14:01:39 2008 +0000 @@ -0,0 +1,9 @@ + + Path + Title + Link ID + Featured + Created By + Created On + Modified + diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/document/list/row.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/templates/soc/document/list/row.html Sat Nov 22 14:01:39 2008 +0000 @@ -0,0 +1,15 @@ + + +
+ {{ list.item.scope_path}}/{{ list.item.link_id }} +
+ +
{{ list.item.title }}
+ + +
{{ list.item.author.link_id }}
+
{{ list.item.created }}
+
{{ list.item.modified }}
+ diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/group/list/group_heading.html --- a/app/soc/templates/soc/group/list/group_heading.html Sat Nov 22 13:59:34 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ - - Name - Link ID - Short name - diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/group/list/group_row.html --- a/app/soc/templates/soc/group/list/group_row.html Sat Nov 22 13:59:34 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ - -
{{ list.item.name }} -
- - -
{{ list.item.short_name }}
- diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/group/list/heading.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/templates/soc/group/list/heading.html Sat Nov 22 14:01:39 2008 +0000 @@ -0,0 +1,5 @@ + + Name + Link ID + Short name + diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/group/list/row.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/templates/soc/group/list/row.html Sat Nov 22 14:01:39 2008 +0000 @@ -0,0 +1,9 @@ + +
{{ list.item.name }} +
+ + +
{{ list.item.short_name }}
+ diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/host/list/heading.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/templates/soc/host/list/heading.html Sat Nov 22 14:01:39 2008 +0000 @@ -0,0 +1,6 @@ + + User link ID + Sponsor name + Given name + Surname + diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/host/list/host_heading.html --- a/app/soc/templates/soc/host/list/host_heading.html Sat Nov 22 13:59:34 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ - - User link ID - Sponsor name - Given name - Surname - diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/host/list/host_row.html --- a/app/soc/templates/soc/host/list/host_row.html Sat Nov 22 13:59:34 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ - - - - -
{{ list.item.given_name }}
-
{{ list.item.surname }}
- diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/host/list/row.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/templates/soc/host/list/row.html Sat Nov 22 14:01:39 2008 +0000 @@ -0,0 +1,10 @@ + + + + +
{{ list.item.given_name }}
+
{{ list.item.surname }}
+ diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/list/list_heading.html --- a/app/soc/templates/soc/list/list_heading.html Sat Nov 22 13:59:34 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ - - Default Heading - diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/list/list_main.html --- a/app/soc/templates/soc/list/list_main.html Sat Nov 22 13:59:34 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -{{ list.description }} - -
- {% include list.pagination %} - - - {% if not list.rows %} - - {% else %} - {% include list.heading %} - {% for _ in list.rows %} - {% include list.next_row %} - {% endfor %} - {% endif %} -
(None)
- - {% include list.pagination %} - -
\ No newline at end of file diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/list/list_pagination.html --- a/app/soc/templates/soc/list/list_pagination.html Sat Nov 22 13:59:34 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/list/list_row.html --- a/app/soc/templates/soc/list/list_row.html Sat Nov 22 13:59:34 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ - -
{{ list.item }} -
- - diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/list/main.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/templates/soc/list/main.html Sat Nov 22 14:01:39 2008 +0000 @@ -0,0 +1,19 @@ +{{ list.description }} + +
+ {% include list.pagination %} + + + {% if not list.rows %} + + {% else %} + {% include list.heading %} + {% for _ in list.rows %} + {% include list.next_row %} + {% endfor %} + {% endif %} +
(None)
+ + {% include list.pagination %} + +
\ No newline at end of file diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/list/pagination.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/templates/soc/list/pagination.html Sat Nov 22 14:01:39 2008 +0000 @@ -0,0 +1,14 @@ + diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/presence/list/heading.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/templates/soc/presence/list/heading.html Sat Nov 22 14:01:39 2008 +0000 @@ -0,0 +1,4 @@ + + Path + Home Document + diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/presence/list/home_heading.html --- a/app/soc/templates/soc/presence/list/home_heading.html Sat Nov 22 13:59:34 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ - - Path - Home Document - diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/presence/list/home_row.html --- a/app/soc/templates/soc/presence/list/home_row.html Sat Nov 22 13:59:34 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ - - -
- {{ list.item.scope_path}}/{{ list.item.link_id }} -
- - - diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/presence/list/row.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/templates/soc/presence/list/row.html Sat Nov 22 14:01:39 2008 +0000 @@ -0,0 +1,10 @@ + + +
+ {{ list.item.scope_path}}/{{ list.item.link_id }} +
+ + + diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/request/list/heading.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/templates/soc/request/list/heading.html Sat Nov 22 14:01:39 2008 +0000 @@ -0,0 +1,7 @@ + + Requester + Role + To + Accepted + Declined + diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/request/list/request_heading.html --- a/app/soc/templates/soc/request/list/request_heading.html Sat Nov 22 13:59:34 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ - - Requester - Role - To - Accepted - Declined - diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/request/list/request_row.html --- a/app/soc/templates/soc/request/list/request_row.html Sat Nov 22 13:59:34 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ - - - -
{{ list.item.role }}
-
{{ list.item.to.link_id }}
-
{{ list.item.accepted }}
-
{{ list.item.declined }}
- diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/request/list/row.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/templates/soc/request/list/row.html Sat Nov 22 14:01:39 2008 +0000 @@ -0,0 +1,11 @@ + + + +
{{ list.item.role }}
+
{{ list.item.to.link_id }}
+
{{ list.item.accepted }}
+
{{ list.item.declined }}
+ diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/site/list/heading.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/templates/soc/site/list/heading.html Sat Nov 22 14:01:39 2008 +0000 @@ -0,0 +1,4 @@ + + Path + Home Document + diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/site/list/row.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/templates/soc/site/list/row.html Sat Nov 22 14:01:39 2008 +0000 @@ -0,0 +1,10 @@ + + +
+ {{ list.item.scope_path}}/{{ list.item.link_id }} +
+ + + diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/site/list/site_heading.html --- a/app/soc/templates/soc/site/list/site_heading.html Sat Nov 22 13:59:34 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ - - Path - Home Document - diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/site/list/site_row.html --- a/app/soc/templates/soc/site/list/site_row.html Sat Nov 22 13:59:34 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ - - -
- {{ list.item.scope_path}}/{{ list.item.link_id }} -
- - - diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/user/list/heading.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/templates/soc/user/list/heading.html Sat Nov 22 14:01:39 2008 +0000 @@ -0,0 +1,6 @@ + + Account + Email + Public name + Link ID + diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/user/list/row.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/templates/soc/user/list/row.html Sat Nov 22 14:01:39 2008 +0000 @@ -0,0 +1,10 @@ + +
{{ list.item.account }} +
+ +
{{ list.item.account.email }}
+
{{ list.item.name }}
+ + diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/user/list/user_heading.html --- a/app/soc/templates/soc/user/list/user_heading.html Sat Nov 22 13:59:34 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ - - Account - Email - Public name - Link ID - diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/templates/soc/user/list/user_row.html --- a/app/soc/templates/soc/user/list/user_row.html Sat Nov 22 13:59:34 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ - -
{{ list.item.account }} -
- -
{{ list.item.account.email }}
-
{{ list.item.name }}
- - diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/views/models/base.py --- a/app/soc/views/models/base.py Sat Nov 22 13:59:34 2008 +0000 +++ b/app/soc/views/models/base.py Sat Nov 22 14:01:39 2008 +0000 @@ -98,8 +98,10 @@ new_params = {} new_params['rights'] = rights - new_params['create_redirect'] = '/%s' % params['url_name'] - new_params['missing_redirect'] = '/%s/create' % params['url_name'] + new_params['create_redirect'] = '/%(url_name)s' % params + new_params['missing_redirect'] = '/%(url_name)s/create' % params + new_params['delete_redirect'] = '/%(url_name)s/list' % params + new_params['invite_redirect'] = '/request/list' new_params['sidebar'] = None new_params['sidebar_defaults'] = [ @@ -127,13 +129,17 @@ 'soc.views.models.%s.list', 'List %(name_plural)s'), ] + new_params['public_template'] = 'soc/%(module_name)s/public.html' % params + new_params['create_template'] = 'soc/models/edit.html' new_params['edit_template'] = 'soc/models/edit.html' new_params['list_template'] = 'soc/models/list.html' new_params['invite_template'] = 'soc/models/invite.html' - new_params['list_main'] = 'soc/list/list_main.html' - new_params['list_pagination'] = 'soc/list/list_pagination.html' - + new_params['list_main'] = 'soc/list/main.html' + new_params['list_pagination'] = 'soc/list/pagination.html' + new_params['list_row'] = 'soc/%(module_name)s/list/row.html' % params + new_params['list_heading'] = 'soc/%(module_name)s/list/heading.html' % params + new_params['list_action'] = '/' + params['url_name'] + '/edit' new_params['list_params'] = { 'list_action': 'action', @@ -526,7 +532,7 @@ if access_type not in rights: for check in rights['unspecified']: # No checks defined, so do the 'generic check' and bail out - check(request, access_type) + check(request) return for check in rights[access_type]: diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/views/models/document.py --- a/app/soc/views/models/document.py Sat Nov 22 13:59:34 2008 +0000 +++ b/app/soc/views/models/document.py Sat Nov 22 14:01:39 2008 +0000 @@ -103,14 +103,6 @@ params['edit_form'] = EditForm params['create_form'] = CreateForm - # TODO(tlarsen) Add support for Django style template lookup - params['public_template'] = 'soc/document/public.html' - - params['list_row'] = 'soc/document/list/docs_row.html' - params['list_heading'] = 'soc/document/list/docs_heading.html' - - params['delete_redirect'] = '/' + params['url_name'] + '/list' - params = dicts.merge(original_params, params) base.View.__init__(self, params=params) diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/views/models/host.py --- a/app/soc/views/models/host.py Sat Nov 22 13:59:34 2008 +0000 +++ b/app/soc/views/models/host.py Sat Nov 22 14:01:39 2008 +0000 @@ -101,15 +101,6 @@ params['edit_form'] = EditForm params['create_form'] = CreateForm - # TODO(tlarsen) Add support for Django style template lookup - params['public_template'] = 'soc/host/public.html' - - params['list_row'] = 'soc/host/list/host_row.html' - params['list_heading'] = 'soc/host/list/host_heading.html' - - params['delete_redirect'] = '/' + params['url_name'] + '/list' - params['invite_redirect'] = '/request/list' - params = dicts.merge(original_params, params) role.RoleView.__init__(self, original_params=params) diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/views/models/presence.py --- a/app/soc/views/models/presence.py Sat Nov 22 13:59:34 2008 +0000 +++ b/app/soc/views/models/presence.py Sat Nov 22 14:01:39 2008 +0000 @@ -118,14 +118,6 @@ params['edit_form'] = EditForm params['create_form'] = CreateForm - # TODO(tlarsen) Add support for Django style template lookup - params['public_template'] = 'soc/presence/public.html' - - params['list_row'] = 'soc/presence/list/home_row.html' - params['list_heading'] = 'soc/presence/list/home_heading.html' - - params['delete_redirect'] = '/' + params['url_name'] + '/list' - params = dicts.merge(original_params, params) base.View.__init__(self, params=params) diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/views/models/request.py --- a/app/soc/views/models/request.py Sat Nov 22 13:59:34 2008 +0000 +++ b/app/soc/views/models/request.py Sat Nov 22 14:01:39 2008 +0000 @@ -109,12 +109,6 @@ params['edit_form'] = EditForm params['create_form'] = CreateForm - # TODO(tlarsen) Add support for Django style template lookup - params['public_template'] = 'soc/request/public.html' - - params['list_row'] = 'soc/request/list/request_row.html' - params['list_heading'] = 'soc/request/list/request_heading.html' - params['sidebar_defaults'] = [('/%s/list', 'List %(name_plural)s')] params['delete_redirect'] = '/' + params['url_name'] + '/list' diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/views/models/site.py --- a/app/soc/views/models/site.py Sat Nov 22 13:59:34 2008 +0000 +++ b/app/soc/views/models/site.py Sat Nov 22 14:01:39 2008 +0000 @@ -95,17 +95,13 @@ params['sidebar_defaults'] = [('/%s/edit', 'Edit %(name)s')] params['sidebar_heading'] = params['name_short'] - params['lists_template'] = { - 'list_main': 'soc/list/list_main.html', - 'list_pagination': 'soc/list/list_pagination.html', - 'list_row': 'soc/site/list/site_row.html', - 'list_heading': 'soc/site/list/site_heading.html', - } + params['public_template'] = 'soc/home/public.html' - params['delete_redirect'] = '/' + params['url_name'] + '/list' params['rights'] = { + 'unspecified': [access.checkIsDeveloper], 'any_access': [access.allow], - 'public': [access.allow]} + 'public': [access.allow] + } params = dicts.merge(original_params, params) diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/views/models/sponsor.py --- a/app/soc/views/models/sponsor.py Sat Nov 22 13:59:34 2008 +0000 +++ b/app/soc/views/models/sponsor.py Sat Nov 22 14:01:39 2008 +0000 @@ -122,10 +122,8 @@ params['edit_template'] = 'soc/sponsor/edit.html' params['public_template'] = 'soc/group/public.html' - params['list_row'] = 'soc/group/list/group_row.html' - params['list_heading'] = 'soc/group/list/group_heading.html' - - params['delete_redirect'] = '/' + params['url_name'] + '/list' + params['list_row'] = 'soc/group/list/row.html' + params['list_heading'] = 'soc/group/list/heading.html' params = dicts.merge(original_params, params) diff -r c0cc20b4afc9 -r 68c7a1dd3c52 app/soc/views/models/user.py --- a/app/soc/views/models/user.py Sat Nov 22 13:59:34 2008 +0000 +++ b/app/soc/views/models/user.py Sat Nov 22 14:01:39 2008 +0000 @@ -176,14 +176,6 @@ params['edit_form'] = EditForm params['create_form'] = CreateForm - # TODO(tlarsen) Add support for Django style template lookup - params['public_template'] = 'soc/user/public.html' - - params['list_row'] = 'soc/user/list/user_row.html' - params['list_heading'] = 'soc/user/list/user_heading.html' - - params['delete_redirect'] = '/' + params['url_name'] + '/list' - params['sidebar_heading'] = 'Users' params = dicts.merge(original_params, params)