urls.py 7.45 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
from django.conf.urls.defaults import patterns, url
35

36
37
38
39
from astakos.im.forms import (
    ExtendedPasswordResetForm,
    ExtendedPasswordChangeForm,
    ExtendedSetPasswordForm, LoginForm)
40
41

from astakos.im import settings
42

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

root's avatar
root committed
60
#    url(r'^billing/?$', 'billing', {}, name='billing'),
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
61
62
#    url(r'^timeline/?$', 'timeline', {}, name='timeline'),

63
64
65
    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'),
66
67
68
    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'),
69
    url(r'^projects/(?P<chain_id>\d+)/cancel/?$', 'project_cancel', {}, name='project_cancel'),
70
71
72
    url(r'^projects/(?P<chain_id>\d+)/(?P<user_id>\d+)/accept/?$', 'project_accept_member', {}, name='project_accept_member'),
    url(r'^projects/(?P<chain_id>\d+)/(?P<user_id>\d+)/reject/?$', 'project_reject_member', {}, name='project_reject_member'),
    url(r'^projects/(?P<chain_id>\d+)/(?P<user_id>\d+)/remove/?$', 'project_remove_member', {}, name='project_remove_member'),
73
74
    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'),
75
76
77
    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'),
78
    url(r'^projects/app/(?P<application_id>\d+)/cancel$', 'project_app_cancel', {}, name='project_app_cancel'),
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
79

80
    url(r'^projects/how_it_works/?$', 'how_it_works', {}, name='how_it_works'),
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
81
    url(r'^remove_auth_provider/(?P<pk>\d+)?$', 'remove_auth_provider', {}, name='remove_auth_provider'),
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
82
83
84
)


85
if settings.EMAILCHANGE_ENABLED:
86
87
    urlpatterns += patterns(
        'astakos.im.views',
88
        url(r'^email_change/?$', 'change_email', {}, name='email_change'),
89
        url(r'^email_change/confirm/(?P<activation_key>\w+)/?$', 'change_email', {},
90
            name='email_change_confirm'))
91

92
if 'local' in settings.IM_MODULES:
93
94
    urlpatterns += patterns(
        'astakos.im.target',
95
96
97
        url(r'^local/?$', 'local.login'),
        url(r'^password_change/?$', 'local.password_change', {
            'post_change_redirect':'profile',
98
            'password_change_form':ExtendedPasswordChangeForm},
99
100
101
102
            name='password_change'),
        url(r'^local/password_reset/done$', 'local.password_reset_done'),
        url(r'^local/reset/confirm/done$',
            'local.password_reset_confirm_done')
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
103
104
    )
    urlpatterns += patterns('django.contrib.auth.views',
105
106
107
        url(r'^local/password_reset/?$', 'password_reset', {
            'email_template_name':'registration/password_email.txt',
            'password_reset_form':ExtendedPasswordResetForm,
108
            'post_reset_redirect':'password_reset/done'}),
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
109
        url(r'^local/password_reset_done/?$', 'password_reset_done'),
110
        url(r'^local/reset/confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/?$',
111
112
         'password_reset_confirm', {
             'set_password_form':ExtendedSetPasswordForm,
113
             'post_reset_redirect': 'done'}),
114
        url(r'^local/password/reset/complete/?$', 'password_reset_complete')
115
116
    )

117
if settings.INVITATIONS_ENABLED:
118
119
120
    urlpatterns += patterns(
        'astakos.im.views',
        url(r'^invite/?$', 'invite', {}, name='invite'))
121

122
if 'shibboleth' in settings.IM_MODULES:
123
124
    urlpatterns += patterns(
        'astakos.im.target',
125
        url(r'^login/shibboleth/?$', 'shibboleth.login'),
126
127
    )

128
if 'twitter' in settings.IM_MODULES:
129
130
131
132
133
    urlpatterns += patterns(
        'astakos.im.target',
        url(r'^login/twitter/?$', 'twitter.login'),
        url(r'^login/twitter/authenticated/?$',
            'twitter.authenticated'))
134

135
if 'google' in settings.IM_MODULES:
136
137
    urlpatterns += patterns(
        'astakos.im.target',
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
138
        url(r'^login/google/?$', 'google.login'),
139
140
141
        url(r'^login/google/authenticated/?$',
            'google.authenticated'))

142
if 'linkedin' in settings.IM_MODULES:
143
144
145
146
147
148
149
150
151
152
    urlpatterns += patterns(
        'astakos.im.target',
        url(r'^login/linkedin/?$', 'linkedin.login'),
        url(r'^login/linkedin/authenticated/?$',
            'linkedin.authenticated'))

urlpatterns += patterns(
    'astakos.im.api',
    url(r'^get_services/?$', 'get_services'),
    url(r'^get_menu/?$', 'get_menu'))
153

154
155
156
157
urlpatterns += patterns(
    'astakos.im.api',
    url(r'^get_services/?$', 'get_services'),
    url(r'^get_menu/?$', 'get_menu'))
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
158

159
urlpatterns += patterns(
160
161
    'astakos.im.api.user',
    url(r'^authenticate/?$', 'authenticate'))