|
4 | 4 | For reasons that models, views can't have unicode
|
5 | 5 | text in this project, all unicode text go here.
|
6 | 6 | """
|
7 |
| -from django.utils.translation import ugettext_lazy as _ |
8 | 7 | import os
|
9 | 8 | import re
|
| 9 | +from django.utils.translation import ugettext_lazy as _ |
10 | 10 | from askbot import get_install_directory
|
| 11 | +#an exception import * because that file has only strings |
| 12 | +from askbot.const.message_keys import * #pylint: disable=wildcard-import |
11 | 13 |
|
12 | 14 | DEFAULT_USER_DATA_EXPORT_DIR = os.path.abspath(
|
13 |
| - os.path.join(get_install_directory(), |
14 |
| - '..', |
15 |
| - 'user_data') |
16 |
| - ) |
| 15 | + os.path.join(get_install_directory(), '..', 'user_data')) |
17 | 16 |
|
18 | 17 | #todo: customize words
|
19 | 18 | CLOSE_REASONS = (
|
|
116 | 115 | REPLY_SEPARATOR_REGEX = re.compile(r'==== .* -=-==', re.MULTILINE|re.DOTALL)
|
117 | 116 |
|
118 | 117 | ANSWER_SORT_METHODS = (
|
119 |
| - ('latest' , _('latest first')), |
| 118 | + ('latest', _('latest first')), |
120 | 119 | ('oldest', _('oldest first')),
|
121 | 120 | ('votes', _('most voted first')),
|
122 | 121 | )
|
|
313 | 312 | TYPE_ACTIVITY_UPDATE_ANSWER,
|
314 | 313 | TYPE_ACTIVITY_UPDATE_QUESTION,
|
315 | 314 | TYPE_ACTIVITY_POST_SHARED,
|
316 |
| -# TYPE_ACTIVITY_PRIZE, |
317 |
| -# TYPE_ACTIVITY_MARK_ANSWER, |
318 |
| -# TYPE_ACTIVITY_VOTE_UP, |
319 |
| -# TYPE_ACTIVITY_VOTE_DOWN, |
320 |
| -# TYPE_ACTIVITY_CANCEL_VOTE, |
321 |
| -# TYPE_ACTIVITY_DELETE_QUESTION, |
322 |
| -# TYPE_ACTIVITY_DELETE_ANSWER, |
323 |
| -# TYPE_ACTIVITY_MARK_OFFENSIVE, |
324 |
| -# TYPE_ACTIVITY_FAVORITE, |
| 315 | + # TYPE_ACTIVITY_PRIZE, |
| 316 | + # TYPE_ACTIVITY_MARK_ANSWER, |
| 317 | + # TYPE_ACTIVITY_VOTE_UP, |
| 318 | + # TYPE_ACTIVITY_VOTE_DOWN, |
| 319 | + # TYPE_ACTIVITY_CANCEL_VOTE, |
| 320 | + # TYPE_ACTIVITY_DELETE_QUESTION, |
| 321 | + # TYPE_ACTIVITY_DELETE_ANSWER, |
| 322 | + # TYPE_ACTIVITY_MARK_OFFENSIVE, |
| 323 | + # TYPE_ACTIVITY_FAVORITE, |
325 | 324 | )
|
326 | 325 |
|
327 | 326 | RESPONSE_ACTIVITY_TYPE_MAP_FOR_TEMPLATES = {
|
|
467 | 466 | )
|
468 | 467 |
|
469 | 468 | NOTIFICATION_DELIVERY_SCHEDULE_CHOICES = (
|
470 |
| - ('i',_('instantly')), |
471 |
| - ('d',_('daily')), |
472 |
| - ('w',_('weekly')), |
473 |
| - ('n',_('never')), |
474 |
| - ) |
| 469 | + ('i', _('instantly')), |
| 470 | + ('d', _('daily')), |
| 471 | + ('w', _('weekly')), |
| 472 | + ('n', _('never')), |
| 473 | +) |
| 474 | + |
| 475 | +NOTIFICATION_DELIVERY_SCHEDULE_CHOICES_Q_NOANS = ( |
| 476 | + ('d', _('daily')), |
| 477 | + ('w', _('weekly')), |
| 478 | + ('n', _('never')), |
| 479 | +) |
475 | 480 |
|
476 | 481 | USERNAME_REGEX_STRING = r'^[\w \-.@+\']+$'
|
477 | 482 |
|
478 |
| -GRAVATAR_TYPE_CHOICES = ( |
479 |
| - ('identicon',_('identicon')), |
480 |
| - ('monsterid',_('monsterid')), |
481 |
| - ('wavatar',_('wavatar')), |
482 |
| - ('retro',_('retro')), |
483 |
| - ('mm',_('mystery-man')), |
484 |
| - ) |
| 483 | +GRAVATAR_TYPE_CHOICES = (('identicon', _('identicon')), |
| 484 | + ('monsterid', _('monsterid')), |
| 485 | + ('wavatar', _('wavatar')), |
| 486 | + ('retro', _('retro')), |
| 487 | + ('mm', _('mystery-man'))) |
485 | 488 |
|
486 | 489 | AVATAR_TYPE_CHOICES_FOR_NEW_USERS = (
|
487 | 490 | ('n', _('Default avatar')),
|
488 | 491 | ('g', _('Gravatar')),#only if user has real uploaded gravatar
|
489 | 492 | )
|
490 | 493 |
|
491 | 494 | AVATAR_TYPE_CHOICES = AVATAR_TYPE_CHOICES_FOR_NEW_USERS + (
|
492 |
| - #avatar uploaded locally - with django-avatar app |
493 |
| - ('a', _('Uploaded Avatar')), |
494 |
| - ) |
| 495 | + #avatar uploaded locally - with django-avatar app |
| 496 | + ('a', _('Uploaded Avatar')), |
| 497 | +) |
495 | 498 |
|
496 | 499 | #chars that can go before or after @mention
|
497 | 500 | TWITTER_STYLE_MENTION_TERMINATION_CHARS = '\n ;:,.!?<>"\''
|
|
500 | 503 |
|
501 | 504 | #user status ch
|
502 | 505 | USER_STATUS_CHOICES = (
|
503 |
| - ('d', _('administrator')), #admin = moderator + access to settings |
504 |
| - ('m', _('moderator')), #user with moderation privilege |
505 |
| - ('a', _('approved')), #regular user |
506 |
| - ('w', _('watched')), #regular user placed on the moderation watch |
507 |
| - ('s', _('suspended')), #suspended user who cannot post new stuff |
508 |
| - ('b', _('blocked')), #blocked |
| 506 | + ('d', _('administrator')), #admin = moderator + access to settings |
| 507 | + ('m', _('moderator')), #user with moderation privilege |
| 508 | + ('a', _('approved')), #regular user |
| 509 | + ('w', _('watched')), #regular user placed on the moderation watch |
| 510 | + ('s', _('suspended')), #suspended user who cannot post new stuff |
| 511 | + ('b', _('blocked')), #blocked |
509 | 512 | )
|
510 | 513 | DEFAULT_USER_STATUS = 'w'
|
511 | 514 |
|
|
539 | 542 | GOLD_BADGE = 1
|
540 | 543 | SILVER_BADGE = 2
|
541 | 544 | BRONZE_BADGE = 3
|
542 |
| -BADGE_TYPE_CHOICES = ( |
543 |
| - (GOLD_BADGE, _('gold')), |
544 |
| - (SILVER_BADGE, _('silver')), |
545 |
| - (BRONZE_BADGE, _('bronze')), |
546 |
| -) |
| 545 | +BADGE_TYPE_CHOICES = ((GOLD_BADGE, _('gold')), |
| 546 | + (SILVER_BADGE, _('silver')), |
| 547 | + (BRONZE_BADGE, _('bronze'))) |
| 548 | + |
547 | 549 | BADGE_CSS_CLASSES = {
|
548 | 550 | GOLD_BADGE: 'badge1',
|
549 | 551 | SILVER_BADGE: 'badge2',
|
|
553 | 555 |
|
554 | 556 | MIN_REPUTATION = 1
|
555 | 557 |
|
556 |
| -SEARCH_ORDER_BY = ( |
557 |
| - ('-added_at', _('date descendant')), |
558 |
| - ('added_at', _('date ascendant')), |
559 |
| - ('-last_activity_at', _('most recently active')), |
560 |
| - ('last_activity_at', _('least recently active')), |
561 |
| - ('-answer_count', _('more responses')), |
562 |
| - ('answer_count', _('fewer responses')), |
563 |
| - ('-points', _('more votes')), |
564 |
| - ('points', _('less votes')), |
565 |
| - ) |
| 558 | +SEARCH_ORDER_BY = (('-added_at', _('date descendant')), |
| 559 | + ('added_at', _('date ascendant')), |
| 560 | + ('-last_activity_at', _('most recently active')), |
| 561 | + ('last_activity_at', _('least recently active')), |
| 562 | + ('-answer_count', _('more responses')), |
| 563 | + ('answer_count', _('fewer responses')), |
| 564 | + ('-points', _('more votes')), |
| 565 | + ('points', _('less votes'))) |
566 | 566 |
|
567 | 567 | DEFAULT_QUESTION_WIDGET_STYLE = """
|
568 | 568 | @import url('http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:300,400,700');
|
|
594 | 594 | font-size: 15px;
|
595 | 595 | }
|
596 | 596 | """
|
597 |
| - |
598 |
| -#an exception import * because that file has only strings |
599 |
| -from askbot.const.message_keys import * |
0 commit comments