author | Sverre Rabbelier <srabbelier@gmail.com> |
Sat, 14 Feb 2009 20:22:17 +0000 | |
changeset 1323 | a666374587df |
parent 1317 | fad74cf4e5da |
child 1325 | 8368086dd3a7 |
permissions | -rw-r--r-- |
682 | 1 |
#!/usr/bin/python2.5 |
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. |
682 | 4 |
# |
5 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
|
6 |
# you may not use this file except in compliance with the License. |
|
7 |
# You may obtain a copy of the License at |
|
8 |
# |
|
9 |
# http://www.apache.org/licenses/LICENSE-2.0 |
|
10 |
# |
|
11 |
# Unless required by applicable law or agreed to in writing, software |
|
12 |
# distributed under the License is distributed on an "AS IS" BASIS, |
|
13 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
14 |
# See the License for the specific language governing permissions and |
|
15 |
# limitations under the License. |
|
16 |
||
17 |
"""Views for Organizations. |
|
18 |
""" |
|
19 |
||
20 |
__authors__ = [ |
|
21 |
'"Sverre Rabbelier" <sverre@rabbelier.nl>', |
|
1126
4fc86db70a76
Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1079
diff
changeset
|
22 |
'"Lennard de Rijk" <ljvderijk@gmail.com>', |
682 | 23 |
] |
24 |
||
25 |
||
26 |
from django import forms |
|
27 |
||
690
14e9f484412c
Fix imports sorting in soc.views.models.organization.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
682
diff
changeset
|
28 |
from soc.logic import cleaning |
682 | 29 |
from soc.logic import dicts |
1266
e8feadcbc47f
Changed the access checks for organization.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1264
diff
changeset
|
30 |
from soc.logic.models import organization as org_logic |
e8feadcbc47f
Changed the access checks for organization.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1264
diff
changeset
|
31 |
from soc.logic.models import org_admin as org_admin_logic |
1154
77276e2c46f7
Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1126
diff
changeset
|
32 |
from soc.logic.models import org_app as org_app_logic |
1126
4fc86db70a76
Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1079
diff
changeset
|
33 |
from soc.views.helper import access |
1154
77276e2c46f7
Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1126
diff
changeset
|
34 |
from soc.views.helper import dynaform |
682 | 35 |
from soc.views.helper import redirects |
1154
77276e2c46f7
Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1126
diff
changeset
|
36 |
from soc.views.helper import widgets |
682 | 37 |
from soc.views.models import group |
38 |
from soc.views.models import program as program_view |
|
39 |
||
40 |
import soc.models.organization |
|
41 |
import soc.logic.models.organization |
|
42 |
||
43 |
||
44 |
class View(group.View): |
|
45 |
"""View methods for the Organization model. |
|
46 |
""" |
|
47 |
||
48 |
def __init__(self, params=None): |
|
49 |
"""Defines the fields and methods required for the base View class |
|
50 |
to provide the user with list, public, create, edit and delete views. |
|
51 |
||
52 |
Params: |
|
53 |
original_params: a dict with params for this View |
|
54 |
""" |
|
55 |
||
1126
4fc86db70a76
Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1079
diff
changeset
|
56 |
rights = access.Checker(params) |
4fc86db70a76
Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1079
diff
changeset
|
57 |
rights['create'] = ['checkIsDeveloper'] |
1266
e8feadcbc47f
Changed the access checks for organization.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1264
diff
changeset
|
58 |
rights['edit'] = [('checkHasActiveRoleForScope', |
e8feadcbc47f
Changed the access checks for organization.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1264
diff
changeset
|
59 |
[org_admin_logic.logic, 'link_id']), |
e8feadcbc47f
Changed the access checks for organization.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1264
diff
changeset
|
60 |
('checkIsActive', [org_logic.logic, None])] |
1126
4fc86db70a76
Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1079
diff
changeset
|
61 |
rights['delete'] = ['checkIsDeveloper'] |
4fc86db70a76
Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1079
diff
changeset
|
62 |
rights['home'] = ['allow'] |
4fc86db70a76
Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1079
diff
changeset
|
63 |
rights['list'] = ['checkIsDeveloper'] |
1266
e8feadcbc47f
Changed the access checks for organization.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1264
diff
changeset
|
64 |
rights['list_requests'] = [('checkHasActiveRoleForScope', |
e8feadcbc47f
Changed the access checks for organization.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1264
diff
changeset
|
65 |
[org_admin_logic.logic, 'link_id'])] |
e8feadcbc47f
Changed the access checks for organization.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1264
diff
changeset
|
66 |
rights['list_roles'] = [('checkHasActiveRoleForScope', |
e8feadcbc47f
Changed the access checks for organization.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1264
diff
changeset
|
67 |
[org_admin_logic.logic, 'link_id'])] |
e8feadcbc47f
Changed the access checks for organization.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1264
diff
changeset
|
68 |
rights['applicant'] = [('checkIsApplicationAccepted', |
e8feadcbc47f
Changed the access checks for organization.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1264
diff
changeset
|
69 |
org_app_logic.logic)] |
1126
4fc86db70a76
Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1079
diff
changeset
|
70 |
|
682 | 71 |
new_params = {} |
72 |
new_params['logic'] = soc.logic.models.organization.logic |
|
73 |
||
74 |
new_params['scope_view'] = program_view |
|
75 |
new_params['scope_redirect'] = redirects.getCreateRedirect |
|
76 |
||
77 |
new_params['name'] = "Organization" |
|
78 |
new_params['url_name'] = "org" |
|
1303
08433090cff8
Add prefix filtering and refactored program field generation
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1284
diff
changeset
|
79 |
new_params['document_prefix'] = "org" |
1126
4fc86db70a76
Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1079
diff
changeset
|
80 |
new_params['sidebar_grouping'] = 'Organizations' |
682 | 81 |
|
1126
4fc86db70a76
Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1079
diff
changeset
|
82 |
new_params['public_template'] = 'soc/organization/public.html' |
4fc86db70a76
Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1079
diff
changeset
|
83 |
new_params['list_row'] = 'soc/organization/list/row.html' |
4fc86db70a76
Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1079
diff
changeset
|
84 |
new_params['list_heading'] = 'soc/organization/list/heading.html' |
4fc86db70a76
Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1079
diff
changeset
|
85 |
|
1154
77276e2c46f7
Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1126
diff
changeset
|
86 |
new_params['application_logic'] = org_app_logic |
77276e2c46f7
Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1126
diff
changeset
|
87 |
new_params['group_applicant_url'] = True |
77276e2c46f7
Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1126
diff
changeset
|
88 |
|
682 | 89 |
new_params['create_extra_dynafields'] = { |
90 |
'scope_path': forms.CharField(widget=forms.HiddenInput, |
|
91 |
required=True), |
|
1221
0130e63704ac
Remove extra whitespaces in soc.views.models.organization module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
1205
diff
changeset
|
92 |
'clean': cleaning.validate_new_group('link_id', 'scope_path', |
1205
2e88261aba72
Added validate_new_group to cleaning and removed clean_new_club_link_id.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1154
diff
changeset
|
93 |
soc.logic.models.organization, org_app_logic)} |
2e88261aba72
Added validate_new_group to cleaning and removed clean_new_club_link_id.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1154
diff
changeset
|
94 |
|
2e88261aba72
Added validate_new_group to cleaning and removed clean_new_club_link_id.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1154
diff
changeset
|
95 |
# get rid of the clean method |
2e88261aba72
Added validate_new_group to cleaning and removed clean_new_club_link_id.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1154
diff
changeset
|
96 |
new_params['edit_extra_dynafields'] = { |
1221
0130e63704ac
Remove extra whitespaces in soc.views.models.organization module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
1205
diff
changeset
|
97 |
'clean': (lambda x: x.cleaned_data)} |
682 | 98 |
|
99 |
params = dicts.merge(params, new_params) |
|
100 |
||
101 |
super(View, self).__init__(params=params) |
|
102 |
||
1154
77276e2c46f7
Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1126
diff
changeset
|
103 |
# create and store the special form for applicants |
77276e2c46f7
Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1126
diff
changeset
|
104 |
updated_fields = { |
77276e2c46f7
Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1126
diff
changeset
|
105 |
'link_id': forms.CharField(widget=widgets.ReadOnlyInput(), |
77276e2c46f7
Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1126
diff
changeset
|
106 |
required=False), |
77276e2c46f7
Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1126
diff
changeset
|
107 |
'clean_link_id': cleaning.clean_link_id('link_id')} |
77276e2c46f7
Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1126
diff
changeset
|
108 |
|
77276e2c46f7
Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1126
diff
changeset
|
109 |
applicant_create_form = dynaform.extendDynaForm( |
77276e2c46f7
Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1126
diff
changeset
|
110 |
dynaform = self._params['create_form'], |
77276e2c46f7
Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1126
diff
changeset
|
111 |
dynafields = updated_fields) |
77276e2c46f7
Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1126
diff
changeset
|
112 |
|
77276e2c46f7
Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1126
diff
changeset
|
113 |
params['applicant_create_form'] = applicant_create_form |
77276e2c46f7
Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1126
diff
changeset
|
114 |
|
77276e2c46f7
Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1126
diff
changeset
|
115 |
|
1264
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
116 |
def _getExtraMenuItems(self, role_description, params=None): |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
117 |
"""Used to create the specific Organization menu entries. |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
118 |
|
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
119 |
For args see group.View._getExtraMenuItems(). |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
120 |
""" |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
121 |
submenus = [] |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
122 |
|
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
123 |
group_entity = role_description['group'] |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
124 |
roles = role_description['roles'] |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
125 |
|
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
126 |
if roles.get('org_admin'): |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
127 |
# add a link to the management page |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
128 |
submenu = (redirects.getListRolesRedirect(group_entity, params), |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
129 |
"Manage Admins and Mentors", 'any_access') |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
130 |
submenus.append(submenu) |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
131 |
|
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
132 |
# add a link to invite an org admin |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
133 |
submenu = (redirects.getInviteRedirectForRole(group_entity, 'org_admin'), |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
134 |
"Invite an Org Admin", 'any_access') |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
135 |
submenus.append(submenu) |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
136 |
|
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
137 |
# add a link to invite a member |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
138 |
submenu = (redirects.getInviteRedirectForRole(group_entity, 'mentor'), |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
139 |
"Invite a Mentor", 'any_access') |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
140 |
submenus.append(submenu) |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
141 |
|
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
142 |
# add a link to the request page |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
143 |
submenu = (redirects.getListRequestsRedirect(group_entity, params), |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
144 |
"List Requests and Invites", 'any_access') |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
145 |
submenus.append(submenu) |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
146 |
|
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
147 |
# add a link to the edit page |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
148 |
submenu = (redirects.getEditRedirect(group_entity, params), |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
149 |
"Edit Organization Profile", 'any_access') |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
150 |
submenus.append(submenu) |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
151 |
|
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
152 |
if roles.get('org_admin') or roles.get('mentor'): |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
153 |
submenu = (redirects.getCreateDocumentRedirect(group_entity, 'org'), |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
154 |
"Create a New Document", 'any_access') |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
155 |
submenus.append(submenu) |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
156 |
|
1317
fad74cf4e5da
Add a 'list documents' link everywhere
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1308
diff
changeset
|
157 |
submenu = (redirects.getListDocumentsRedirect(group_entity, 'org'), |
fad74cf4e5da
Add a 'list documents' link everywhere
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1308
diff
changeset
|
158 |
"List Documents", 'any_access') |
fad74cf4e5da
Add a 'list documents' link everywhere
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1308
diff
changeset
|
159 |
submenus.append(submenu) |
fad74cf4e5da
Add a 'list documents' link everywhere
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1308
diff
changeset
|
160 |
|
1264
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
161 |
if roles.get('org_admin'): |
1283
438dceed3132
Add ToS agreement to org_admin application related forms.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1266
diff
changeset
|
162 |
# add a link to the resign page |
1264
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
163 |
submenu = (redirects.getManageRedirect(roles['org_admin'], |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
164 |
{'url_name': 'org_admin'}), |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
165 |
"Resign as Org Admin", 'any_access') |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
166 |
submenus.append(submenu) |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
167 |
|
1283
438dceed3132
Add ToS agreement to org_admin application related forms.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1266
diff
changeset
|
168 |
# add a link to the edit page |
438dceed3132
Add ToS agreement to org_admin application related forms.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1266
diff
changeset
|
169 |
submenu = (redirects.getEditRedirect(roles['org_admin'], |
438dceed3132
Add ToS agreement to org_admin application related forms.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1266
diff
changeset
|
170 |
{'url_name': 'org_admin'}), |
438dceed3132
Add ToS agreement to org_admin application related forms.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1266
diff
changeset
|
171 |
"Edit My Org Admin Profile", 'any_access') |
438dceed3132
Add ToS agreement to org_admin application related forms.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1266
diff
changeset
|
172 |
submenus.append(submenu) |
438dceed3132
Add ToS agreement to org_admin application related forms.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1266
diff
changeset
|
173 |
|
1264
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
174 |
if roles.get('mentor'): |
1284
92f7a24d8f42
Add ToS agreement to mentor application related forms.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1283
diff
changeset
|
175 |
# add a link to the resign page |
1264
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
176 |
submenu = (redirects.getManageRedirect(roles['mentor'], |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
177 |
{'url_name' : 'mentor'}), |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
178 |
"Resign as Mentor", 'any_access') |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
179 |
submenus.append(submenu) |
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
180 |
|
1284
92f7a24d8f42
Add ToS agreement to mentor application related forms.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1283
diff
changeset
|
181 |
# add a link to the edit page |
92f7a24d8f42
Add ToS agreement to mentor application related forms.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1283
diff
changeset
|
182 |
submenu = (redirects.getEditRedirect(roles['mentor'], |
92f7a24d8f42
Add ToS agreement to mentor application related forms.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1283
diff
changeset
|
183 |
{'url_name': 'mentor'}), |
92f7a24d8f42
Add ToS agreement to mentor application related forms.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1283
diff
changeset
|
184 |
"Edit My Org Mentor Profile", 'any_access') |
92f7a24d8f42
Add ToS agreement to mentor application related forms.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1283
diff
changeset
|
185 |
submenus.append(submenu) |
92f7a24d8f42
Add ToS agreement to mentor application related forms.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1283
diff
changeset
|
186 |
|
1264
4d46b09f3751
Added organization entity sidebar entries.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1221
diff
changeset
|
187 |
return submenus |
1126
4fc86db70a76
Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1079
diff
changeset
|
188 |
|
682 | 189 |
|
190 |
view = View() |
|
191 |
||
1154
77276e2c46f7
Implement the last step in the org application process.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1126
diff
changeset
|
192 |
applicant = view.applicant |
682 | 193 |
create = view.create |
194 |
delete = view.delete |
|
195 |
edit = view.edit |
|
1126
4fc86db70a76
Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1079
diff
changeset
|
196 |
home = view.home |
682 | 197 |
list = view.list |
1126
4fc86db70a76
Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1079
diff
changeset
|
198 |
list_requests = view.listRequests |
4fc86db70a76
Added organization view and templates.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1079
diff
changeset
|
199 |
list_roles = view.listRoles |
682 | 200 |
public = view.public |
858
e79e7a22326f
Add an export() view, and implement it as text/text for Document.
Todd Larsen <tlarsen@google.com>
parents:
799
diff
changeset
|
201 |
export = view.export |
934
9fcc08971efe
Add a 'pick' view to the appropriate views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
858
diff
changeset
|
202 |
pick = view.pick |