Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / im / messages.py @ ff5edb80

History | View | Annotate | Download (17.9 kB)

1
# Copyright 2011-2014 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
import astakos.im.settings as astakos_settings
36

    
37

    
38
LOGGED_IN_WARNING = 'It seems that you are already logged in.'
39
ACCOUNT_ALREADY_VERIFIED = 'This account is already verified.'
40
ACCOUNT_ALREADY_MODERATED = 'This account is already moderated.'
41
ACCOUNT_ALREADY_ACTIVE = 'This account is already active.'
42
ACCOUNT_REJECTED = 'This account has been rejected.'
43
ACCOUNT_NOT_ACTIVE = 'User account is not active.'
44
ACCOUNT_NOT_MODERATED = 'User account is not moderated.'
45
ACCOUNT_NOT_VERIFIED = 'User account does not have a verified email address.'
46
ACCOUNT_RESEND_ACTIVATION = (
47
    'It seems that a verification email has been sent to you, but you have '
48
    'not followed the email verification link. '
49
    '<a href="%(send_activation_url)s">Resend verification email.</a>')
50
INACTIVE_ACCOUNT_CHANGE_EMAIL = ''.join(
51
    [ACCOUNT_RESEND_ACTIVATION,
52
     ' Or <a href="%(signup_url)s">Send verification to a new email.</a>'])
53

    
54
ACCOUNT_PENDING_ACTIVATION_HELP = (
55
    'A verification email has been sent to the email address you specified '
56
    'during sign up. Please follow the link in this email to proceed. '
57
    'Make sure you check your spam folder, too.')
58

    
59
ACCOUNT_ACTIVATED = 'Congratulations. Your account has' + \
60
    ' been activated. You are now logged in.'
61
ACCOUNT_DEACTIVATED = 'Your account is inactive'
62
PASSWORD_RESET_DONE = (
63
    'An email with details on how to change your password has been sent. '
64
    'Please check your Inbox.')
65
PASSWORD_RESET_CONFIRM_DONE = (
66
    'Your password has changed successfully. You '
67
    'can now login using your new password.')
68
PASSWORD_CHANGED = 'Your new password was set successfully.'
69

    
70
ACCOUNT_RESEND_ACTIVATION = 'Resend verification email'
71
ACCOUNT_USER_ACTIVATION_PENDING = 'You have not followed the verification link'
72

    
73
ACCOUNT_UNKNOWN = 'There is no such account.'
74
TOKEN_UNKNOWN = 'There is no user matching this authentication token.'
75
TOKEN_UPDATED = 'Your authentication token has been updated successfully.'
76

    
77
PROFILE_UPDATED = 'Your profile has been updated successfully.'
78
FEEDBACK_SENT = (
79
    'Thank you for contacting us. We will process your message carefully '
80
    'and get back to you.')
81
EMAIL_CHANGED = 'The email of your account changed successfully.'
82
EMAIL_CHANGE_REGISTERED = (
83
    'Your request for changing your email has been registered successfully. '
84
    'A verification email will be sent to your new address.')
85

    
86
OBJECT_CREATED = 'The %(verbose_name)s was created successfully.'
87
USER_MEMBERSHIP_REJECTED = (
88
    'Request by %s to join the project has been rejected.')
89
BILLING_ERROR = 'Service response status: %(status)d'
90

    
91
GENERIC_ERROR = (
92
    'Hmm... It seems something bad has happened, and we don\'t know the '
93
    'details right now. Please contact the administrators by email for '
94
    'more details.')
95

    
96
MAX_INVITATION_NUMBER_REACHED = (
97
    'You have reached the maximum amount of invitations for your account. '
98
    'No invitations left.')
99
GROUP_MAX_PARTICIPANT_NUMBER_REACHED = (
100
    'This Group reached its maximum number of members. No other member can '
101
    'be added.')
102
PROJECT_MAX_PARTICIPANT_NUMBER_REACHED = (
103
    'This Project reached its maximum number of members. No other member '
104
    'can be added.')
105
NO_APPROVAL_TERMS = 'There are no terms of service to approve.'
106
PENDING_EMAIL_CHANGE_REQUEST = (
107
    'It seems there is already a pending request for an email change. '
108
    'Submitting a new request to change your email will cancel all previous '
109
    'requests.')
