urls.py 8.28 KB
Newer Older
Antony Chazapis's avatar
Antony Chazapis committed
1
# Copyright 2011-2012 GRNET S.A. All rights reserved.
2
#
3
4
5
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
6
#
7
8
9
#   1. Redistributions of source code must retain the above
#      copyright notice, this list of conditions and the following
#      disclaimer.
10
#
11
12
13
14
#   2. Redistributions in binary form must reproduce the above
#      copyright notice, this list of conditions and the following
#      disclaimer in the documentation and/or other materials
#      provided with the distribution.
15
#
16
17
18
19
20
21
22
23
24
25
26
27
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
28
#
29
30
31
32
33
# The views and conclusions contained in the software and
# documentation are those of the authors and should not be
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.

34
35
36
37
38
try:
    from django.conf.urls import patterns, url
except ImportError:  # Django==1.2
    from django.conf.urls.defaults import patterns, url

39

40
41
42
43
from astakos.im.forms import (
    ExtendedPasswordResetForm,
    ExtendedPasswordChangeForm,
    ExtendedSetPasswordForm, LoginForm)
44
45

from astakos.im import settings
46

47
48
urlpatterns = patterns(
    'astakos.im.views',
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
49
    url(r'^$', 'index', {}, name='index'),
50
    url(r'^login/?$', 'login', {}, name='login'),
51
    url(r'^landing/?$', 'landing', {}, name='landing'),
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
52
    url(r'^profile/update_token?$', 'update_token', {}, name='update_token'),
53
    url(r'^profile/?$','edit_profile', {}, name='edit_profile'),
54
    url(r'^api_access/?$','api_access', {}, name='api_access'),
55
    url(r'^\.kamakirc/?$','api_access_config', {}, name='api_access_config'),
56
    url(r'^feedback/?$', 'feedback', {}, name='feedback'),
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
57
    url(r'^signup/?$', 'signup', {'on_success': 'index', 'extra_context': {'login_form': LoginForm()}}, name='signup'),
58
59
    url(r'^logout/?$', 'logout', {'template': 'im/login.html', 'extra_context': {'login_form': LoginForm()}}, name='logout'),
    url(r'^activate/?$', 'activate', {}, name='activate'),
60
    url(r'^approval_terms/?$', 'approval_terms', {}, name='latest_terms'),
61
    url(r'^approval_terms/(?P<term_id>\d+)/?$', 'approval_terms'),
62
    url(r'^send/activation/(?P<user_id>\d+)/?$', 'send_activation', {}, name='send_activation'),
63
    url(r'^resources/?$', 'resource_usage', {}, name='resource_usage'),
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
64

root's avatar
root committed
65
#    url(r'^billing/?$', 'billing', {}, name='billing'),
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
66
67
#    url(r'^timeline/?$', 'timeline', {}, name='timeline'),

68
69
70
    url(r'^projects/add/?$', 'project_add', {}, name='project_add'),
    url(r'^projects/?$', 'project_list', {}, name='project_list'),
    url(r'^projects/search/?$', 'project_search', {}, name='project_search'),
71
72
73
    url(r'^projects/(?P<chain_id>\d+)/?$', 'project_detail', {}, name='project_detail'),
    url(r'^projects/(?P<chain_id>\d+)/join/?$', 'project_join', {}, name='project_join'),
    url(r'^projects/(?P<chain_id>\d+)/leave/?$', 'project_leave', {}, name='project_leave'),
74
    url(r'^projects/(?P<chain_id>\d+)/cancel/?$', 'project_cancel', {}, name='project_cancel'),
75
76
    url(r'^projects/(?P<chain_id>\d+)/members/?$', 'project_members', {}, name='project_members'),
    url(r'^projects/(?P<chain_id>\d+)/members/approved/?$', 'project_members', {'members_status_filter':1}, name='project_approved_members'),
77
78
    url(r'^projects/(?P<chain_id>\d+)/members/accept/?$',
        'project_members_action', {'action':'accept'},
79
80
81
82
83
84
85
        name='project_members_accept'),
    url(r'^projects/(?P<chain_id>\d+)/members/remove/?$',
        'project_members_action', {'action':'remove'},
        name='project_members_remove'),
    url(r'^projects/(?P<chain_id>\d+)/members/reject/?$',
        'project_members_action', {'action':'reject'},
        name='project_members_reject'),
86
    url(r'^projects/(?P<chain_id>\d+)/members/pending/?$', 'project_members', {'members_status_filter':0}, name='project_pending_members'),
87
88
89
    url(r'^projects/(?P<chain_id>\d+)/(?P<memb_id>\d+)/accept/?$', 'project_accept_member', {}, name='project_accept_member'),
    url(r'^projects/(?P<chain_id>\d+)/(?P<memb_id>\d+)/reject/?$', 'project_reject_member', {}, name='project_reject_member'),
    url(r'^projects/(?P<chain_id>\d+)/(?P<memb_id>\d+)/remove/?$', 'project_remove_member', {}, name='project_remove_member'),
90
91
    url(r'^projects/app/(?P<application_id>\d+)/?$', 'project_app', {}, name='project_app'),
    url(r'^projects/app/(?P<application_id>\d+)/modify$', 'project_modify', {}, name='project_modify'),
92
93
94
    url(r'^projects/app/(?P<application_id>\d+)/approve$', 'project_app_approve', {}, name='project_app_approve'),
    url(r'^projects/app/(?P<application_id>\d+)/deny$', 'project_app_deny', {}, name='project_app_deny'),
    url(r'^projects/app/(?P<application_id>\d+)/dismiss$', 'project_app_dismiss', {}, name='project_app_dismiss'),
95
    url(r'^projects/app/(?P<application_id>\d+)/cancel$', 'project_app_cancel', {}, name='project_app_cancel'),
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
96

97
    url(r'^projects/how_it_works/?$', 'how_it_works', {}, name='how_it_works'),
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
98
    url(r'^remove_auth_provider/(?P<pk>\d+)?$', 'remove_auth_provider', {}, name='remove_auth_provider'),
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
99
100
101
)


