author | Sverre Rabbelier <srabbelier@gmail.com> |
Sun, 15 Mar 2009 13:36:14 +0000 | |
changeset 1865 | f00720cddea0 |
parent 1860 | 26ce742dbb63 |
child 1910 | cb105d1f51b8 |
permissions | -rw-r--r-- |
611
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
1 |
#!/usr/bin/python2.5 |
2ec30182e5f1
Move parameter construction into a seperate module
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. |
611
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
4 |
# |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
5 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
6 |
# you may not use this file except in compliance with the License. |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
7 |
# You may obtain a copy of the License at |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
8 |
# |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
9 |
# http://www.apache.org/licenses/LICENSE-2.0 |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
10 |
# |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
11 |
# Unless required by applicable law or agreed to in writing, software |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
12 |
# distributed under the License is distributed on an "AS IS" BASIS, |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
13 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
14 |
# See the License for the specific language governing permissions and |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
15 |
# limitations under the License. |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
16 |
|
639
1f92bd41b914
Some docstring fixes in few modules (soc.views.helper soc.views.models.base).
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
620
diff
changeset
|
17 |
"""Redirect related methods. |
611
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
18 |
""" |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
19 |
|
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
20 |
__authors__ = [ |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
21 |
'"Sverre Rabbelier" <sverre@rabbelier.nl>', |
985
f0b02777f403
Added getListRequestsRedirect to redirects.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
981
diff
changeset
|
22 |
'"Lennard de Rijk" <ljvderijk@gmail.com>', |
611
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
23 |
] |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
24 |
|
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
25 |
|
891
3d40190f35b6
Move getToSLink() to soc.views.helper.redirects.getToSRedirect().
Todd Larsen <tlarsen@google.com>
parents:
885
diff
changeset
|
26 |
from google.appengine.ext import db |
3d40190f35b6
Move getToSLink() to soc.views.helper.redirects.getToSRedirect().
Todd Larsen <tlarsen@google.com>
parents:
885
diff
changeset
|
27 |
|
3d40190f35b6
Move getToSLink() to soc.views.helper.redirects.getToSRedirect().
Todd Larsen <tlarsen@google.com>
parents:
885
diff
changeset
|
28 |
|
1224
72dc2b552b10
Added a new redirect for apply accesstype.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1146
diff
changeset
|
29 |
def getApplyRedirect(entity, params): |
72dc2b552b10
Added a new redirect for apply accesstype.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1146
diff
changeset
|
30 |
"""Returns the apply redirect for the specified entity. |
72dc2b552b10
Added a new redirect for apply accesstype.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1146
diff
changeset
|
31 |
""" |
72dc2b552b10
Added a new redirect for apply accesstype.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1146
diff
changeset
|
32 |
|
72dc2b552b10
Added a new redirect for apply accesstype.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1146
diff
changeset
|
33 |
result ='/%s/apply/%s' % ( |
72dc2b552b10
Added a new redirect for apply accesstype.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1146
diff
changeset
|
34 |
params['url_name'], entity.key().name()) |
72dc2b552b10
Added a new redirect for apply accesstype.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1146
diff
changeset
|
35 |
|
72dc2b552b10
Added a new redirect for apply accesstype.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1146
diff
changeset
|
36 |
return result |
72dc2b552b10
Added a new redirect for apply accesstype.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1146
diff
changeset
|
37 |
|
654
68bafa9f719f
Fixed the 'New Host' link
Sverre Rabbelier <srabbelier@gmail.com>
parents:
652
diff
changeset
|
38 |
def getInviteRedirect(entity, params): |
667
f96095df1433
Some more import sorting fixes and docstring typos in program modules and soc.views.helper.redirects module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
654
diff
changeset
|
39 |
"""Returns the invitation redirect for the specified entity. |
654
68bafa9f719f
Fixed the 'New Host' link
Sverre Rabbelier <srabbelier@gmail.com>
parents:
652
diff
changeset
|
40 |
""" |
68bafa9f719f
Fixed the 'New Host' link
Sverre Rabbelier <srabbelier@gmail.com>
parents:
652
diff
changeset
|
41 |
|
68bafa9f719f
Fixed the 'New Host' link
Sverre Rabbelier <srabbelier@gmail.com>
parents:
652
diff
changeset
|
42 |
result ='/%s/invite/%s' % ( |
698
a953f0676699
Added a public redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
676
diff
changeset
|
43 |
params['url_name'], entity.key().name()) |
654
68bafa9f719f
Fixed the 'New Host' link
Sverre Rabbelier <srabbelier@gmail.com>
parents:
652
diff
changeset
|
44 |
|
68bafa9f719f
Fixed the 'New Host' link
Sverre Rabbelier <srabbelier@gmail.com>
parents:
652
diff
changeset
|
45 |
return result |
68bafa9f719f
Fixed the 'New Host' link
Sverre Rabbelier <srabbelier@gmail.com>
parents:
652
diff
changeset
|
46 |
|
667
f96095df1433
Some more import sorting fixes and docstring typos in program modules and soc.views.helper.redirects module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
654
diff
changeset
|
47 |
|
652
02323664d532
Cleanups in preparation of general selector view
Sverre Rabbelier <srabbelier@gmail.com>
parents:
643
diff
changeset
|
48 |
def getCreateRedirect(entity, params): |
1224
72dc2b552b10
Added a new redirect for apply accesstype.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1146
diff
changeset
|
49 |
"""Returns the create redirect for the specified entity. |
643 | 50 |
""" |
51 |
||
52 |
result ='/%s/create/%s' % ( |
|
698
a953f0676699
Added a public redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
676
diff
changeset
|
53 |
params['url_name'], entity.key().name()) |
643 | 54 |
|
55 |
return result |
|
620
e74e0b74625f
Put the redirects in the views/helper/redirects.py module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
611
diff
changeset
|
56 |
|
667
f96095df1433
Some more import sorting fixes and docstring typos in program modules and soc.views.helper.redirects module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
654
diff
changeset
|
57 |
|
611
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
58 |
def getEditRedirect(entity, params): |
620
e74e0b74625f
Put the redirects in the views/helper/redirects.py module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
611
diff
changeset
|
59 |
"""Returns the edit redirect for the specified entity. |
611
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
60 |
""" |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
61 |
|
698
a953f0676699
Added a public redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
676
diff
changeset
|
62 |
return '/%s/edit/%s' % ( |
a953f0676699
Added a public redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
676
diff
changeset
|
63 |
params['url_name'], entity.key().name()) |
a953f0676699
Added a public redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
676
diff
changeset
|
64 |
|
a953f0676699
Added a public redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
676
diff
changeset
|
65 |
|
a953f0676699
Added a public redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
676
diff
changeset
|
66 |
def getPublicRedirect(entity, params): |
a953f0676699
Added a public redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
676
diff
changeset
|
67 |
"""Returns the public redirect for the specified entity. |
a953f0676699
Added a public redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
676
diff
changeset
|
68 |
""" |
a953f0676699
Added a public redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
676
diff
changeset
|
69 |
|
a953f0676699
Added a public redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
676
diff
changeset
|
70 |
return '/%s/show/%s' % ( |
a953f0676699
Added a public redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
676
diff
changeset
|
71 |
params['url_name'], entity.key().name()) |
885
f46b689e19eb
Changed the redirect in club application overview to the correct page.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
858
diff
changeset
|
72 |
|
f46b689e19eb
Changed the redirect in club application overview to the correct page.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
858
diff
changeset
|
73 |
|
1340
06ffdc68ab1b
Add an admin redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1323
diff
changeset
|
74 |
def getAdminRedirect(entity, params): |
06ffdc68ab1b
Add an admin redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1323
diff
changeset
|
75 |
"""Returns the public redirect for the specified entity. |
06ffdc68ab1b
Add an admin redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1323
diff
changeset
|
76 |
""" |
06ffdc68ab1b
Add an admin redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1323
diff
changeset
|
77 |
|
06ffdc68ab1b
Add an admin redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1323
diff
changeset
|
78 |
return '/%s/admin/%s' % ( |
06ffdc68ab1b
Add an admin redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1323
diff
changeset
|
79 |
params['url_name'], entity.key().name()) |
06ffdc68ab1b
Add an admin redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1323
diff
changeset
|
80 |
|
06ffdc68ab1b
Add an admin redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1323
diff
changeset
|
81 |
|
1323
a666374587df
Add a getListRedirect and getListPublicRedirect function
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1316
diff
changeset
|
82 |
def getListRedirect(entity, params): |
a666374587df
Add a getListRedirect and getListPublicRedirect function
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1316
diff
changeset
|
83 |
"""Returns the public redirect for the specified entity. |
a666374587df
Add a getListRedirect and getListPublicRedirect function
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1316
diff
changeset
|
84 |
""" |
a666374587df
Add a getListRedirect and getListPublicRedirect function
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1316
diff
changeset
|
85 |
|
a666374587df
Add a getListRedirect and getListPublicRedirect function
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1316
diff
changeset
|
86 |
return '/%s/list/%s' % ( |
a666374587df
Add a getListRedirect and getListPublicRedirect function
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1316
diff
changeset
|
87 |
params['url_name'], entity.key().name()) |
a666374587df
Add a getListRedirect and getListPublicRedirect function
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1316
diff
changeset
|
88 |
|
a666374587df
Add a getListRedirect and getListPublicRedirect function
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1316
diff
changeset
|
89 |
|
a666374587df
Add a getListRedirect and getListPublicRedirect function
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1316
diff
changeset
|
90 |
def getPublicListRedirect(entity, params): |
a666374587df
Add a getListRedirect and getListPublicRedirect function
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1316
diff
changeset
|
91 |
"""Returns the public redirect for the specified entity. |
a666374587df
Add a getListRedirect and getListPublicRedirect function
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1316
diff
changeset
|
92 |
""" |
a666374587df
Add a getListRedirect and getListPublicRedirect function
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1316
diff
changeset
|
93 |
|
a666374587df
Add a getListRedirect and getListPublicRedirect function
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1316
diff
changeset
|
94 |
return '/%s/list_public/%s' % ( |
a666374587df
Add a getListRedirect and getListPublicRedirect function
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1316
diff
changeset
|
95 |
params['url_name'], entity.key().name()) |
a666374587df
Add a getListRedirect and getListPublicRedirect function
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1316
diff
changeset
|
96 |
|
a666374587df
Add a getListRedirect and getListPublicRedirect function
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1316
diff
changeset
|
97 |
|
858
e79e7a22326f
Add an export() view, and implement it as text/text for Document.
Todd Larsen <tlarsen@google.com>
parents:
797
diff
changeset
|
98 |
def getExportRedirect(entity, params): |
e79e7a22326f
Add an export() view, and implement it as text/text for Document.
Todd Larsen <tlarsen@google.com>
parents:
797
diff
changeset
|
99 |
"""Returns the export redirect for the specified entity. |
e79e7a22326f
Add an export() view, and implement it as text/text for Document.
Todd Larsen <tlarsen@google.com>
parents:
797
diff
changeset
|
100 |
""" |
e79e7a22326f
Add an export() view, and implement it as text/text for Document.
Todd Larsen <tlarsen@google.com>
parents:
797
diff
changeset
|
101 |
|
e79e7a22326f
Add an export() view, and implement it as text/text for Document.
Todd Larsen <tlarsen@google.com>
parents:
797
diff
changeset
|
102 |
return '/%s/export/%s' % ( |
e79e7a22326f
Add an export() view, and implement it as text/text for Document.
Todd Larsen <tlarsen@google.com>
parents:
797
diff
changeset
|
103 |
params['url_name'], entity.key().name()) |
e79e7a22326f
Add an export() view, and implement it as text/text for Document.
Todd Larsen <tlarsen@google.com>
parents:
797
diff
changeset
|
104 |
|
885
f46b689e19eb
Changed the redirect in club application overview to the correct page.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
858
diff
changeset
|
105 |
|
923
5a10f6db154b
Hook up the 'home' view for site and program
Sverre Rabbelier <srabbelier@gmail.com>
parents:
920
diff
changeset
|
106 |
def getHomeRedirect(entity, params): |
946
db4134853d64
Add missing dots in soc.views.helper.redirects module function docstrings.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
940
diff
changeset
|
107 |
"""Returns the home redirect for the specified entity. |
923
5a10f6db154b
Hook up the 'home' view for site and program
Sverre Rabbelier <srabbelier@gmail.com>
parents:
920
diff
changeset
|
108 |
""" |
5a10f6db154b
Hook up the 'home' view for site and program
Sverre Rabbelier <srabbelier@gmail.com>
parents:
920
diff
changeset
|
109 |
|
5a10f6db154b
Hook up the 'home' view for site and program
Sverre Rabbelier <srabbelier@gmail.com>
parents:
920
diff
changeset
|
110 |
return '/%s/home/%s' % ( |
5a10f6db154b
Hook up the 'home' view for site and program
Sverre Rabbelier <srabbelier@gmail.com>
parents:
920
diff
changeset
|
111 |
params['url_name'], entity.key().name()) |
5a10f6db154b
Hook up the 'home' view for site and program
Sverre Rabbelier <srabbelier@gmail.com>
parents:
920
diff
changeset
|
112 |
|
797
0bc3f950d7cf
Added basic review functionality for club applications.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
698
diff
changeset
|
113 |
def getReviewRedirect(entity, params): |
946
db4134853d64
Add missing dots in soc.views.helper.redirects module function docstrings.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
940
diff
changeset
|
114 |
"""Returns the redirect to review the specified entity. |
797
0bc3f950d7cf
Added basic review functionality for club applications.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
698
diff
changeset
|
115 |
""" |
0bc3f950d7cf
Added basic review functionality for club applications.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
698
diff
changeset
|
116 |
|
0bc3f950d7cf
Added basic review functionality for club applications.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
698
diff
changeset
|
117 |
return '/%s/review/%s' % ( |
1138
18ef39338211
Refactored review and reviewoverview out of club_app.py
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1096
diff
changeset
|
118 |
params['url_name'], entity.key().name()) |
698
a953f0676699
Added a public redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
676
diff
changeset
|
119 |
|
1238
af56ae7397ab
Added scoped group_app listing.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1229
diff
changeset
|
120 |
def getReviewOverviewRedirect(entity, params): |
af56ae7397ab
Added scoped group_app listing.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1229
diff
changeset
|
121 |
"""Returns the redirect to the review_overview using the |
af56ae7397ab
Added scoped group_app listing.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1229
diff
changeset
|
122 |
keyname of the specified entity. |
af56ae7397ab
Added scoped group_app listing.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1229
diff
changeset
|
123 |
""" |
1254
6be0286ef003
Added new redirect for the new list views for group_app's.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1238
diff
changeset
|
124 |
|
1238
af56ae7397ab
Added scoped group_app listing.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1229
diff
changeset
|
125 |
return '/%s/review_overview/%s' % ( |
af56ae7397ab
Added scoped group_app listing.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1229
diff
changeset
|
126 |
params['url_name'], entity.key().name()) |
698
a953f0676699
Added a public redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
676
diff
changeset
|
127 |
|
a953f0676699
Added a public redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
676
diff
changeset
|
128 |
def getCreateRequestRedirect(entity, params): |
a953f0676699
Added a public redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
676
diff
changeset
|
129 |
"""Returns the create request redirect for the specified entity. |
a953f0676699
Added a public redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
676
diff
changeset
|
130 |
""" |
a953f0676699
Added a public redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
676
diff
changeset
|
131 |
|
a953f0676699
Added a public redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
676
diff
changeset
|
132 |
result ='/request/create/%s/%s/%s' % ( |
a953f0676699
Added a public redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
676
diff
changeset
|
133 |
params['group_scope'], params['url_name'], entity.key().name()) |
a953f0676699
Added a public redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
676
diff
changeset
|
134 |
|
a953f0676699
Added a public redirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
676
diff
changeset
|
135 |
return result |
620
e74e0b74625f
Put the redirects in the views/helper/redirects.py module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
611
diff
changeset
|
136 |
|
e74e0b74625f
Put the redirects in the views/helper/redirects.py module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
611
diff
changeset
|
137 |
|
1006
6abf12b9e646
Added a sidebar link for all users that accepted the ToS to a view that allows you to choose a club which you want to become a member for.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1005
diff
changeset
|
138 |
def getRequestRedirectForRole(entity, role_name): |
6abf12b9e646
Added a sidebar link for all users that accepted the ToS to a view that allows you to choose a club which you want to become a member for.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1005
diff
changeset
|
139 |
"""Returns the redirect to create a request for a specific role. |
6abf12b9e646
Added a sidebar link for all users that accepted the ToS to a view that allows you to choose a club which you want to become a member for.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1005
diff
changeset
|
140 |
""" |
6abf12b9e646
Added a sidebar link for all users that accepted the ToS to a view that allows you to choose a club which you want to become a member for.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1005
diff
changeset
|
141 |
|
6abf12b9e646
Added a sidebar link for all users that accepted the ToS to a view that allows you to choose a club which you want to become a member for.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1005
diff
changeset
|
142 |
result ='/%s/request/%s' % ( |
6abf12b9e646
Added a sidebar link for all users that accepted the ToS to a view that allows you to choose a club which you want to become a member for.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1005
diff
changeset
|
143 |
role_name, entity.key().name()) |
6abf12b9e646
Added a sidebar link for all users that accepted the ToS to a view that allows you to choose a club which you want to become a member for.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1005
diff
changeset
|
144 |
|
6abf12b9e646
Added a sidebar link for all users that accepted the ToS to a view that allows you to choose a club which you want to become a member for.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1005
diff
changeset
|
145 |
return result |
6abf12b9e646
Added a sidebar link for all users that accepted the ToS to a view that allows you to choose a club which you want to become a member for.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1005
diff
changeset
|
146 |
|
6abf12b9e646
Added a sidebar link for all users that accepted the ToS to a view that allows you to choose a club which you want to become a member for.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1005
diff
changeset
|
147 |
|
1005
46b3e946a3e1
Changed method name in access.py to fix overwriting another method.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1003
diff
changeset
|
148 |
def getInviteRedirectForRole(entity, role_name): |
1003
b13da1ddcd50
Added sidebar entries for club entities.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
985
diff
changeset
|
149 |
"""Returns the redirect to create an invite for a specific role. |
b13da1ddcd50
Added sidebar entries for club entities.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
985
diff
changeset
|
150 |
""" |
b13da1ddcd50
Added sidebar entries for club entities.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
985
diff
changeset
|
151 |
|
b13da1ddcd50
Added sidebar entries for club entities.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
985
diff
changeset
|
152 |
result ='/%s/invite/%s' % ( |
b13da1ddcd50
Added sidebar entries for club entities.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
985
diff
changeset
|
153 |
role_name, entity.key().name()) |
b13da1ddcd50
Added sidebar entries for club entities.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
985
diff
changeset
|
154 |
|
b13da1ddcd50
Added sidebar entries for club entities.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
985
diff
changeset
|
155 |
return result |
b13da1ddcd50
Added sidebar entries for club entities.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
985
diff
changeset
|
156 |
|
b13da1ddcd50
Added sidebar entries for club entities.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
985
diff
changeset
|
157 |
|
1487
d18c71f4fabe
Added list proposals redirect.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1485
diff
changeset
|
158 |
def getListProposalsRedirect(entity, params): |
d18c71f4fabe
Added list proposals redirect.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1485
diff
changeset
|
159 |
"""Returns the redirect for the List page for the given |
d18c71f4fabe
Added list proposals redirect.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1485
diff
changeset
|
160 |
Org entity and Org View params. |
d18c71f4fabe
Added list proposals redirect.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1485
diff
changeset
|
161 |
""" |
d18c71f4fabe
Added list proposals redirect.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1485
diff
changeset
|
162 |
|
d18c71f4fabe
Added list proposals redirect.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1485
diff
changeset
|
163 |
result = '/%s/list_proposals/%s' % ( |
d18c71f4fabe
Added list proposals redirect.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1485
diff
changeset
|
164 |
params['url_name'], entity.key().name()) |
d18c71f4fabe
Added list proposals redirect.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1485
diff
changeset
|
165 |
|
d18c71f4fabe
Added list proposals redirect.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1485
diff
changeset
|
166 |
return result |
d18c71f4fabe
Added list proposals redirect.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1485
diff
changeset
|
167 |
|
d18c71f4fabe
Added list proposals redirect.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1485
diff
changeset
|
168 |
|
1860
26ce742dbb63
Added an getAcceptedOrgsRedirect to redirects
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1746
diff
changeset
|
169 |
def getAcceptedOrgsRedirect(entity, params): |
26ce742dbb63
Added an getAcceptedOrgsRedirect to redirects
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1746
diff
changeset
|
170 |
"""Returns the redirect for the List of accepted orgs. |
26ce742dbb63
Added an getAcceptedOrgsRedirect to redirects
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1746
diff
changeset
|
171 |
""" |
26ce742dbb63
Added an getAcceptedOrgsRedirect to redirects
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1746
diff
changeset
|
172 |
|
26ce742dbb63
Added an getAcceptedOrgsRedirect to redirects
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1746
diff
changeset
|
173 |
result = '/%s/accepted_orgs/%s' % ( |
26ce742dbb63
Added an getAcceptedOrgsRedirect to redirects
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1746
diff
changeset
|
174 |
params['url_name'], entity.key().name()) |
26ce742dbb63
Added an getAcceptedOrgsRedirect to redirects
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1746
diff
changeset
|
175 |
|
26ce742dbb63
Added an getAcceptedOrgsRedirect to redirects
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1746
diff
changeset
|
176 |
return result |
26ce742dbb63
Added an getAcceptedOrgsRedirect to redirects
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1746
diff
changeset
|
177 |
|
26ce742dbb63
Added an getAcceptedOrgsRedirect to redirects
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1746
diff
changeset
|
178 |
|
985
f0b02777f403
Added getListRequestsRedirect to redirects.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
981
diff
changeset
|
179 |
def getListRequestsRedirect(entity, params): |
f0b02777f403
Added getListRequestsRedirect to redirects.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
981
diff
changeset
|
180 |
"""Returns the redirect for the List Requests paged for the given |
f0b02777f403
Added getListRequestsRedirect to redirects.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
981
diff
changeset
|
181 |
Group entity and Group View params. |
f0b02777f403
Added getListRequestsRedirect to redirects.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
981
diff
changeset
|
182 |
""" |
f0b02777f403
Added getListRequestsRedirect to redirects.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
981
diff
changeset
|
183 |
|
f0b02777f403
Added getListRequestsRedirect to redirects.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
981
diff
changeset
|
184 |
result = '/%s/list_requests/%s' % ( |
f0b02777f403
Added getListRequestsRedirect to redirects.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
981
diff
changeset
|
185 |
params['url_name'], entity.key().name()) |
f0b02777f403
Added getListRequestsRedirect to redirects.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
981
diff
changeset
|
186 |
|
f0b02777f403
Added getListRequestsRedirect to redirects.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
981
diff
changeset
|
187 |
return result |
f0b02777f403
Added getListRequestsRedirect to redirects.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
981
diff
changeset
|
188 |
|
f0b02777f403
Added getListRequestsRedirect to redirects.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
981
diff
changeset
|
189 |
|
1254
6be0286ef003
Added new redirect for the new list views for group_app's.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1238
diff
changeset
|
190 |
def getListSelfRedirect(entity, params): |
6be0286ef003
Added new redirect for the new list views for group_app's.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1238
diff
changeset
|
191 |
"""Returns the redirect for list_self access type. |
6be0286ef003
Added new redirect for the new list views for group_app's.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1238
diff
changeset
|
192 |
""" |
6be0286ef003
Added new redirect for the new list views for group_app's.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1238
diff
changeset
|
193 |
|
6be0286ef003
Added new redirect for the new list views for group_app's.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1238
diff
changeset
|
194 |
result = '/%s/list_self/%s' % ( |
6be0286ef003
Added new redirect for the new list views for group_app's.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1238
diff
changeset
|
195 |
params['url_name'], entity.key().name()) |
6be0286ef003
Added new redirect for the new list views for group_app's.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1238
diff
changeset
|
196 |
|
6be0286ef003
Added new redirect for the new list views for group_app's.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1238
diff
changeset
|
197 |
return result |
6be0286ef003
Added new redirect for the new list views for group_app's.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1238
diff
changeset
|
198 |
|
6be0286ef003
Added new redirect for the new list views for group_app's.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1238
diff
changeset
|
199 |
|
1003
b13da1ddcd50
Added sidebar entries for club entities.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
985
diff
changeset
|
200 |
def getListRolesRedirect(entity, params): |
b13da1ddcd50
Added sidebar entries for club entities.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
985
diff
changeset
|
201 |
"""Returns the redirect for the List Roles paged for the given |
b13da1ddcd50
Added sidebar entries for club entities.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
985
diff
changeset
|
202 |
Group entity and Group View params. |
b13da1ddcd50
Added sidebar entries for club entities.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
985
diff
changeset
|
203 |
""" |
b13da1ddcd50
Added sidebar entries for club entities.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
985
diff
changeset
|
204 |
|
b13da1ddcd50
Added sidebar entries for club entities.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
985
diff
changeset
|
205 |
result = '/%s/list_roles/%s' % ( |
b13da1ddcd50
Added sidebar entries for club entities.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
985
diff
changeset
|
206 |
params['url_name'], entity.key().name()) |
b13da1ddcd50
Added sidebar entries for club entities.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
985
diff
changeset
|
207 |
|
b13da1ddcd50
Added sidebar entries for club entities.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
985
diff
changeset
|
208 |
return result |
b13da1ddcd50
Added sidebar entries for club entities.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
985
diff
changeset
|
209 |
|
b13da1ddcd50
Added sidebar entries for club entities.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
985
diff
changeset
|
210 |
|
1378
8c7f5411d372
Added new redirect to redirects helper.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1340
diff
changeset
|
211 |
def getUserRolesRedirect(_, __): |
8c7f5411d372
Added new redirect to redirects helper.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1340
diff
changeset
|
212 |
"""Returns the redirect to the users Roles page. |
8c7f5411d372
Added new redirect to redirects helper.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1340
diff
changeset
|
213 |
""" |
8c7f5411d372
Added new redirect to redirects helper.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1340
diff
changeset
|
214 |
|
8c7f5411d372
Added new redirect to redirects helper.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1340
diff
changeset
|
215 |
return '/user/roles' |
8c7f5411d372
Added new redirect to redirects helper.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1340
diff
changeset
|
216 |
|
8c7f5411d372
Added new redirect to redirects helper.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1340
diff
changeset
|
217 |
|
981
61a6a8d304dc
Added getProcessRequestRedirect method to redirects.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
946
diff
changeset
|
218 |
def getProcessRequestRedirect(entity, _): |
1032
ed83d42d1ed7
Style fixes in soc.views.helper.redirects and soc.models.base modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
1006
diff
changeset
|
219 |
"""Returns the redirect for processing the specified request entity. |
981
61a6a8d304dc
Added getProcessRequestRedirect method to redirects.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
946
diff
changeset
|
220 |
""" |
61a6a8d304dc
Added getProcessRequestRedirect method to redirects.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
946
diff
changeset
|
221 |
|
61a6a8d304dc
Added getProcessRequestRedirect method to redirects.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
946
diff
changeset
|
222 |
result = '/%s/process_request/%s/%s' % ( |
61a6a8d304dc
Added getProcessRequestRedirect method to redirects.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
946
diff
changeset
|
223 |
entity.role, entity.scope_path, entity.link_id) |
61a6a8d304dc
Added getProcessRequestRedirect method to redirects.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
946
diff
changeset
|
224 |
|
61a6a8d304dc
Added getProcessRequestRedirect method to redirects.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
946
diff
changeset
|
225 |
return result |
61a6a8d304dc
Added getProcessRequestRedirect method to redirects.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
946
diff
changeset
|
226 |
|
61a6a8d304dc
Added getProcessRequestRedirect method to redirects.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
946
diff
changeset
|
227 |
|
1065
b661dc8ffd5f
Added manage redirect.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1032
diff
changeset
|
228 |
def getManageRedirect(entity, params): |
b661dc8ffd5f
Added manage redirect.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1032
diff
changeset
|
229 |
"""Returns the redirect for managing the given entity. |
b661dc8ffd5f
Added manage redirect.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1032
diff
changeset
|
230 |
""" |
b661dc8ffd5f
Added manage redirect.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1032
diff
changeset
|
231 |
|
b661dc8ffd5f
Added manage redirect.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1032
diff
changeset
|
232 |
result = '/%s/manage/%s' % ( |
b661dc8ffd5f
Added manage redirect.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1032
diff
changeset
|
233 |
params['url_name'], entity.key().name()) |
b661dc8ffd5f
Added manage redirect.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1032
diff
changeset
|
234 |
|
b661dc8ffd5f
Added manage redirect.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1032
diff
changeset
|
235 |
return result |
b661dc8ffd5f
Added manage redirect.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1032
diff
changeset
|
236 |
|
b661dc8ffd5f
Added manage redirect.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1032
diff
changeset
|
237 |
|
1229
ec3768cbf369
Refactored the picker so that it is more generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1224
diff
changeset
|
238 |
def getSelectRedirect(params): |
946
db4134853d64
Add missing dots in soc.views.helper.redirects module function docstrings.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
940
diff
changeset
|
239 |
"""Returns the pick redirect for the specified entity. |
932
2b72d0315254
Add redirects for the new pick view
Sverre Rabbelier <srabbelier@gmail.com>
parents:
930
diff
changeset
|
240 |
""" |
2b72d0315254
Add redirects for the new pick view
Sverre Rabbelier <srabbelier@gmail.com>
parents:
930
diff
changeset
|
241 |
|
1229
ec3768cbf369
Refactored the picker so that it is more generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1224
diff
changeset
|
242 |
if params.get('args'): |
ec3768cbf369
Refactored the picker so that it is more generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1224
diff
changeset
|
243 |
return '/%(url_name)s/pick?%(args)s' % params |
932
2b72d0315254
Add redirects for the new pick view
Sverre Rabbelier <srabbelier@gmail.com>
parents:
930
diff
changeset
|
244 |
else: |
1229
ec3768cbf369
Refactored the picker so that it is more generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1224
diff
changeset
|
245 |
return '/%(url_name)s/pick' % params |
932
2b72d0315254
Add redirects for the new pick view
Sverre Rabbelier <srabbelier@gmail.com>
parents:
930
diff
changeset
|
246 |
|
1003
b13da1ddcd50
Added sidebar entries for club entities.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
985
diff
changeset
|
247 |
|
940
a40056afef83
Changed the access checks to comply with state in request.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
932
diff
changeset
|
248 |
def getInviteAcceptedRedirect(entity, _): |
620
e74e0b74625f
Put the redirects in the views/helper/redirects.py module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
611
diff
changeset
|
249 |
"""Returns the redirect for accepting an invite. |
e74e0b74625f
Put the redirects in the views/helper/redirects.py module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
611
diff
changeset
|
250 |
""" |
e74e0b74625f
Put the redirects in the views/helper/redirects.py module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
611
diff
changeset
|
251 |
|
920
39badbfb80be
Added the new way to process invites for club_admin only.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
891
diff
changeset
|
252 |
return '/%s/accept_invite/%s/%s' % ( |
620
e74e0b74625f
Put the redirects in the views/helper/redirects.py module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
611
diff
changeset
|
253 |
entity.role, entity.scope_path, entity.link_id) |
885
f46b689e19eb
Changed the redirect in club application overview to the correct page.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
858
diff
changeset
|
254 |
|
929
7431d7770197
Renamed redirect methods to comply with the rest of the module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
923
diff
changeset
|
255 |
|
7431d7770197
Renamed redirect methods to comply with the rest of the module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
923
diff
changeset
|
256 |
def getInviteProcessRedirect(entity, _): |
930
7e88fba647b1
Added missing changes from r1522.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
929
diff
changeset
|
257 |
"""Returns the redirect for processing an invite. |
920
39badbfb80be
Added the new way to process invites for club_admin only.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
891
diff
changeset
|
258 |
""" |
39badbfb80be
Added the new way to process invites for club_admin only.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
891
diff
changeset
|
259 |
|
39badbfb80be
Added the new way to process invites for club_admin only.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
891
diff
changeset
|
260 |
return '/request/process_invite/%s/%s/%s' % ( |
39badbfb80be
Added the new way to process invites for club_admin only.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
891
diff
changeset
|
261 |
entity.scope_path, entity.role, entity.link_id) |
885
f46b689e19eb
Changed the redirect in club application overview to the correct page.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
858
diff
changeset
|
262 |
|
929
7431d7770197
Renamed redirect methods to comply with the rest of the module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
923
diff
changeset
|
263 |
|
885
f46b689e19eb
Changed the redirect in club application overview to the correct page.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
858
diff
changeset
|
264 |
def getApplicantRedirect(entity, params): |
f46b689e19eb
Changed the redirect in club application overview to the correct page.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
858
diff
changeset
|
265 |
"""Returns the redirect for processing accepted Applications. |
f46b689e19eb
Changed the redirect in club application overview to the correct page.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
858
diff
changeset
|
266 |
""" |
f46b689e19eb
Changed the redirect in club application overview to the correct page.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
858
diff
changeset
|
267 |
|
f46b689e19eb
Changed the redirect in club application overview to the correct page.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
858
diff
changeset
|
268 |
return '/%s/applicant/%s' % ( |
1146
839da7617496
Changed getApplicantRedirect to use the key_name instead of just a link_id.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1138
diff
changeset
|
269 |
params['url_name'], entity.key().name()) |
885
f46b689e19eb
Changed the redirect in club application overview to the correct page.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
858
diff
changeset
|
270 |
|
891
3d40190f35b6
Move getToSLink() to soc.views.helper.redirects.getToSRedirect().
Todd Larsen <tlarsen@google.com>
parents:
885
diff
changeset
|
271 |
|
1485
430df988d395
Added redirect for the student proposal view.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1378
diff
changeset
|
272 |
def getStudentProposalRedirect(entity, params): |
430df988d395
Added redirect for the student proposal view.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1378
diff
changeset
|
273 |
"""Returns the student proposal redirect for the given org and student. |
430df988d395
Added redirect for the student proposal view.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1378
diff
changeset
|
274 |
""" |
430df988d395
Added redirect for the student proposal view.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1378
diff
changeset
|
275 |
|
430df988d395
Added redirect for the student proposal view.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1378
diff
changeset
|
276 |
result ='/%s/apply/%s?organization=%s' % ( |
430df988d395
Added redirect for the student proposal view.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1378
diff
changeset
|
277 |
params['url_name'], params['student_key'], entity.link_id) |
430df988d395
Added redirect for the student proposal view.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1378
diff
changeset
|
278 |
|
430df988d395
Added redirect for the student proposal view.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1378
diff
changeset
|
279 |
return result |
430df988d395
Added redirect for the student proposal view.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1378
diff
changeset
|
280 |
|
430df988d395
Added redirect for the student proposal view.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1378
diff
changeset
|
281 |
|
1746
c99815c27c4d
Add a getSlotsRedirect to redirects.py
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1487
diff
changeset
|
282 |
def getSlotsRedirect(entity, params): |
c99815c27c4d
Add a getSlotsRedirect to redirects.py
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1487
diff
changeset
|
283 |
"""Returns the student proposal redirect for the given org and student. |
c99815c27c4d
Add a getSlotsRedirect to redirects.py
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1487
diff
changeset
|
284 |
""" |
c99815c27c4d
Add a getSlotsRedirect to redirects.py
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1487
diff
changeset
|
285 |
|
c99815c27c4d
Add a getSlotsRedirect to redirects.py
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1487
diff
changeset
|
286 |
return'/%s/slots/%s' % ( |
c99815c27c4d
Add a getSlotsRedirect to redirects.py
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1487
diff
changeset
|
287 |
params['url_name'], entity.key().name()) |
c99815c27c4d
Add a getSlotsRedirect to redirects.py
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1487
diff
changeset
|
288 |
|
c99815c27c4d
Add a getSlotsRedirect to redirects.py
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1487
diff
changeset
|
289 |
|
1096
258af84e2e56
Added a getCreateDocumentRedirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1065
diff
changeset
|
290 |
def getCreateDocumentRedirect(entity, prefix): |
258af84e2e56
Added a getCreateDocumentRedirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1065
diff
changeset
|
291 |
"""Returns the redirect for new documents. |
258af84e2e56
Added a getCreateDocumentRedirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1065
diff
changeset
|
292 |
""" |
258af84e2e56
Added a getCreateDocumentRedirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1065
diff
changeset
|
293 |
|
258af84e2e56
Added a getCreateDocumentRedirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1065
diff
changeset
|
294 |
return '/document/create/%s/%s' % (prefix, entity.key().name()) |
258af84e2e56
Added a getCreateDocumentRedirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1065
diff
changeset
|
295 |
|
258af84e2e56
Added a getCreateDocumentRedirect
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1065
diff
changeset
|
296 |
|
1316
1ddf04976bee
Allow documents to be filtered by prefix and scope
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1308
diff
changeset
|
297 |
def getListDocumentsRedirect(entity, prefix): |
1ddf04976bee
Allow documents to be filtered by prefix and scope
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1308
diff
changeset
|
298 |
"""Returns the redirect for listing documents. |
1ddf04976bee
Allow documents to be filtered by prefix and scope
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1308
diff
changeset
|
299 |
""" |
1ddf04976bee
Allow documents to be filtered by prefix and scope
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1308
diff
changeset
|
300 |
|
1ddf04976bee
Allow documents to be filtered by prefix and scope
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1308
diff
changeset
|
301 |
return '/document/list/%s/%s' % (prefix, entity.key().name()) |
1ddf04976bee
Allow documents to be filtered by prefix and scope
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1308
diff
changeset
|
302 |
|
1ddf04976bee
Allow documents to be filtered by prefix and scope
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1308
diff
changeset
|
303 |
|
891
3d40190f35b6
Move getToSLink() to soc.views.helper.redirects.getToSRedirect().
Todd Larsen <tlarsen@google.com>
parents:
885
diff
changeset
|
304 |
def getToSRedirect(presence): |
3d40190f35b6
Move getToSLink() to soc.views.helper.redirects.getToSRedirect().
Todd Larsen <tlarsen@google.com>
parents:
885
diff
changeset
|
305 |
"""Returns link to 'show' the ToS Document if it exists, None otherwise. |
3d40190f35b6
Move getToSLink() to soc.views.helper.redirects.getToSRedirect().
Todd Larsen <tlarsen@google.com>
parents:
885
diff
changeset
|
306 |
|
3d40190f35b6
Move getToSLink() to soc.views.helper.redirects.getToSRedirect().
Todd Larsen <tlarsen@google.com>
parents:
885
diff
changeset
|
307 |
Args: |
3d40190f35b6
Move getToSLink() to soc.views.helper.redirects.getToSRedirect().
Todd Larsen <tlarsen@google.com>
parents:
885
diff
changeset
|
308 |
presence: Presence entity that may or may not have a tos property |
3d40190f35b6
Move getToSLink() to soc.views.helper.redirects.getToSRedirect().
Todd Larsen <tlarsen@google.com>
parents:
885
diff
changeset
|
309 |
""" |
3d40190f35b6
Move getToSLink() to soc.views.helper.redirects.getToSRedirect().
Todd Larsen <tlarsen@google.com>
parents:
885
diff
changeset
|
310 |
if not presence: |
3d40190f35b6
Move getToSLink() to soc.views.helper.redirects.getToSRedirect().
Todd Larsen <tlarsen@google.com>
parents:
885
diff
changeset
|
311 |
return None |
3d40190f35b6
Move getToSLink() to soc.views.helper.redirects.getToSRedirect().
Todd Larsen <tlarsen@google.com>
parents:
885
diff
changeset
|
312 |
|
3d40190f35b6
Move getToSLink() to soc.views.helper.redirects.getToSRedirect().
Todd Larsen <tlarsen@google.com>
parents:
885
diff
changeset
|
313 |
try: |
3d40190f35b6
Move getToSLink() to soc.views.helper.redirects.getToSRedirect().
Todd Larsen <tlarsen@google.com>
parents:
885
diff
changeset
|
314 |
tos_doc = presence.tos |
3d40190f35b6
Move getToSLink() to soc.views.helper.redirects.getToSRedirect().
Todd Larsen <tlarsen@google.com>
parents:
885
diff
changeset
|
315 |
except db.Error: |
3d40190f35b6
Move getToSLink() to soc.views.helper.redirects.getToSRedirect().
Todd Larsen <tlarsen@google.com>
parents:
885
diff
changeset
|
316 |
return None |
3d40190f35b6
Move getToSLink() to soc.views.helper.redirects.getToSRedirect().
Todd Larsen <tlarsen@google.com>
parents:
885
diff
changeset
|
317 |
|
3d40190f35b6
Move getToSLink() to soc.views.helper.redirects.getToSRedirect().
Todd Larsen <tlarsen@google.com>
parents:
885
diff
changeset
|
318 |
if not tos_doc: |
3d40190f35b6
Move getToSLink() to soc.views.helper.redirects.getToSRedirect().
Todd Larsen <tlarsen@google.com>
parents:
885
diff
changeset
|
319 |
return None |
3d40190f35b6
Move getToSLink() to soc.views.helper.redirects.getToSRedirect().
Todd Larsen <tlarsen@google.com>
parents:
885
diff
changeset
|
320 |
|
3d40190f35b6
Move getToSLink() to soc.views.helper.redirects.getToSRedirect().
Todd Larsen <tlarsen@google.com>
parents:
885
diff
changeset
|
321 |
return getPublicRedirect(tos_doc, {'url_name': 'document'}) |