110
OBJECT_CREATED_FAILED = 'The %(verbose_name)s creation failed: %(reason)s.'
111
GROUP_JOIN_FAILURE = 'Failed to join this Group.'
112
PROJECT_JOIN_FAILURE = 'Failed to join this Project.'
113
GROUPKIND_UNKNOWN = 'The kind of Project you specified does not exist.'
114
NOT_MEMBER = 'User is not a member of the Project.'
115
NOT_OWNER = 'User is not the Project\'s owner.'
116
OWNER_CANNOT_LEAVE_GROUP = (
117
    'You are the owner of this Project. Owners can not leave their Projects.')
118

    
119
# Field validation fields
120
REQUIRED_FIELD = 'This field is required.'
121
EMAIL_USED = 'There is already an account with this email address.'
122
SHIBBOLETH_EMAIL_USED = (
123
    'This email is already associated with another shibboleth account.')
124
SHIBBOLETH_INACTIVE_ACC = (
125
    'This email is already associated with an account that is not '
126
    'yet activated. '
127
    'If that is your account, you need to activate it before being able to '
128
    'associate it with this shibboleth account.')
129
SHIBBOLETH_MISSING_USER_ID = (
130
    'Your request is missing a unique ' +
131
    'token. This means your academic ' +
132
    'institution does not yet allow its users to log ' +
133
    'into %(domain)s with their academic ' +
134
    'account. Please contact %(contact_email)s' +
135
    ' for more information.')
136
SHIBBOLETH_MISSING_NAME = 'This request is missing the user name.'
137

    
138
SIGN_TERMS = "Please, you need to 'Agree with the terms' before proceeding."
139
CAPTCHA_VALIDATION_ERR = (
140
    "You have not entered the correct words. Please try again."
141
)
142
SUSPENDED_LOCAL_ACC = (
143
    "This account does not have a local password. "
144
    "Please try logging in using an external login provider (e.g.: twitter)"
145
)
146
EMAIL_UNKNOWN = (
147
    "This email address doesn't have an associated user account. "
148
    "Please make sure you have registered, before proceeding."
149
)
150
INVITATION_EMAIL_EXISTS = "An invitation has already been sent to this email."
151
INVITATION_CONSUMED_ERR = "The invitation has already been used."
152
UNKNOWN_USERS = "Unknown users: %s"
153
UNIQUE_EMAIL_IS_ACTIVE_CONSTRAIN_ERR = (
154
    "More than one account with the same email & 'is_active' field. Error."
155
)
156
INVALID_ACTIVATION_KEY = "Invalid or already used activation key."
157
NEW_EMAIL_ADDR_RESERVED = (
158
    "The new email address you requested is already used by another account. "
159
    "Please provide a different one."
160
)
161
EMAIL_RESERVED = "Email: %(email)s is already reserved."
162
NO_LOCAL_AUTH = (
163
    "Only external login providers are enabled for this account. "
164
    "You can not login with a local password."
165
)
166
SWITCH_ACCOUNT_FAILURE = "Account failed to switch. Invalid parameters."
167
SWITCH_ACCOUNT_SUCCESS_WITH_PROVIDER = (
168
    "Account failed to switch to %(provider)s."
169
)
170
SWITCH_ACCOUNT_SUCCESS = (
171
    "Account successfully switched to %(provider)s."
172
)
173

    
174
# Field help text
175
ADD_GROUP_MEMBERS_Q_HELP = (
176
    'Add a comma separated list of user emails, eg. user1@user.com, '
177
    'user2@user.com')
178
ASTAKOSUSER_GROUPS_HELP = (
179
    'In addition to the permissions assigned manually, '
180
    'this user will also get all permissions coming from his/her groups.')
181

    
182
EMAIL_SEND_ERR = 'Failed to send %s.'
183
ADMIN_NOTIFICATION_SEND_ERR = EMAIL_SEND_ERR % 'admin notification'
184
VERIFICATION_SEND_ERR = EMAIL_SEND_ERR % 'verification'
185
INVITATION_SEND_ERR = EMAIL_SEND_ERR % 'invitation'
186
GREETING_SEND_ERR = EMAIL_SEND_ERR % 'greeting'
187
FEEDBACK_SEND_ERR = EMAIL_SEND_ERR % 'feedback'
188
CHANGE_EMAIL_SEND_ERR = EMAIL_SEND_ERR % 'email change'
189
NOTIFICATION_SEND_ERR = EMAIL_SEND_ERR % 'notification'
190
DETAILED_NOTIFICATION_SEND_ERR = (
191
    'Failed to send %(subject)s notification to %(recipients)s.')
