author | Madhusudan.C.S <madhusudancs@gmail.com> |
Tue, 15 Sep 2009 20:54:40 +0200 | |
changeset 2922 | 6e373954bbf6 |
parent 1875 | 69d60793092a |
permissions | -rw-r--r-- |
363
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
1 |
#!/usr/bin/python2.5 |
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
2 |
# |
1308
35b75ffcbb37
Partially reverted "Update the copyright notice for 2009."
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1307
diff
changeset
|
3 |
# Copyright 2008 the Melange authors. |
363
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
4 |
# |
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
5 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
6 |
# you may not use this file except in compliance with the License. |
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
7 |
# You may obtain a copy of the License at |
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
8 |
# |
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
9 |
# http://www.apache.org/licenses/LICENSE-2.0 |
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
10 |
# |
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
11 |
# Unless required by applicable law or agreed to in writing, software |
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
12 |
# distributed under the License is distributed on an "AS IS" BASIS, |
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
13 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
14 |
# See the License for the specific language governing permissions and |
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
15 |
# limitations under the License. |
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
16 |
|
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
17 |
"""Views for Sponsor profiles. |
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
18 |
""" |
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
19 |
|
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
20 |
__authors__ = [ |
429
e50e18936f06
Fixed typo in e-mail address
Sverre Rabbelier <srabbelier@gmail.com>
parents:
409
diff
changeset
|
21 |
'"Sverre Rabbelier" <sverre@rabbelier.nl>', |
583
12960609a69c
Fills in the Founded By box in edit sponsor with the user's public name
Lennard de Rijk <ljvderijk@gmail.com>
parents:
569
diff
changeset
|
22 |
'"Lennard de Rijk" <ljvderijk@gmail.com>', |
363
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
23 |
'"Pawel Solyga" <pawel.solyga@gmail.com>', |
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
24 |
] |
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
25 |
|
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
26 |
|
1875
69d60793092a
Specify the type of Link ID used
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1701
diff
changeset
|
27 |
from django import forms |
69d60793092a
Specify the type of Link ID used
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1701
diff
changeset
|
28 |
|
387
c55195361cb6
Addressed comments by Todd on r822
Sverre Rabbelier <srabbelier@gmail.com>
parents:
363
diff
changeset
|
29 |
from soc.logic import dicts |
1219
aad447d05cfc
Fix import sorting in soc.views.models.sponsor module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
1203
diff
changeset
|
30 |
from soc.logic.models.host import logic as host_logic |
1163
d8c50be19232
Cleaned up access.py
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1144
diff
changeset
|
31 |
from soc.logic.models.sponsor import logic as sponsor_logic |
995
886c981fda2c
Added rights check to sponsor.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
993
diff
changeset
|
32 |
from soc.views.helper import access |
1583 | 33 |
from soc.views.helper import decorators |
1071
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
34 |
from soc.views.helper import redirects |
658
9964b1571ef8
Factor out the Group part of Sponsor
Sverre Rabbelier <srabbelier@gmail.com>
parents:
656
diff
changeset
|
35 |
from soc.views.models import group |
363
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
36 |
|
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
37 |
import soc.models.sponsor |
993
99c46908b4b6
Renamed role_names to role_logic and made it a dictionary.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
989
diff
changeset
|
38 |
import soc.logic.dicts |
363
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
39 |
import soc.logic.models.sponsor |
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
40 |
|
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
41 |
|
658
9964b1571ef8
Factor out the Group part of Sponsor
Sverre Rabbelier <srabbelier@gmail.com>
parents:
656
diff
changeset
|
42 |
class View(group.View): |
499
d22e4fe8e64b
Fix missing dots in doc strings and some other doc string corrections.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
494
diff
changeset
|
43 |
"""View methods for the Sponsor model. |
363
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
44 |
""" |
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
45 |
|
656
a76f1b443ea4
Cleanups in the views module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
654
diff
changeset
|
46 |
def __init__(self, params=None): |
363
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
47 |
"""Defines the fields and methods required for the base View class |
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
48 |
to provide the user with list, public, create, edit and delete views. |
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
49 |
|
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
50 |
Params: |
656
a76f1b443ea4
Cleanups in the views module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
654
diff
changeset
|
51 |
params: a dict with params for this View |
387
c55195361cb6
Addressed comments by Todd on r822
Sverre Rabbelier <srabbelier@gmail.com>
parents:
363
diff
changeset
|
52 |
""" |
363
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
53 |
|
1007
3b66772d21a5
Major refactor of the access module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1003
diff
changeset
|
54 |
rights = access.Checker(params) |
3b66772d21a5
Major refactor of the access module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1003
diff
changeset
|
55 |
rights['create'] = ['checkIsDeveloper'] |
1557
9e32e6258319
Properly fixed host access now
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1554
diff
changeset
|
56 |
rights['edit'] = [('checkHasActiveRoleForLinkIdAsScope', host_logic), |
1526
5c31184594a5
Convert everything to use the new access methods
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1343
diff
changeset
|
57 |
('checkGroupIsActiveForLinkId', sponsor_logic)] |
1007
3b66772d21a5
Major refactor of the access module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1003
diff
changeset
|
58 |
rights['delete'] = ['checkIsDeveloper'] |
1248
f318538394d9
Rename checkHasActiveRole to checkHasActiveRoleForScope
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1219
diff
changeset
|
59 |
rights['home'] = [('checkHasActiveRoleForScope', host_logic)] |
1007
3b66772d21a5
Major refactor of the access module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1003
diff
changeset
|
60 |
rights['list'] = ['checkIsDeveloper'] |
1664
07c536240838
Fix too long line in soc.views.models.sponsor module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
1584
diff
changeset
|
61 |
rights['list_requests'] = [('checkHasActiveRoleForLinkIdAsScope', |
07c536240838
Fix too long line in soc.views.models.sponsor module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
1584
diff
changeset
|
62 |
host_logic)] |
1557
9e32e6258319
Properly fixed host access now
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1554
diff
changeset
|
63 |
rights['list_roles'] = [('checkHasActiveRoleForLinkIdAsScope', host_logic)] |
995
886c981fda2c
Added rights check to sponsor.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
993
diff
changeset
|
64 |
|
656
a76f1b443ea4
Cleanups in the views module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
654
diff
changeset
|
65 |
new_params = {} |
a76f1b443ea4
Cleanups in the views module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
654
diff
changeset
|
66 |
new_params['logic'] = soc.logic.models.sponsor.logic |
995
886c981fda2c
Added rights check to sponsor.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
993
diff
changeset
|
67 |
new_params['rights'] = rights |
989
f52654ea6350
Moved listRequests from club to group view.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
934
diff
changeset
|
68 |
|
716
26dc12dae79f
Changed "Sponsor" to "Program Owner"
Lennard de Rijk <ljvderijk@gmail.com>
parents:
658
diff
changeset
|
69 |
new_params['name'] = "Program Owner" |
656
a76f1b443ea4
Cleanups in the views module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
654
diff
changeset
|
70 |
new_params['module_name'] = "sponsor" |
1303
08433090cff8
Add prefix filtering and refactored program field generation
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1248
diff
changeset
|
71 |
new_params['document_prefix'] = "sponsor" |
1025
1f83f05f522b
Add grouping to the existing views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1007
diff
changeset
|
72 |
new_params['sidebar_grouping'] = 'Programs' |
606 | 73 |
|
1875
69d60793092a
Specify the type of Link ID used
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1701
diff
changeset
|
74 |
new_params['create_dynafields'] = [ |
69d60793092a
Specify the type of Link ID used
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1701
diff
changeset
|
75 |
{'name': 'link_id', |
69d60793092a
Specify the type of Link ID used
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1701
diff
changeset
|
76 |
'base': forms.fields.CharField, |
69d60793092a
Specify the type of Link ID used
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1701
diff
changeset
|
77 |
'label': 'Sponsor Link ID', |
69d60793092a
Specify the type of Link ID used
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1701
diff
changeset
|
78 |
}, |
69d60793092a
Specify the type of Link ID used
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1701
diff
changeset
|
79 |
] |
69d60793092a
Specify the type of Link ID used
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1701
diff
changeset
|
80 |
|
656
a76f1b443ea4
Cleanups in the views module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
654
diff
changeset
|
81 |
params = dicts.merge(params, new_params) |
a76f1b443ea4
Cleanups in the views module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
654
diff
changeset
|
82 |
|
a76f1b443ea4
Cleanups in the views module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
654
diff
changeset
|
83 |
super(View, self).__init__(params=params) |
363
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
84 |
|
1071
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
85 |
def _getExtraMenuItems(self, role_description, params=None): |
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
86 |
"""Used to create the specific Sponsor menu entries. |
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
87 |
|
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
88 |
For args see group.View._getExtraMenuItems(). |
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
89 |
""" |
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
90 |
|
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
91 |
submenus = [] |
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
92 |
|
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
93 |
group_entity = role_description['group'] |
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
94 |
roles = role_description['roles'] |
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
95 |
|
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
96 |
if roles.get('host'): |
1104
02997d6661fa
Added a Create a New Program link to the Program Owners's menu.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1097
diff
changeset
|
97 |
# add a link to create a new program |
02997d6661fa
Added a Create a New Program link to the Program Owners's menu.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1097
diff
changeset
|
98 |
submenu = (redirects.getCreateRedirect(group_entity, |
1144
f89bbc9b20a6
Rename 'Create a new document' links to 'Create a New Document', also rename 'Create a new Program' to 'Create a New Program' in soc.views.models modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
1104
diff
changeset
|
99 |
{'url_name': 'program'}),"Create a New Program", 'any_access') |
1104
02997d6661fa
Added a Create a New Program link to the Program Owners's menu.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1097
diff
changeset
|
100 |
submenus.append(submenu) |
02997d6661fa
Added a Create a New Program link to the Program Owners's menu.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1097
diff
changeset
|
101 |
|
1071
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
102 |
# add a link to the management page |
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
103 |
submenu = (redirects.getListRolesRedirect(group_entity, params), |
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
104 |
"Manage Program Administrators", 'any_access') |
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
105 |
submenus.append(submenu) |
1003
b13da1ddcd50
Added sidebar entries for club entities.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
998
diff
changeset
|
106 |
|
1071
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
107 |
# add a link to invite an a host |
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
108 |
submenu = (redirects.getInviteRedirectForRole(group_entity, 'host'), |
1701
58e3b1e2b0c1
Fixed more typos in Sponsor Menu.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1695
diff
changeset
|
109 |
"Invite a Program Administrator", 'any_access') |
1071
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
110 |
submenus.append(submenu) |
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
111 |
|
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
112 |
# add a link to the request page |
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
113 |
submenu = (redirects.getListRequestsRedirect(group_entity, params), |
1701
58e3b1e2b0c1
Fixed more typos in Sponsor Menu.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1695
diff
changeset
|
114 |
"List Program Administrator Invites", 'any_access') |
1071
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
115 |
submenus.append(submenu) |
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
116 |
|
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
117 |
# add a link to the edit page |
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
118 |
submenu = (redirects.getEditRedirect(group_entity, params), |
1695
d0f8d033cf3c
Fixed typo in Sponsor sidebar menu.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1664
diff
changeset
|
119 |
"Edit Program Owner Profile", 'any_access') |
1071
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
120 |
submenus.append(submenu) |
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
121 |
|
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
122 |
# add a link to resign as a host |
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
123 |
submenu = (redirects.getManageRedirect(roles['host'], |
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
124 |
{'url_name': 'host'}), |
1701
58e3b1e2b0c1
Fixed more typos in Sponsor Menu.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1695
diff
changeset
|
125 |
"Resign as Program Administrator", 'any_access') |
1071
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
126 |
submenus.append(submenu) |
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
127 |
|
1317
fad74cf4e5da
Add a 'list documents' link everywhere
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1308
diff
changeset
|
128 |
# add a link to create a new document |
1097
1f7015b33a0c
Add a 'Create new document' link for clubs, sponsors and programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1071
diff
changeset
|
129 |
submenu = (redirects.getCreateDocumentRedirect(group_entity, 'sponsor'), |
1144
f89bbc9b20a6
Rename 'Create a new document' links to 'Create a New Document', also rename 'Create a new Program' to 'Create a New Program' in soc.views.models modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
1104
diff
changeset
|
130 |
"Create a New Document", 'any_access') |
1097
1f7015b33a0c
Add a 'Create new document' link for clubs, sponsors and programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1071
diff
changeset
|
131 |
submenus.append(submenu) |
1f7015b33a0c
Add a 'Create new document' link for clubs, sponsors and programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1071
diff
changeset
|
132 |
|
1317
fad74cf4e5da
Add a 'list documents' link everywhere
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1308
diff
changeset
|
133 |
# add a link to list all documents |
fad74cf4e5da
Add a 'list documents' link everywhere
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1308
diff
changeset
|
134 |
submenu = (redirects.getListDocumentsRedirect(group_entity, 'sponsor'), |
fad74cf4e5da
Add a 'list documents' link everywhere
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1308
diff
changeset
|
135 |
"List Documents", 'any_access') |
fad74cf4e5da
Add a 'list documents' link everywhere
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1308
diff
changeset
|
136 |
submenus.append(submenu) |
fad74cf4e5da
Add a 'list documents' link everywhere
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1308
diff
changeset
|
137 |
|
1071
dfa86ed03a66
Added menu entries for a specific Sponsor Entity.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1063
diff
changeset
|
138 |
return submenus |
1003
b13da1ddcd50
Added sidebar entries for club entities.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
998
diff
changeset
|
139 |
|
363
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
140 |
|
d35ffa6ca643
Add a framework for generic views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
141 |
view = View() |
399
b82852e6963e
Various improvements to the generic View code
Sverre Rabbelier <srabbelier@gmail.com>
parents:
389
diff
changeset
|
142 |
|
1584
d8ba8c917f37
Make use of decorators.view for all views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1583
diff
changeset
|
143 |
admin = decorators.view(view.admin) |
d8ba8c917f37
Make use of decorators.view for all views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1583
diff
changeset
|
144 |
create = decorators.view(view.create) |
d8ba8c917f37
Make use of decorators.view for all views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1583
diff
changeset
|
145 |
delete = decorators.view(view.delete) |
d8ba8c917f37
Make use of decorators.view for all views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1583
diff
changeset
|
146 |
edit = decorators.view(view.edit) |
d8ba8c917f37
Make use of decorators.view for all views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1583
diff
changeset
|
147 |
home = decorators.view(view.home) |
d8ba8c917f37
Make use of decorators.view for all views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1583
diff
changeset
|
148 |
list = decorators.view(view.list) |
d8ba8c917f37
Make use of decorators.view for all views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1583
diff
changeset
|
149 |
list_requests = decorators.view(view.listRequests) |
d8ba8c917f37
Make use of decorators.view for all views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1583
diff
changeset
|
150 |
list_roles = decorators.view(view.listRoles) |
d8ba8c917f37
Make use of decorators.view for all views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1583
diff
changeset
|
151 |
public = decorators.view(view.public) |
d8ba8c917f37
Make use of decorators.view for all views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1583
diff
changeset
|
152 |
export = decorators.view(view.export) |
d8ba8c917f37
Make use of decorators.view for all views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1583
diff
changeset
|
153 |
pick = decorators.view(view.pick) |