Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / im / urls.py @ 0a7a4104

History | View | Annotate | Download (7.5 kB)

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

    
34
from django.conf.urls.defaults import patterns, url
35

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

    
41
from astakos.im import settings
42

    
43
urlpatterns = patterns(
44
    'astakos.im.views',
45
    url(r'^$', 'index', {}, name='index'),
46
    url(r'^login/?$', 'index', {}, name='login'),
47
    url(r'^landing/?$', 'landing', {}, name='landing'),
48
    url(r'^profile/update_token?$', 'update_token', {}, name='update_token'),
49
    url(r'^profile/?$','edit_profile', {}, name='edit_profile'),
50
    url(r'^api_access/?$', 'api_access', {}, name='api_access'),
51
    url(r'^feedback/?$', 'feedback', {}, name='feedback'),
52
    url(r'^signup/?$', 'signup', {'on_success': 'index', 'extra_context': {'login_form': LoginForm()}}, name='signup'),
53
    url(r'^logout/?$', 'logout', {'template': 'im/login.html', 'extra_context': {'login_form': LoginForm()}}, name='logout'),
54
    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'),
59

    
60
#    url(r'^billing/?$', 'billing', {}, name='billing'),
61
#    url(r'^timeline/?$', 'timeline', {}, name='timeline'),
62

    
63
    url(r'^projects/add/?$', 'project_add', {}, name='project_add'),
64
    url(r'^projects/?$', 'project_list', {}, name='project_list'),
65
    url(r'^projects/search/?$', 'project_search', {}, name='project_search'),
66
    url(r'^projects/(?P<chain_id>\d+)/?$', 'project_detail', {}, name='project_detail'),
67
    url(r'^projects/(?P<chain_id>\d+)/join/?$', 'project_join', {}, name='project_join'),
68
    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
    url(r'^projects/(?P<chain_id>\d+)/(?P<user_id>\d+)/accept/?$', 'project_accept_member', {}, name='project_accept_member'),
71
    url(r'^projects/(?P<chain_id>\d+)/(?P<user_id>\d+)/reject/?$', 'project_reject_member', {}, name='project_reject_member'),
72
    url(r'^projects/(?P<chain_id>\d+)/(?P<user_id>\d+)/remove/?$', 'project_remove_member', {}, name='project_remove_member'),
73
    url(r'^projects/app/(?P<application_id>\d+)/?$', 'project_app', {}, name='project_app'),
74
    url(r'^projects/app/(?P<application_id>\d+)/modify$', 'project_modify', {}, name='project_modify'),
75
    url(r'^projects/app/(?P<application_id>\d+)/approve$', 'project_app_approve', {}, name='project_app_approve'),
76
    url(r'^projects/app/(?P<application_id>\d+)/deny$', 'project_app_deny', {}, name='project_app_deny'),
77
    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'),
79

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

    
84

    
85
if settings.EMAILCHANGE_ENABLED:
86
    urlpatterns += patterns(
87
        '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
    urlpatterns += patterns(
94
        'astakos.im.target',
95
        url(r'^local/?$', 'local.login'),
96
        url(r'^password_change/?$', 'local.password_change', {
97
            'post_change_redirect':'profile',
98
            'password_change_form':ExtendedPasswordChangeForm},
99
            name='password_change'),
100
        url(r'^local/password_reset/done$', 'local.password_reset_done'),
101
        url(r'^local/reset/confirm/done$',
102
            'local.password_reset_confirm_done')
103
    )
104
    urlpatterns += patterns('django.contrib.auth.views',
105
        url(r'^local/password_reset/?$', 'password_reset', {
106
            'email_template_name':'registration/password_email.txt',
107
            'password_reset_form':ExtendedPasswordResetForm,
108
            'post_reset_redirect':'password_reset/done'}),
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
         'password_reset_confirm', {
112
             '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
    urlpatterns += patterns(
119
        'astakos.im.views',
120
        url(r'^invite/?$', 'invite', {}, name='invite'))
121

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

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

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

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

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

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

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