192

    
193
MISSING_NEXT_PARAMETER = 'The next parameter is missing.'
194

    
195
INVITATION_SENT = 'Invitation sent to %(email)s.'
196
VERIFICATION_SENT = (
197
    'Your information has been submitted successfully. An email, containing a '
198
    'verification link has been sent to the email address you provided. '
199
    'Please follow the verification link on this email to continue with the '
200
    'registration process.')
201
VERIFICATION_FAILED = 'Email verification process failed.'
202
SWITCH_ACCOUNT_LINK_SENT = (
203
    'This email is already associated with a local account, '
204
    'and a verification email has been sent to %(email)s. To complete '
205
    'the association process, go back to your Inbox and follow the link '
206
    'inside the verification email.')
207
NOTIFICATION_SENT = (
208
    'Your request for an account has been submitted successfully, and is '
209
    'now pending approval. You will be notified by email in the next few '
210
    'days. Thanks for your interest!')
211
ACTIVATION_SENT = (
212
    'An email containing a verification link has been sent to your '
213
    'email address.')
214

    
215
REGISTRATION_COMPLETED = (
216
    'Your registration completed successfully. You can now login to your '
217
    'new account!')
218

    
219
NO_RESPONSE = 'There is no response.'
220
NOT_ALLOWED_NEXT_PARAM = 'Not allowed next parameter.'
221
MISSING_KEY_PARAMETER = 'Missing key parameter.'
222
INVALID_KEY_PARAMETER = 'Invalid key.'
223
DOMAIN_VALUE_ERR = 'Enter a valid domain.'
224
QH_SYNC_ERROR = 'Failed to get synchronized with quotaholder.'
225
UNIQUE_PROJECT_NAME_CONSTRAIN_ERR = (
226
    'The project name (as specified in its application\'s definition) must '
227
    'be unique among all active projects.')
228
NOT_ALIVE_PROJECT = 'Project %s is not alive.'
229
NOT_SUSPENDED_PROJECT = 'Project %s is not suspended.'
230
NOT_TERMINATED_PROJECT = 'Project %s is not terminated.'
231
BASE_NO_TERMINATE = "Cannot terminate: %s is a base project."
232
NOT_ALLOWED = 'You do not have the permissions to perform this action.'
233
MEMBER_NUMBER_LIMIT_REACHED = (
234
    'You have reached the maximum number of members for this Project.')
235
MEMBER_JOIN_POLICY_CLOSED = 'The Project\'s member join policy is closed.'
236
MEMBER_LEAVE_POLICY_CLOSED = 'The project\'s member leave policy is closed.'
237
NOT_MEMBERSHIP_REQUEST = 'This is not a valid membership request.'
238
NOT_ACCEPTED_MEMBERSHIP = 'This is not an accepted membership.'
239
MEMBERSHIP_ACCEPTED = 'Membership already exists.'
240
MEMBERSHIP_ASSOCIATED = 'Request or membership already exists.'
241
NO_APPLICANT = (
242
    'Project application requires at least one applicant. None found.')
243
INVALID_PROJECT_START_DATE = (
244
    'Project start date should be equal or greater than the current date.')
245
INVALID_PROJECT_END_DATE = (
246
    'Project end date should be equal or greater than than the current date.')
247
INCONSISTENT_PROJECT_DATES = (
248
    'Project end date should be greater than the project start date.')
249
ADD_PROJECT_MEMBERS_Q_HELP = (
250
    'Add a comma separated list of user emails, eg. user1@user.com, '
251
    'user2@user.com')
252
ADD_PROJECT_MEMBERS_Q_PLACEHOLDER = 'user1@user.com, user2@user.com'
253
MISSING_IDENTIFIER = 'Missing identifier.'
254
UNKNOWN_USER_ID = 'There is no user identified by %s.'
255
UNKNOWN_PROJECT_APPLICATION_ID = (
256
    'There is no project application identified by %s.')
257
UNKNOWN_PROJECT_ID = 'There is no project identified by %s.'
258
UNKNOWN_IDENTIFIER = 'Unknown identifier.'
259
PENDING_MEMBERSHIP_LEAVE = (
260
    'Your request is pending moderation by the Project owner.')
