Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / im / messages.py @ 764d99c4

History | View | Annotate | Download (18.2 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 import settings
35

    
36
ACCOUNT_ALREADY_ACTIVE                  =   'This account is already active.'
37
ACCOUNT_NOT_ACTIVE                      =   'User account is not active.'
38
ACCOUNT_RESEND_ACTIVATION               =   'It seems that an activation email has been sent to you, but you have not followed the activation link. <a href="%(send_activation_url)s">Resend activation email.</a>'
39
INACTIVE_ACCOUNT_CHANGE_EMAIL           =   ''.join([ACCOUNT_RESEND_ACTIVATION, ' Or <a href="%(signup_url)s">Send activation to a new email.</a>'])
40

    
41
ACCOUNT_PENDING_ACTIVATION_HELP         =   'An activation email has been sent to you. Make sure you check your spam folder, too.'
42

    
43
ACCOUNT_ACTIVATED                       =   'Congratulations. Your account has' + \
44
                                            ' been activated. You are now logged in.'
45
PASSWORD_RESET_DONE                     =   'An email with details on how to change your password has been sent. Please check your Inbox.'
46
PASSWORD_RESET_CONFIRM_DONE             =   'Your password has changed successfully. You can now login using your new password.'
47
PASSWORD_CHANGED                        =   'Your new password was set successfully.'
48

    
49
ACCOUNT_RESEND_ACTIVATION               =   'Resend activation email'
50
ACCOUNT_USER_ACTIVATION_PENDING         =   'You have not followed the activation link'
51

    
52
ACCOUNT_UNKNOWN                         =   'There is no such account.'
53
TOKEN_UNKNOWN                           =   'There is no user matching this authentication token.'
54
TOKEN_UPDATED                           =   'Your authentication token has been updated successfully.'
55

    
56
PROFILE_UPDATED                         =   'Your profile has been updated successfully.'
57
FEEDBACK_SENT                           =   'Thank you for contacting us. We will process your message carefully and get back to you.'
58
EMAIL_CHANGED                           =   'The email of your account changed successfully.'
59
EMAIL_CHANGE_REGISTERED                 =   'Your request for changing your email has been registered successfully. \
60
                                               A verification email will be sent to your new address.'
61

    
62
OBJECT_CREATED                          =   'The %(verbose_name)s was created successfully.'
63
USER_MEMBERSHIP_REJECTED                =   'Request by %s to join the project has been rejected.'
64
BILLING_ERROR                           =   'Service response status: %(status)d'
65

    
66
GENERIC_ERROR                           =   'Hmm... It seems something bad has happened, and we don\'t know the details right now. \
67
                                               Please contact the administrators by email for more details.'
68

    
69
MAX_INVITATION_NUMBER_REACHED   =           'You have reached the maximum amount of invitations for your account. No invitations left.'
70
GROUP_MAX_PARTICIPANT_NUMBER_REACHED    =   'This Group reached its maximum number of members. No other member can be added.'
71
PROJECT_MAX_PARTICIPANT_NUMBER_REACHED  =   'This Project reached its maximum number of members. No other member can be added.'
72
NO_APPROVAL_TERMS                       =   'There are no terms of service to approve.'
73
PENDING_EMAIL_CHANGE_REQUEST            =   'It seems there is already a pending request for an email change. ' + \
74
                                            'Submitting a new request to change your email will cancel all previous requests.'
75
OBJECT_CREATED_FAILED                   =   'The %(verbose_name)s creation failed: %(reason)s.'
76
GROUP_JOIN_FAILURE                      =   'Failed to join this Group.'
77
PROJECT_JOIN_FAILURE                    =   'Failed to join this Project.'
78
GROUPKIND_UNKNOWN                       =   'The kind of Project you specified does not exist.'
79
NOT_MEMBER                              =   'User is not a member of the Project.'
80
NOT_OWNER                               =   'User is not the Project\'s owner.'
81
OWNER_CANNOT_LEAVE_GROUP                =   'You are the owner of this Project. Owners can not leave their Projects.'
82

    
83
# Field validation fields
84
REQUIRED_FIELD                          =   'This field is required.'
85
EMAIL_USED                              =   'There is already an account with this email address.'
86
SHIBBOLETH_EMAIL_USED                   =   'This email is already associated with another shibboleth account.'
87
SHIBBOLETH_INACTIVE_ACC                 =   'This email is already associated with an account that is not yet activated. \
88
                                               If that is your account, you need to activate it before being able to \
89
                                               associate it with this shibboleth account.'
90
SHIBBOLETH_MISSING_EPPN                 =   'Your request is missing a unique ' + \
91
                                            'token. This means your academic ' + \
92
                                            'institution does not yet allow its users to log ' + \
93
                                            'into %(domain)s with their academic ' + \
94
                                            'account. Please contact %(contact_email)s' + \
95
                                            ' for more information.'
96
SHIBBOLETH_MISSING_NAME                 =   'This request is missing the user name.'
97

    
98
SIGN_TERMS                              =   'Please, you need to \'Agree with the terms\' before proceeding.'
99
CAPTCHA_VALIDATION_ERR                  =   'You have not entered the correct words. Please try again.'
100
SUSPENDED_LOCAL_ACC                     =   'This account does not have a local password. \
101
                                               Please try logging in using an external login provider (e.g.: twitter)'
102
EMAIL_UNKNOWN                           =   'This email address doesn\'t have an associated user account. \
103
                                               Please make sure you have registered, before proceeding.'
104
INVITATION_EMAIL_EXISTS                 =   'An invitation has already been sent to this email.'
105
INVITATION_CONSUMED_ERR                 =   'Invitation is used.'
106
UNKNOWN_USERS                           =   'Unknown users: %s'
107
UNIQUE_EMAIL_IS_ACTIVE_CONSTRAIN_ERR    =   'More than one account with the same email & \'is_active\' field. Error.'
108
INVALID_ACTIVATION_KEY                  =   'Invalid activation key.'
109
NEW_EMAIL_ADDR_RESERVED                 =   'The new email address you requested is already used by another account. Please provide a different one.'
110
EMAIL_RESERVED                          =   'Email: %(email)s is already reserved.'
111
NO_LOCAL_AUTH                           =   'Only external login providers are enabled for this acccount. You can not login with a local password.'
112
SWITCH_ACCOUNT_FAILURE                  =   'Account failed to switch. Invalid parameters.'
113
SWITCH_ACCOUNT_SUCCESS_WITH_PROVIDER    =   'Account failed to switch to %(provider)s.'
114
SWITCH_ACCOUNT_SUCCESS                  =   'Account successfully switched to %(provider)s.'
115

    
116
# Field help text
117
ADD_GROUP_MEMBERS_Q_HELP                =   'Add a comma separated list of user emails, eg. user1@user.com, user2@user.com'
118
ASTAKOSUSER_GROUPS_HELP                 =   'In addition to the permissions assigned manually, \
119
                                               this user will also get all permissions coming from his/her groups.'
120

    
121
EMAIL_SEND_ERR                          =   'Failed to send %s.'
122
ADMIN_NOTIFICATION_SEND_ERR             =   EMAIL_SEND_ERR % 'admin notification'
123
VERIFICATION_SEND_ERR                   =   EMAIL_SEND_ERR % 'verification'
124
INVITATION_SEND_ERR                     =   EMAIL_SEND_ERR % 'invitation'
125
GREETING_SEND_ERR                       =   EMAIL_SEND_ERR % 'greeting'
126
FEEDBACK_SEND_ERR                       =   EMAIL_SEND_ERR % 'feedback'
127
CHANGE_EMAIL_SEND_ERR                   =   EMAIL_SEND_ERR % 'email change'
128
NOTIFICATION_SEND_ERR                   =   EMAIL_SEND_ERR % 'notification'
129
DETAILED_NOTIFICATION_SEND_ERR          =   'Failed to send %(subject)s notification to %(recipients)s.'
130

    
131
MISSING_NEXT_PARAMETER                  =   'The next parameter is missing.'
132

    
133
INVITATION_SENT                         =   'Invitation sent to %(email)s.'
134
VERIFICATION_SENT                       =   'Your information has been submitted successfully. A verification email, with an activation link \
135
                                               has been sent to the email address you provided. Please follow the activation link on this \
136
                                               email to complete the registration process.'
137
SWITCH_ACCOUNT_LINK_SENT                =   'This email is already associated with a local account, and a verification email has been sent \
138
                                             to %(email)s. To complete the association process, go back to your Inbox and follow the link \
139
                                             inside the verification email.'
140
NOTIFICATION_SENT                       =   'Your request for an account has been submitted successfully, and is now pending approval. \
141
                                               You will be notified by email in the next few days. \
142
                                               Thanks for your interest in ~okeanos! The GRNET team.'
143
ACTIVATION_SENT                         =   'An email containing your activation link has been sent to your email address.'
144

    
145
REGISTRATION_COMPLETED                  =   'Your registration completed successfully. You can now login to your new account!'
146

    
147
NO_RESPONSE                             =   'There is no response.'
148
NOT_ALLOWED_NEXT_PARAM                  =   'Not allowed next parameter.'
149
MISSING_KEY_PARAMETER                   =   'Missing key parameter.'
150
INVALID_KEY_PARAMETER                   =   'Invalid key.'
151
DOMAIN_VALUE_ERR                        =   'Enter a valid domain.'
152
QH_SYNC_ERROR                           =   'Failed to get synchronized with quotaholder.'
153
UNIQUE_PROJECT_NAME_CONSTRAIN_ERR       =   'The project name (as specified in its application\'s definition) must be unique among all active projects.'
154
INVALID_PROJECT                         =   'Project %(id)s is invalid.'
155
NOT_ALIVE_PROJECT                       =   'Project %(id)s is not alive.'
156
NOT_SUSPENDED_PROJECT                   =   'Project %(id)s is not suspended.'
157
NOT_ALLOWED                             =   'You do not have the permissions to perform this action.'
158
MEMBER_NUMBER_LIMIT_REACHED             =   'You have reached the maximum number of members for this Project.'
159
MEMBER_JOIN_POLICY_CLOSED               =   'The Project\'s member join policy is closed.'
160
MEMBER_LEAVE_POLICY_CLOSED              =   'The project\'s member leave policy is closed.'
161
NOT_MEMBERSHIP_REQUEST                  =   'This is not a valid membership request.'
162
NOT_ACCEPTED_MEMBERSHIP                 =   'This is not an accepted membership.'
163
MEMBERSHIP_REQUEST_EXISTS               =   'The membership request already exists.'
164
NO_APPLICANT                            =   'Project application requires at least one applicant. None found.'
165
INVALID_PROJECT_START_DATE              =   'Project start date should be equal or greater than the current date.'
166
INVALID_PROJECT_END_DATE                =   'Project end date should be equal or greater than than the current date.'
167
INCONSISTENT_PROJECT_DATES              =   'Project end date should be greater than the project start date.'
168
ADD_PROJECT_MEMBERS_Q_HELP              =   'Add a comma separated list of user emails, eg. user1@user.com, user2@user.com'
169
MISSING_IDENTIFIER                      =   'Missing identifier.'
170
UNKNOWN_USER_ID                         =   'There is no user identified by %s.'
171
UNKNOWN_PROJECT_APPLICATION_ID          =   'There is no project application identified by %s.'
172
UNKNOWN_PROJECT_ID                      =   'There is no project identified by %s.'
173
UNKNOWN_IDENTIFIER                      =   'Unknown identifier.'
174
PENDING_MEMBERSHIP_LEAVE                =   'Your request is pending moderation by the Project owner.'
175
USER_MEMBERSHIP_ACCEPTED                =   '%s has been accepted in the project.'
176
USER_MEMBERSHIP_REMOVED                 =   '%s has been removed from the project.'
177
USER_LEFT_PROJECT                       =   'You have left the project.'
178
USER_LEAVE_REQUEST_SUBMITTED            =   'Your request to leave the project has been submitted successfully.'
179
USER_JOIN_REQUEST_SUBMITTED             =   'Your request to join the project has been submitted successfully.'
180
USER_JOINED_PROJECT                     =   'You have joined the project.'
181
USER_REQUEST_CANCELLED                  =   'Your request to join the project has been cancelled.'
182
APPLICATION_CANNOT_APPROVE              =   "Cannot approve application %s in state '%s'"
183
APPLICATION_CANNOT_DENY                 =   "Cannot deny application %s in state '%s'"
184
APPLICATION_CANNOT_DISMISS              =   "Cannot dismiss application %s in state '%s'"
185
APPLICATION_CANNOT_CANCEL               =   "Cannot cancel application %s in state '%s'"
186
APPLICATION_CANCELLED                   =   "Your project application has been cancelled."
187

    
188
REACHED_PENDING_APPLICATION_LIMIT = ("You have reached the maximum number "
189
                                     "of pending project applications: %s.")
190

    
191
PENDING_APPLICATION_LIMIT_ADD = \
192
    ("You are not allowed to create a new project "
193
     "because you have reached the maximum [%s] for "
194
     "pending project applications. "
195
     "Consider cancelling any unnecessary ones.")
196

    
197
PENDING_APPLICATION_LIMIT_MODIFY = \
198
    ("You are not allowed to modify this project "
199
     "because you have reached the maximum [%s] for "
200
     "pending project applications. "
201
     "Consider cancelling any unnecessary ones.")
202

    
203
# Auth providers messages
204
AUTH_PROVIDER_LOGIN_SUCCESS                  =   "Logged in successfully, using {method_prompt}."
205
AUTH_PROVIDER_LOGOUT_SUCCESS                 =   "Logged out successfully."
206
AUTH_PROVIDER_LOGOUT_SUCCESS_EXTRA           =   "You may still be logged in at {title} though. Consider logging out from there too."
207
AUTH_PROVIDER_NOT_ACTIVE                     =   "'{method_prompt}' is disabled."
208
AUTH_PROVIDER_ADD_DISABLED                   =   "{method_prompt} is disabled for your account."
209
AUTH_PROVIDER_NOT_ACTIVE_FOR_USER            =   "You cannot login using '{method_prompt}'."
210
AUTH_PROVIDER_NOT_ACTIVE_FOR_CREATE          =   "Sign up using '{method_prompt}' is disabled."
211
AUTH_PROVIDER_NOT_ACTIVE_FOR_ADD             =   "You cannot add {method_prompt}."
212
AUTH_PROVIDER_ADDED                          =   "{method_prompt} enabled for this account."
213
AUTH_PROVIDER_SWITCHED                       =   "{method_prompt} changed for this account."
214
AUTH_PROVIDER_REMOVED                        =   "{method_prompt} removed for this account."
215
AUTH_PROVIDER_ADD_FAILED                     =   "Failed to add {method_prompt}."
216
AUTH_PROVIDER_ADD_EXISTS                     =   "It seems that this account is already assigned to another user."
217
AUTH_PROVIDER_LOGIN_TO_ADD                   =   "The new login method will be assigned once you login to your account."
218
AUTH_PROVIDER_INVALID_LOGIN                  =   "No account exists."
219
AUTH_PROVIDER_REQUIRED                       =   "{method_prompt} is required. Add one from your profile page."
220
AUTH_PROVIDER_CANNOT_CHANGE_PASSWORD         =   "Changing password is not supported."
221
AUTH_PROVIDER_SIGNUP_FROM_LOGIN              =   None
222
AUTH_PROVIDER_UNUSABLE_PASSWORD              =   '{method_prompt} is not enabled' \
223
                                                 ' for your account. You can access your account by logging in with' \
224
                                                 ' {available_methods_links}.'
225
AUTH_PROVIDER_LOGIN_DISABLED                 =   AUTH_PROVIDER_UNUSABLE_PASSWORD
226
AUTH_PROVIDER_SIGNUP_FROM_LOGIN              =   ''
227
AUTH_PROVIDER_AUTHENTICATION_FAILED          =   'Authentication with this account failed.'
228

    
229

    
230
AUTH_PROVIDER_PENDING_REGISTRATION =  '''A pending registration exists for
231
{title} account {username}. The email used for the registration is
232
{user_email}. If you decide to procceed with the signup process once again,
233
all pending registrations will be deleted.'''
234

    
235
AUTH_PROVIDER_PENDING_RESEND_ACTIVATION      =   '<a href="{resend_activation_url}">Click here to resend activation email.</a>'
236
AUTH_PROVIDER_PENDING_MODERATION             =   'Your account request is pending moderation.'
237
AUTH_PROVIDER_PENDING_ACTIVATION             =   'Your account request is pending activation.'
238
AUTH_PROVIDER_ACCOUNT_INACTIVE                        =   'Your account is disabled.'
239

    
240
AUTH_PROVIDER_ADD_TO_EXISTING_ACCOUNT        =   "You can add {method_prompt} to your existing account from your " \
241
                                                 " <a href='{profile_url}'>profile page</a>"
242

    
243
messages = locals().keys()
244
for msg in messages:
245
    if msg == msg.upper():
246
        attr = "ASTAKOS_%s_MESSAGE" % msg
247
        settings_value = getattr(settings, attr, None)
248
        if settings_value:
249
            locals()[msg] = settings_value