Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / im / urls.py @ 32ee6f20

History | View | Annotate | Download (7.4 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
from astakos.im.settings import IM_MODULES, INVITATIONS_ENABLED, EMAILCHANGE_ENABLED
41

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

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

    
62
    url(r'^projects/add/?$', 'project_add', {}, name='project_add'),
63
    url(r'^projects/?$', 'project_list', {}, name='project_list'),
64
    url(r'^projects/search/?$', 'project_search', {}, name='project_search'),
65
    url(r'^projects/(?P<chain_id>\d+)/?$', 'project_detail', {}, name='project_detail'),
66
    url(r'^projects/(?P<chain_id>\d+)/join/?$', 'project_join', {}, name='project_join'),
67
    url(r'^projects/(?P<chain_id>\d+)/leave/?$', 'project_leave', {}, name='project_leave'),
68
    url(r'^projects/(?P<chain_id>\d+)/cancel/?$', 'project_cancel', {}, name='project_cancel'),
69
    url(r'^projects/(?P<chain_id>\d+)/(?P<user_id>\d+)/accept/?$', 'project_accept_member', {}, name='project_accept_member'),
70
    url(r'^projects/(?P<chain_id>\d+)/(?P<user_id>\d+)/reject/?$', 'project_reject_member', {}, name='project_reject_member'),
71
    url(r'^projects/(?P<chain_id>\d+)/(?P<user_id>\d+)/remove/?$', 'project_remove_member', {}, name='project_remove_member'),
72
    url(r'^projects/app/(?P<application_id>\d+)/?$', 'project_app', {}, name='project_app'),
73
    url(r'^projects/app/(?P<application_id>\d+)/modify$', 'project_modify', {}, name='project_modify'),
74
    url(r'^projects/app/(?P<application_id>\d+)/approve$', 'project_app_approve', {}, name='project_app_approve'),
75
    url(r'^projects/app/(?P<application_id>\d+)/deny$', 'project_app_deny', {}, name='project_app_deny'),
76
    url(r'^projects/app/(?P<application_id>\d+)/dismiss$', 'project_app_dismiss', {}, name='project_app_dismiss'),
77
    url(r'^projects/app/(?P<application_id>\d+)/cancel$', 'project_app_cancel', {}, name='project_app_cancel'),
78

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

    
83

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

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

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

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

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

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

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

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

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

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