261
USER_MEMBERSHIP_ACCEPTED = '%s has been accepted in the project.'
262
USER_MEMBERSHIP_REMOVED = '%s has been removed from the project.'
263
USER_LEFT_PROJECT = 'You have left the project.'
264
USER_LEAVE_REQUEST_SUBMITTED = (
265
    'Your request to leave the project has been submitted successfully.')
266
USER_JOIN_REQUEST_SUBMITTED = (
267
    'Your request to join the project has been submitted successfully.')
268
USER_JOINED_PROJECT = 'You have joined the project.'
269
USER_REQUEST_CANCELLED = 'Your request to join the project has been cancelled.'
270
APPLICATION_CANNOT_APPROVE = "Cannot approve application %s in state '%s'"
271
APPLICATION_CANNOT_DENY = "Cannot deny application %s in state '%s'"
272
APPLICATION_CANNOT_DISMISS = "Cannot dismiss application %s in state '%s'"
273
APPLICATION_CANNOT_CANCEL = "Cannot cancel application %s in state '%s'"
274
APPLICATION_CANCELLED = "Your project application has been cancelled."
275
APPLICATION_APPROVED = "Project application has been approved."
276
APPLICATION_DENIED = "Project application has been denied."
277
APPLICATION_DISMISSED = "Project application has been dismissed."
278
REACHED_PENDING_APPLICATION_LIMIT = ("You have reached the maximum number "
279
                                     "of pending project applications: %s.")
280
UNINITIALIZED_NO_MODIFY = "Cannot modify: project %s is not initialized."
281
BASE_NO_MODIFY_FIELDS = "Cannot modify field(s) '%s' of base projects."
282

    
283
PENDING_APPLICATION_LIMIT_ADD = \
284
    ("You are not allowed to create a new project "
285
     "because you have reached the maximum [%s] for "
286
     "pending project applications. "
287
     "Consider cancelling any unnecessary ones.")
288

    
289
PENDING_APPLICATION_LIMIT_MODIFY = \
290
    ("You are not allowed to modify this project "
291
     "because you have reached the maximum [%s] for "
292
     "pending project applications. "
293
     "Consider cancelling any unnecessary ones.")
294

    
295
# Auth providers messages
296
AUTH_PROVIDER_LOGIN_SUCCESS = "Logged in successfully, using {method_prompt}."
297
AUTH_PROVIDER_LOGOUT_SUCCESS = "Logged out successfully from {service_name}."
298
AUTH_PROVIDER_LOGOUT_SUCCESS_EXTRA = (
299
    "You may still be logged in at {title} though. "
300
    "Consider logging out from there too.")
301
AUTH_PROVIDER_NOT_ACTIVE = "'{method_prompt}' is disabled."
302
AUTH_PROVIDER_ADD_DISABLED = "{method_prompt} is disabled for your account."
303
AUTH_PROVIDER_NOT_ACTIVE_FOR_USER = "You cannot login using '{method_prompt}'."
304
AUTH_PROVIDER_NOT_ACTIVE_FOR_CREATE = (
305
    "Sign up using '{method_prompt}' is disabled.")
306
AUTH_PROVIDER_NOT_ACTIVE_FOR_ADD = "You cannot add {method_prompt}."
307
AUTH_PROVIDER_ADDED = "{method_prompt} enabled for this account."
308
AUTH_PROVIDER_SWITCHED = "{method_prompt} changed for this account."
309
AUTH_PROVIDER_REMOVED = "{method_prompt} removed for this account."
310
AUTH_PROVIDER_ADD_FAILED = "Failed to add {method_prompt}."
311
AUTH_PROVIDER_ADD_EXISTS = (
312
    "It seems that this '{method_prompt}' is already in use by "
313
    "another account.")
314
AUTH_PROVIDER_LOGIN_TO_ADD = (
315
    "The new login method will be assigned once you login to your account.")
316
AUTH_PROVIDER_INVALID_LOGIN = "No account exists."
317
AUTH_PROVIDER_REQUIRED = (
318
    "{method_prompt} is required. Add one from your profile page.")
319
AUTH_PROVIDER_CANNOT_CHANGE_PASSWORD = "Changing password is not supported."
320
AUTH_PROVIDER_SIGNUP_FROM_LOGIN = None
321
AUTH_PROVIDER_UNUSABLE_PASSWORD = (
322
    '{method_prompt} is not enabled'
323
    ' for your account. You can access your account by logging in with'
324
    ' {available_methods_links}.')