102
if settings.EMAILCHANGE_ENABLED:
103
104
    urlpatterns += patterns(
        'astakos.im.views',
105
        url(r'^email_change/?$', 'change_email', {}, name='email_change'),
106
        url(r'^email_change/confirm/(?P<activation_key>\w+)/?$', 'change_email', {},
107
            name='email_change_confirm'))
108

109
if 'local' in settings.IM_MODULES:
110
    urlpatterns += patterns(
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
111
        'astakos.im.views.target.local',
112
        url(r'^local/?$', 'login', name='local_login'),
113
        url(r'^password_change/?$', 'password_change', {
114
            'post_change_redirect':'profile',
115
            'password_change_form':ExtendedPasswordChangeForm},
116
            name='password_change'),
117
        url(r'^local/password_reset/done$', 'password_reset_done'),
118
        url(r'^local/reset/confirm/done$',
119
            'password_reset_confirm_done'),
120
121
122
        url(r'^local/password_reset/?$', 'password_reset', {
            'email_template_name':'registration/password_email.txt',
            'password_reset_form':ExtendedPasswordResetForm,
123
            'post_reset_redirect':'password_reset/done'}),
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
124
        url(r'^local/password_reset_done/?$', 'password_reset_done'),
125
        url(r'^local/reset/confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/?$',
126
127
         'password_reset_confirm', {
             'set_password_form':ExtendedSetPasswordForm,
128
             'post_reset_redirect': 'done'}),
129
        url(r'^local/password/reset/complete/?$', 'password_reset_complete')
130
131
    )

132
if settings.INVITATIONS_ENABLED:
133
134
135
    urlpatterns += patterns(
        'astakos.im.views',
        url(r'^invite/?$', 'invite', {}, name='invite'))
136

137
if 'shibboleth' in settings.IM_MODULES:
138
    urlpatterns += patterns(
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
139
        'astakos.im.views.target',
140
        url(r'^login/shibboleth/?$', 'shibboleth.login'),
141
142
    )

143
if 'twitter' in settings.IM_MODULES:
144
    urlpatterns += patterns(
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
145
        'astakos.im.views.target',
146
147
148
        url(r'^login/twitter/?$', 'twitter.login'),
        url(r'^login/twitter/authenticated/?$',
            'twitter.authenticated'))
149

150
if 'google' in settings.IM_MODULES:
151
    urlpatterns += patterns(
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
152
        'astakos.im.views.target',
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
153
        url(r'^login/google/?$', 'google.login'),
154
155
156
        url(r'^login/google/authenticated/?$',
            'google.authenticated'))

157
if 'linkedin' in settings.IM_MODULES:
158
    urlpatterns += patterns(
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
159
        'astakos.im.views.target',
160
161
162
163
164
        url(r'^login/linkedin/?$', 'linkedin.login'),
        url(r'^login/linkedin/authenticated/?$',
            'linkedin.authenticated'))

urlpatterns += patterns(
165
    'astakos.im.views',
166
167
    url(r'^get_menu/?$', 'get_menu'),
    url(r'^get_services/?$', 'get_services'))
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
168

169
urlpatterns += patterns(
170
    'astakos.api.user',
171
    url(r'^authenticate/?$', 'authenticate'))