]> git.openstreetmap.org Git - osqa.git/blob - osqa/forum/const.py
b44ed04221455a8543fd714efaf8888e3c256080
[osqa.git] / osqa / forum / const.py
1 # encoding:utf-8
2 from django.utils.translation import ugettext as _
3 """
4 All constants could be used in other modules
5 For reasons that models, views can't have unicode text in this project, all unicode text go here.
6 """
7 CLOSE_REASONS = (
8     (1, _('duplicate question')),
9     (2, _('question is off-topic or not relevant')),
10     (3, _('too subjective and argumentative')),
11     (4, _('is not an answer to the question')),
12     (5, _('the question is answered, right answer was accepted')),
13     (6, _('problem is not reproducible or outdated')),
14     (7, _('question contains offensive inappropriate, or malicious remarks')),
15     (8, _('spam or advertising')),
16 )
17
18 TYPE_REPUTATION_GAIN_BY_UPVOTED = 1
19 TYPE_REPUTATION_GAIN_BY_ANSWER_ACCEPTED = 2
20 TYPE_REPUTATION_GAIN_BY_ACCEPTING_ANSWER = 3
21 TYPE_REPUTATION_GAIN_BY_DOWNVOTE_CANCELED = 4
22 TYPE_REPUTATION_GAIN_BY_CANCELING_DOWNVOTE = 5
23 TYPE_REPUTATION_LOST_BY_CANCELLING_ACCEPTED_ANSWER = -1
24 TYPE_REPUTATION_LOST_BY_ACCEPTED_ANSWER_CANCELED = -2
25 TYPE_REPUTATION_LOST_BY_DOWNVOTED = -3
26 TYPE_REPUTATION_LOST_BY_FLAGGED = -4
27 TYPE_REPUTATION_LOST_BY_DOWNVOTING = -5
28 TYPE_REPUTATION_LOST_BY_FLAGGED_3_TIMES = -6
29 TYPE_REPUTATION_LOST_BY_FLAGGED_5_TIMES = -7
30 TYPE_REPUTATION_LOST_BY_UPVOTE_CANCELED = -8
31
32 TYPE_REPUTATION = (
33     (TYPE_REPUTATION_GAIN_BY_UPVOTED, 'gain_by_upvoted'),
34     (TYPE_REPUTATION_GAIN_BY_ANSWER_ACCEPTED, 'gain_by_answer_accepted'),
35     (TYPE_REPUTATION_GAIN_BY_ACCEPTING_ANSWER, 'gain_by_accepting_answer'),
36     (TYPE_REPUTATION_GAIN_BY_DOWNVOTE_CANCELED, 'gain_by_downvote_canceled'),
37     (TYPE_REPUTATION_GAIN_BY_CANCELING_DOWNVOTE, 'gain_by_canceling_downvote'),
38     (TYPE_REPUTATION_LOST_BY_CANCELLING_ACCEPTED_ANSWER, 'lose_by_canceling_accepted_answer'),
39     (TYPE_REPUTATION_LOST_BY_ACCEPTED_ANSWER_CANCELED, 'lose_by_accepted_answer_cancled'),
40     (TYPE_REPUTATION_LOST_BY_DOWNVOTED, 'lose_by_downvoted'),
41     (TYPE_REPUTATION_LOST_BY_FLAGGED, 'lose_by_flagged'),
42     (TYPE_REPUTATION_LOST_BY_DOWNVOTING, 'lose_by_downvoting'),
43     (TYPE_REPUTATION_LOST_BY_FLAGGED_3_TIMES, 'lose_by_flagged_lastrevision_3_times'),
44     (TYPE_REPUTATION_LOST_BY_FLAGGED_5_TIMES, 'lose_by_flagged_lastrevision_5_times'),
45     (TYPE_REPUTATION_LOST_BY_UPVOTE_CANCELED, 'lose_by_upvote_canceled'),
46 )
47
48 TYPE_ACTIVITY_ASK_QUESTION=1
49 TYPE_ACTIVITY_ANSWER=2
50 TYPE_ACTIVITY_COMMENT_QUESTION=3
51 TYPE_ACTIVITY_COMMENT_ANSWER=4
52 TYPE_ACTIVITY_UPDATE_QUESTION=5
53 TYPE_ACTIVITY_UPDATE_ANSWER=6
54 TYPE_ACTIVITY_PRIZE=7
55 TYPE_ACTIVITY_MARK_ANSWER=8
56 TYPE_ACTIVITY_VOTE_UP=9
57 TYPE_ACTIVITY_VOTE_DOWN=10
58 TYPE_ACTIVITY_CANCEL_VOTE_UP=11
59 TYPE_ACTIVITY_CANCEL_VOTE_DOWN=19
60 TYPE_ACTIVITY_DELETE_QUESTION=12
61 TYPE_ACTIVITY_DELETE_ANSWER=13
62 TYPE_ACTIVITY_MARK_OFFENSIVE=14
63 TYPE_ACTIVITY_UPDATE_TAGS=15
64 TYPE_ACTIVITY_FAVORITE=16
65 TYPE_ACTIVITY_USER_FULL_UPDATED = 17
66 TYPE_ACTIVITY_QUESTION_EMAIL_UPDATE_SENT = 18
67 #TYPE_ACTIVITY_EDIT_QUESTION=17
68 #TYPE_ACTIVITY_EDIT_ANSWER=18
69
70 TYPE_ACTIVITY = (
71     (TYPE_ACTIVITY_ASK_QUESTION, _('question')),
72     (TYPE_ACTIVITY_ANSWER, _('answer')),
73     (TYPE_ACTIVITY_COMMENT_QUESTION, _('commented question')),
74     (TYPE_ACTIVITY_COMMENT_ANSWER, _('commented answer')),
75     (TYPE_ACTIVITY_UPDATE_QUESTION, _('edited question')),
76     (TYPE_ACTIVITY_UPDATE_ANSWER, _('edited answer')),
77     (TYPE_ACTIVITY_PRIZE, _('received award')),
78     (TYPE_ACTIVITY_MARK_ANSWER, _('marked best answer')),
79     (TYPE_ACTIVITY_VOTE_UP, _('upvoted')),
80     (TYPE_ACTIVITY_VOTE_DOWN, _('downvoted')),
81     (TYPE_ACTIVITY_CANCEL_VOTE_UP, _('upvote canceled')),
82     (TYPE_ACTIVITY_CANCEL_VOTE_DOWN, _('downvote canceled')),
83     (TYPE_ACTIVITY_DELETE_QUESTION, _('deleted question')),
84     (TYPE_ACTIVITY_DELETE_ANSWER, _('deleted answer')),
85     (TYPE_ACTIVITY_MARK_OFFENSIVE, _('marked offensive')),
86     (TYPE_ACTIVITY_UPDATE_TAGS, _('updated tags')),
87     (TYPE_ACTIVITY_FAVORITE, _('selected favorite')),
88     (TYPE_ACTIVITY_USER_FULL_UPDATED, _('completed user profile')),
89     (TYPE_ACTIVITY_QUESTION_EMAIL_UPDATE_SENT, _('email update sent to user')),
90 )
91
92 TYPE_RESPONSE = {
93     'QUESTION_ANSWERED' : _('question_answered'),
94     'QUESTION_COMMENTED': _('question_commented'),
95     'ANSWER_COMMENTED'  : _('answer_commented'),
96     'ANSWER_ACCEPTED'   : _('answer_accepted'),
97 }
98
99 CONST = {
100     'closed'            : _('[closed]'),
101         'deleted'           : _('[deleted]'),
102     'default_version'   : _('initial version'),
103     'retagged'          : _('retagged'),
104 }
105
106 BRONZE_BADGE = 3
107 SILVER_BADGE = 2
108 GOLD_BADGE = 1
109
110 NOTIFICATION_CHOICES = (
111     ('i', _('Instantly')),
112     ('d', _('Daily')),
113     ('w', _('Weekly')),
114     ('n', _('No notifications')),
115 )