325
AUTH_PROVIDER_LOGIN_DISABLED = AUTH_PROVIDER_UNUSABLE_PASSWORD
326
AUTH_PROVIDER_SIGNUP_FROM_LOGIN = ''
327
AUTH_PROVIDER_AUTHENTICATION_FAILED = (
328
    'Authentication with this account failed.')
329

    
330

    
331
AUTH_PROVIDER_PENDING_REGISTRATION = '''A pending registration exists for
332
{title} account {username}. The email used for the registration is
333
{user_email}. If you decide to procceed with the signup process once again,
334
all pending registrations will be deleted.'''
335

    
336
AUTH_PROVIDER_PENDING_RESEND_ACTIVATION = (
337
    '<a href="{resend_activation_url}">Click here to resend the verification '
338
    'email.</a>')
339
AUTH_PROVIDER_PENDING_MODERATION = (
340
    'Your account request is pending moderation.')
341
AUTH_PROVIDER_PENDING_ACTIVATION = (
342
    'Your account request is pending email verification.')
343
AUTH_PROVIDER_ACCOUNT_INACTIVE = 'Your account is disabled.'
344

    
345
AUTH_PROVIDER_ADD_TO_EXISTING_ACCOUNT = (
346
    "You can add {method_prompt} to your existing account from your "
347
    " <a href='{profile_url}'>profile page</a>")
348

    
349
# Email subjects
350
_SITENAME = astakos_settings.SITENAME
351
INVITATION_EMAIL_SUBJECT = 'Invitation to %s' % _SITENAME
352
GREETING_EMAIL_SUBJECT = 'Welcome to %s' % _SITENAME
353
FEEDBACK_EMAIL_SUBJECT = 'Feedback from %s' % _SITENAME
354
VERIFICATION_EMAIL_SUBJECT = '%s account verification' % _SITENAME
355
ACCOUNT_CREATION_SUBJECT = '%s account created (%%(user)s)' % _SITENAME
356
HELPDESK_NOTIFICATION_EMAIL_SUBJECT = \
357
    '%s account activated (%%(user)s)' % _SITENAME
358
EMAIL_CHANGE_EMAIL_SUBJECT = 'Email change on %s ' % _SITENAME
359
PASSWORD_RESET_EMAIL_SUBJECT = 'Password reset on %s ' % _SITENAME
360
PROJECT_CREATION_SUBJECT = \
361
    '%s project application created (%%(name)s)' % _SITENAME
362
PROJECT_APPROVED_SUBJECT = \
363
    '%s project application approved (%%(name)s)' % _SITENAME
364
PROJECT_DENIED_SUBJECT = \
365
    '%s project application denied (%%(name)s)' % _SITENAME
366
PROJECT_TERMINATION_SUBJECT = \
367
    '%s project terminated (%%(name)s)' % _SITENAME
368
PROJECT_SUSPENSION_SUBJECT = \
369
    '%s project suspended (%%(name)s)' % _SITENAME
370
PROJECT_UNSUSPENSION_SUBJECT = \
371
    '%s project resumed (%%(name)s)' % _SITENAME
372
PROJECT_REINSTATEMENT_SUBJECT = \
373
    '%s project reinstated (%%(name)s)' % _SITENAME
374
PROJECT_MEMBERSHIP_CHANGE_SUBJECT = \
375
    '%s project membership changed (%%(name)s)' % _SITENAME
376
PROJECT_MEMBERSHIP_ENROLL_SUBJECT = \
377
    '%s project enrollment (%%(name)s)' % _SITENAME
378
PROJECT_MEMBERSHIP_REQUEST_SUBJECT = \
379
    '%s project membership request (%%(name)s)' % _SITENAME
380
PROJECT_MEMBERSHIP_LEAVE_REQUEST_SUBJECT = \
381
    '%s project membership leave request (%%(name)s)' % _SITENAME
382

    
383

    
384
messages = locals().keys()
385
for msg in messages:
386
    if msg == msg.upper():
387
        attr = "ASTAKOS_%s_MESSAGE" % msg
388
        settings_value = getattr(settings, attr, None)
389
        if settings_value:
390
            locals()[msg] = settings_value