cc1  v2.1
CC1 source code docs
 All Classes Namespaces Files Functions Variables Pages
user.py
Go to the documentation of this file.
1 # -*- coding: utf-8 -*-
2 # @COPYRIGHT_begin
3 #
4 # Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 # http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18 # @COPYRIGHT_end
19 
20 ##
21 # @package src.wi.urls.user.user
22 #
23 # @author Piotr Wójcik
24 # @date 1.10.2010
25 #
26 
27 from django.conf.urls import patterns, url, include
28 from django.utils.translation import ugettext_lazy as _
29 
30 from wi.utils.decorators import user_permission
31 from wi.utils.views import direct_to_template, simple_generic, get_list_generic, simple_generic_id
32 
33 
34 account_patterns = patterns('wi.views.user.user',
35  url(r'^$', user_permission(direct_to_template), {'template_name': 'account/base.html'}, name='acc_account'),
36  url(r'^account_data/$', user_permission(direct_to_template),
37  {'template_name': 'account/account_data.html'}, name='acc_account_data'),
38 
39  url(r'^account_data/ajax/get_user_data/$', 'acc_ajax_get_user_data', name='acc_ajax_get_user_data'),
40 
41  url(r'^account_data/ajax/edit/$', 'acc_ajax_account_data_edit', name='acc_ajax_account_data_edit'),
42 
43  url(r'^account_quotas/$', user_permission(direct_to_template),
44  {'template_name': 'account/account_quotas.html'}, name='acc_account_quotas'),
45  url(r'^account_data/ajax/get_user_quotas/$', 'acc_ajax_get_user_quotas', name='acc_ajax_get_user_quotas'),
46 
47  url(r'^password_change/$', 'acc_password_change', name='acc_password_change'),
48 
49  url(r'^ajax/charts/$', user_permission(simple_generic),
50  {'template_name': 'account/ajax/charts.html'}, name='acc_ajax_account_charts'),
51  url(r'^ajax/charts_points/$', user_permission(get_list_generic),
52  {'request_url': 'user/user/points_history/'}, name='acc_ajax_charts_points'),
53 )
54 
55 help_patterns = patterns('wi.views.user.user',
56  url(r'^form/$', 'hlp_form', name='hlp_form'),
57  url(r'^issue_error/$', direct_to_template, {'template_name': 'help/issue_error.html'}, name='hlp_issue_error'),
58  url(r'^issue_sent/$', direct_to_template, {'template_name': 'help/issue_sent.html'}, name='hlp_issue_sent'),
59 )
60 
61 main_patterns = patterns('wi.views.user.user',
62  url(r'^remove_message/(?P<id1>\d+)/$', user_permission(simple_generic_id),
63  {'success_msg': (lambda desc: _('Message removed.') % {'desc': desc}),
64  'request_url': 'user/message/delete/',
65  'id_key': 'message_id'},
66  name='remove_message'),
67  url(r'^get_messages/$', 'get_messages', name='get_messages'),
68 )
69 
70 urlpatterns = patterns('',
71  url(r'^account/', include(account_patterns)),
72  url(r'^help/', include(help_patterns)),
73  url(r'^main/', include(main_patterns)),
74  url(r'^change_cm/(?P<cm_id>\d+)/$', 'change_cm', name='change_cm'),
75 )
76