Exemplo n.º 1
0
from base import Setting, SettingSet
from django.forms.widgets import Textarea, Select
from django.utils.translation import ugettext_lazy as _

from static import RENDER_CHOICES

SIDEBAR_SET = SettingSet('sidebar', 'Sidebar content', "Enter contents to display in the sidebar. You can use markdown and some basic html tags.", 10, True)

SHOW_WELCOME_BOX = Setting('SHOW_WELCOME_BOX', True, SIDEBAR_SET, dict(
label = _("Show the Welcome box"),
help_text = _("Do you want to show the welcome box when a user first visits your site."),
required=False))

SHOW_INTERESTING_TAGS_BOX = Setting('SHOW_INTERESTING_TAGS_BOX', True, SIDEBAR_SET, dict(
label = _("Show interesting tags in the sidebar"),
help_text = _("Check this if you want to see the interesting tags container in the sidebar."),
required=False))

APP_INTRO = Setting('APP_INTRO', u'<p>Ask and answer questions, make the world better!</p>', SIDEBAR_SET, dict(
label = _("Application intro"),
help_text = _("The introductory page that is visible in the sidebar for anonymous users."),
widget=Textarea))

QUESTION_TITLE_TIPS = Setting('QUESTION_TITLE_TIPS',
u"""
 - **ask a question relevant to the |APP_TITLE| community**
 - the title must be in the form of a question
 - provide enough details
 - be clear and concise
"""
, SIDEBAR_SET, dict(
Exemplo n.º 2
0
from base import Setting, SettingSet
from django.utils.translation import ugettext_lazy as _

REP_GAIN_SET = SettingSet(
    'repgain', _('Reputation gains and losses config'),
    _("Configure the reputation points a user may gain or lose upon certain actions."
      ), 200)

INITIAL_REP = Setting(
    'INITIAL_REP', 1, REP_GAIN_SET,
    dict(label=_("Initial reputation"),
         help_text=_(
             "The initial reputation an user gets when he first signs in.")))

MAX_REP_BY_UPVOTE_DAY = Setting(
    'MAX_REP_BY_UPVOTE_DAY', 200, REP_GAIN_SET,
    dict(label="Max rep by up votes / day",
         help_text=_(
             "Maximum reputation a user can gain in one day for being upvoted."
         )))

REP_GAIN_BY_UPVOTED = Setting(
    'REP_GAIN_BY_UPVOTED', 10, REP_GAIN_SET,
    dict(label=_("Rep gain by upvoted"),
         help_text=_(
             "Reputation a user gains for having one of his posts up voted.")))

REP_LOST_BY_DOWNVOTED = Setting(
    'REP_LOST_BY_DOWNVOTED', 2, REP_GAIN_SET,
    dict(label=_("Rep lost by downvoted"),
         help_text=_(
Exemplo n.º 3
0
import os.path

from base import Setting, SettingSet
from forms import ImageFormWidget

from django.utils.translation import ugettext_lazy as _
from django.forms.widgets import Textarea

BASIC_SET = SettingSet('basic', _('Basic settings'),
                       _("The basic settings for your application"), 1)

APP_LOGO = Setting(
    'APP_LOGO', '/upfiles/logo.png', BASIC_SET,
    dict(label=_("Application logo"),
         help_text=_("Your site main logo."),
         widget=ImageFormWidget))

APP_FAVICON = Setting(
    'APP_FAVICON', '/m/default/media/images/favicon.ico', BASIC_SET,
    dict(label=_("Favicon"),
         help_text=_("Your site favicon."),
         widget=ImageFormWidget))

APP_TITLE = Setting(
    'APP_TITLE', u'OSQA: Open Source Q&A Forum', BASIC_SET,
    dict(
        label=_("Application title"),
        help_text=
        _("The title of your application that will show in the browsers title bar"
          )))
Exemplo n.º 4
0
import os.path
from base import Setting, SettingSet
from django.utils.translation import ugettext_lazy as _

UPLOAD_SET = SettingSet('paths', _('File upload settings'),
                        _("File uploads related settings."), 600)

UPFILES_FOLDER = Setting(
    'UPFILES_FOLDER',
    os.path.join(os.path.dirname(os.path.dirname(__file__)), 'upfiles'),
    UPLOAD_SET,
    dict(
        label=_("Uploaded files folder"),
        help_text=
        _("The filesystem path where uploaded files will be stored. Please note that this folder must exist."
          )))

UPFILES_ALIAS = Setting(
    'UPFILES_ALIAS', '/upfiles/', UPLOAD_SET,
    dict(
        label=_("Uploaded files alias"),
        help_text=
        _("The url alias for uploaded files. Notice that if you change this setting, you'll need to restart your site."
          )))

ALLOW_MAX_FILE_SIZE = Setting(
    'ALLOW_MAX_FILE_SIZE', 2.5, UPLOAD_SET,
    dict(label=_("Max file size"),
         help_text=_("The maximum allowed file size for uploads in mb.")))
Exemplo n.º 5
0
from base import Setting, SettingSet
from django.utils.translation import ugettext_lazy as _
from django.forms.widgets import PasswordInput
from django.forms.widgets import RadioSelect
from forms import TestEmailSettingsWidget

EMAIL_SET = SettingSet('email', _('Email settings'),
                       _("Email server and other email related settings."), 50)

TEST_EMAIL_SETTINGS = Setting(
    'TEST_EMAIL_SETTINGS', '', EMAIL_SET,
    dict(label=_("E-Mail settings test"),
         help_text=_("Test the current E-Mail configuration."),
         required=False,
         widget=TestEmailSettingsWidget))

EMAIL_HOST = Setting(
    'EMAIL_HOST', '', EMAIL_SET,
    dict(
        label=_("Email Server"),
        help_text=
        _("The SMTP server through which your application will be sending emails."
          ),
        required=False))

EMAIL_PORT = Setting(
    'EMAIL_PORT', 25, EMAIL_SET,
    dict(
        label=_("Email Port"),
        help_text=
        _("The port on which your SMTP server is listening to. Usually this is 25, but can be something else."
Exemplo n.º 6
0
FAQ_PAGE_TEXT = Setting(
    'FAQ_PAGE_TEXT', u"""
**Please customize this text in the administration area**

**Frequently Asked Questions (FAQ)**

**How is a Question/Answer community different from a typical forum?**

A Question/Answer community is different from a typical forum because it focuses on finding answers to the questions of its members.  A typical forum, by contrast, operates more like a discussion group, where people are free to give their opinions and topics tend to be more subjective.

By keeping a laser focus on questions and answers, this community ensures that finding answers to existing questions - and getting answers to new questions - can be done without any distractions.

**What kinds of questions can I ask here?**

Most importantly - questions should be relevant to this community. Before you ask, please make sure to search for a similar question. You can search for questions by their title, content, or tags.

**What kinds of questions should be avoided?**

Please avoid asking questions that are not relevant to this community, are too subjective or argumentative.

**What should I avoid in my answers?**

OSQA: Open Source Q&A Forum is a question and answer site - it is not a discussion group. Please avoid holding debates in your answers as they tend to dilute the essense of questions and answers. For brief discussions please use commenting facility.

** Why are email notifications so important? **

Email notifications are the bedrock of a successful question and answer community. These notifications allow community members to be notified of important events, such as:

* When their questions have been answered
* When one of their posts is commented on by another member
* When other members post new questions, answers, or comments in their area of interest

The success of the community relies upon community member involvement, and members are much more likely to become involved, active participants on the site when they're notified of interesting developments.  That is why this community considers a valid email address as a requirement for participating in the community and using this site.

If you're already a member of this community and haven't validated your email address, you can do so [here](/account/send-validation/ "Validate Email Address").  If you aren't yet a member of this community, join up by [creating a new account](/account/local/register/ "Create a new account").

 **Who moderates this community?**

The short answer is: you. This website is moderated by the users. The community features a karma system that allows users to earn rights to perform a variety of moderation tasks.

**How does the karma system work?**

When a question or answer is upvoted, the user who posted them will gain some points, which are called "karma points". These points serve as a rough measure of the community trust in him/her. Various moderation tasks are gradually assigned to the users based on those points.

For example, if you ask an interesting question or give a helpful answer, your input will be upvoted. On the other hand if the answer is misleading, it will be downvoted. Each vote in favor will generate |REP_GAIN_BY_UPVOTED| points, each vote against will subtract |REP_LOST_BY_DOWNVOTED| points. There is a limit of 200 points that can be accumulated per question or answer. The table below explains karma requirements for each type of moderation task.

* add comments ->  |REP_TO_COMMENT|
* delete comments -> |REP_TO_DELETE_COMMENTS|
* close own questions -> |REP_TO_CLOSE_OWN|
* reopen own questions -> |REP_TO_REOPEN_OWN|
* retag questions -> |REP_TO_RETAG|
* edit any answer -> |REP_TO_EDIT_OTHERS|
* open any closed question -> |REP_TO_CLOSE_OTHERS|
* delete any comment -> |REP_TO_DELETE_COMMENTS|

**What is a gravatar?**

Gravatar means globally recognized avatar - your unique avatar image associated with your email address. It's simply a picture that shows next to your posts on the websites that support gravatar protocol. The default gravatar appears as a square filled with a snowflake-like figure. You can set your image at gravatar.com

**To participate in this community, do I need to create new account?**

No, you don't have to. You can login through any service that supports OpenID, e.g. Google, Yahoo, AOL, etc. [Login now!](/account/signin/ "Login")

**Why can other people can edit my questions/answers?**

Allowing experienced members of this community to curate the questions and answers improves the overall quality of the knowledge base content. If this approach is not for you, we respect your choice.

**Still have questions?**

Please ask your question, help make our community better!
""", FAQ_SET,
    dict(label="FAQ page text",
         help_text=" The faq page. ",
         widget=Textarea(attrs={'rows': '25'})))
Exemplo n.º 7
0
from forms import CommaStringListWidget, StringListWidget
from django.forms import CheckboxSelectMultiple
from django.forms.widgets import RadioSelect
from base import Setting, SettingSet
from django.utils.translation import ugettext as _

USERS_SET = SettingSet('users', _('Users settings'),
                       _("General settings for the OSQA users."), 20)

ALLOW_NEGATIVE_REPUTATION = Setting(
    'ALLOW_NEGATIVE_REPUTATION', True, USERS_SET,
    dict(
        label=_("Allow negative reputation"),
        help_text=
        _("Check if you want to allow negative user reputations in the community."
          ),
        required=False))

STORE_GREETING_IN_COOKIE = Setting(
    'STORE_GREETING_IN_COOKIE', True, USERS_SET,
    dict(
        label=_("Store greeting in cookie"),
        help_text=
        _("If you check this the greeting will be stored in a cookie and the users won't be notified on logout."
          ),
        required=False))

EDITABLE_SCREEN_NAME = Setting(
    'EDITABLE_SCREEN_NAME', False, USERS_SET,
    dict(label=_("Editable screen name"),
         help_text=_("Allow users to alter their screen name."),
Exemplo n.º 8
0
FAQ_PAGE_TEXT = Setting(
    'FAQ_PAGE_TEXT', u"""
**Please customize this text in the administration area**

**Frequently Asked Questions (FAQ)**

**What kinds of questions can I ask here?**

Most importantly - questions should be relevant to this community. Before you ask - please make sure to search for a similar question. You can search questions by their title or tags.

**What kinds of questions should be avoided?**

Please avoid asking questions that are not relevant to this community, too subjective and argumentative.

**What should I avoid in my answers?**

OSQA: Open Source Q&A Forum is a question and answer site - it is not a discussion group. Please avoid holding debates in your answers as they tend to dilute the essense of questions and answers. For the brief discussions please use commenting facility.

**Who moderates this community?**

The short answer is: you. This website is moderated by the users. Karma system allows users to earn rights to perform a variety of moderation tasks

**How does the karma system work?**

When a question or answer is upvoted, the user who posted them will gain some points, which are called "karma points". These points serve as a rough measure of the community trust to him/her. Various moderation tasks are gradually assigned to the users based on those points.

For example, if you ask an interesting question or give a helpful answer, your input will be upvoted. On the other hand if the answer is misleading - it will be downvoted. Each vote in favor will generate |REP_GAIN_BY_UPVOTED| points, each vote against will subtract |REP_LOST_BY_DOWNVOTED| points. There is a limit of 200 points that can be accumulated per question or answer. The table below explains karma requirements for each type of moderation task.

* add comments ->  |REP_TO_COMMENT|
* delete comments -> |REP_TO_DELETE_COMMENTS|
* close own questions -> |REP_TO_CLOSE_OWN|
* reopen own questions -> |REP_TO_REOPEN_OWN|
* retag questions -> |REP_TO_RETAG|
* edit any answer -> |REP_TO_EDIT_OTHERS|
* open any closed question -> |REP_TO_CLOSE_OTHERS|
* delete any comment -> |REP_TO_DELETE_COMMENTS|

**What is gravatar?**

Gravatar means globally recognized avatar - your unique avatar image associated with your email address. It's simply a picture that shows next to your posts on the websites that support gravatar protocol. By default gravar appears as a square filled with a snowflake-like figure. You can set your image at gravatar.com

**To register, do I need to create new password?**

No, you don't have to. You can login through any service that supports OpenID, e.g. Google, Yahoo, AOL, etc. Login now!

**Why can other people can edit my questions/answers?**

Goal of this site is... So questions and answers can be edited like wiki pages by experienced users of this site and this improves the overall quality of the knowledge base content. If this approach is not for you, we respect your choice.

**Still have questions?**

Please ask your question, help make our community better!
""", FAQ_SET,
    dict(label="FAQ page text",
         help_text=" The faq page. ",
         widget=Textarea(attrs={'rows': '25'})))
Exemplo n.º 9
0
from base import Setting, SettingSet
from django.forms.widgets import Textarea, RadioSelect, Select
from django.utils.translation import ugettext_lazy as _

RENDER_CHOICES = (('markdown', _('Markdown')), ('html', _('HTML')),
                  ('escape', _('Escaped')))

STATIC_PAGE_REGISTRY = Setting('STATIC_PAGE_REGISTRY', {})

CSS_SET = SettingSet(
    'css',
    'Custom CSS',
    "Define some custom css you can use to override the default css.",
    2000,
    can_preview=True)

USE_CUSTOM_CSS = Setting(
    'USE_CUSTOM_CSS', False, CSS_SET,
    dict(label=_("Use custom CSS"),
         help_text=_("Do you want to use custom CSS."),
         required=False))

CUSTOM_CSS = Setting(
    'CUSTOM_CSS', '', CSS_SET,
    dict(label=_("Custom CSS"),
         help_text=_("Your custom CSS."),
         widget=Textarea(attrs={'rows': '25'}),
         required=False))

HEAD_AND_FOOT_SET = SettingSet(
    'headandfoot',
Exemplo n.º 10
0
from base import Setting, SettingSet
from django.utils.translation import ugettext_lazy as _

VOTE_RULES_SET = SettingSet('voting', _('Voting rules'),
                            _("Configure the voting rules on your site."), 400)

MAX_VOTES_PER_DAY = Setting(
    'MAX_VOTES_PER_DAY', 30, VOTE_RULES_SET,
    dict(label=_("Maximum votes per day"),
         help_text=_("""
The maximum number of votes an user can cast per day.
""")))

START_WARN_VOTES_LEFT = Setting(
    'START_WARN_VOTES_LEFT', 10, VOTE_RULES_SET,
    dict(label=_("Start warning about votes left"),
         help_text=_("""
From how many votes left should an user start to be warned about it.
""")))

MAX_FLAGS_PER_DAY = Setting(
    'MAX_FLAGS_PER_DAY', 5, VOTE_RULES_SET,
    dict(label=_("Maximum flags per day"),
         help_text=_("""
The maximum number of times an can flag a post per day.
""")))

FLAG_COUNT_TO_HIDE_POST = Setting(
    'FLAG_COUNT_TO_HIDE_POST', 3, VOTE_RULES_SET,
    dict(label=_("Flag count to hide post"),
         help_text=_("""
Exemplo n.º 11
0
from base import Setting, SettingSet
from django.forms.widgets import RadioSelect
from django.utils.translation import ugettext_lazy as _

ACCEPT_SET = SettingSet(
    'accept', _('Accepting answers'),
    _("Settings to tweak the behaviour of accepting answers."), 500)

DISABLE_ACCEPTING_FEATURE = Setting(
    'DISABLE_ACCEPTING_FEATURE', False, ACCEPT_SET,
    dict(
        label=_("Disallow answers to be accepted"),
        help_text=
        _("Disable accepting answers feature. If you re-enable it in the future, currently accepted answers will still be marked as accepted."
          ),
        required=False))

MAXIMUM_ACCEPTED_ANSWERS = Setting(
    'MAXIMUM_ACCEPTED_ANSWERS', 1, ACCEPT_SET,
    dict(
        label=_("Maximum accepted answers per question"),
        help_text=
        _("How many accepted answers are allowed per question. Use 0 for no limit."
          )))

MAXIMUM_ACCEPTED_PER_USER = Setting(
    'MAXIMUM_ACCEPTED_PER_USER', 1, ACCEPT_SET,
    dict(
        label=_("Maximum accepted answers per user/question"),
        help_text=
        _("If more than one accpeted answer is allowed, how many can be accepted per single user per question."
Exemplo n.º 12
0
from base import Setting, SettingSet
from django.forms.widgets import Textarea, Select
from django.utils.translation import ugettext_lazy as _

from static import RENDER_CHOICES

SIDEBAR_SET = SettingSet(
    'sidebar', 'Sidebar content',
    "Enter contents to display in the sidebar. You can use markdown and some basic html tags.",
    10, True)

SHOW_WELCOME_BOX = Setting(
    'SHOW_WELCOME_BOX', True, SIDEBAR_SET,
    dict(
        label=_("Show the Welcome box"),
        help_text=
        _("Do you want to show the welcome box when a user first visits your site."
          ),
        required=False))

APP_INTRO = Setting(
    'APP_INTRO', u'<p>Ask and answer questions, make the world better!</p>',
    SIDEBAR_SET,
    dict(
        label=_("Application intro"),
        help_text=
        _("The introductory page that is visible in the sidebar for anonymous users."
          ),
        widget=Textarea))

QUESTION_TITLE_TIPS = Setting(
Exemplo n.º 13
0
import os.path
from base import Setting, SettingSet
from django.utils.translation import ugettext_lazy as _

FORUM_SET = SettingSet('form', _('Form settings'),
                       _("General settings for the OSQA forms."), 10)

WIKI_ON = Setting(
    'WIKI_ON', True, FORUM_SET,
    dict(label=_("Enable community wiki"),
         help_text=_("Can questions or answers be marked as community wiki."),
         required=False))

LIMIT_TAG_CREATION = Setting(
    'LIMIT_TAG_CREATION', False, FORUM_SET,
    dict(
        label=_("Limit tag creation"),
        help_text=
        _("Limit tag creation to super users, staff or users with a minimum reputation."
          ),
        required=False))
""" settings for questions """
FORM_MIN_QUESTION_TITLE = Setting(
    'FORM_MIN_QUESTION_TITLE', 10, FORUM_SET,
    dict(
        label=_("Minimum number of characters for a question's title"),
        help_text=
        _("The minimum number of characters a user must enter into the title field of a question."
          )))

# FORM_MAX_QUESTION_TITLE = Setting('FORM_MAX_QUESTION_TITLE', 100, FORUM_SET, dict(
Exemplo n.º 14
0
from base import Setting, SettingSet
from django.utils.translation import ugettext_lazy as _

MIN_REP_SET = SettingSet(
    'minrep', _('Minimum reputation config'),
    _("Configure the minimum reputation required to perform certain actions on your site."
      ), 300)

REP_TO_VOTE_UP = Setting(
    'REP_TO_VOTE_UP', 15, MIN_REP_SET,
    dict(label=_("Minimum reputation to vote up"),
         help_text=_("""
The minimum reputation an user must have to be allowed to vote up.
""")))

REP_TO_VOTE_DOWN = Setting(
    'REP_TO_VOTE_DOWN', 100, MIN_REP_SET,
    dict(label=_("Minimum reputation to vote down"),
         help_text=_("""
The minimum reputation an user must have to be allowed to vote down.
""")))

REP_TO_FLAG = Setting(
    'REP_TO_FLAG', 15, MIN_REP_SET,
    dict(label=_("Minimum reputation to flag a post"),
         help_text=_("""
The minimum reputation an user must have to be allowed to flag a post.
""")))

REP_TO_COMMENT = Setting(
    'REP_TO_COMMENT', 50, MIN_REP_SET,
Exemplo n.º 15
0
from base import Setting, SettingSet
from django.utils.translation import ugettext_lazy as _
""" view settings """
VIEW_SET = SettingSet('view', _('View settings'),
                      _("Set up how certain parts of the site are displayed."),
                      20)

SUMMARY_LENGTH = Setting(
    'SUMMARY_LENGTH', 300, VIEW_SET,
    dict(
        label=_("Summary Length"),
        help_text=
        _("The number of characters that are going to be displayed in order to get the content summary."
          )))

RECENT_TAGS_SIZE = Setting(
    'RECENT_TAGS_SIZE', 25, VIEW_SET,
    dict(
        label=_("Recent tags block size"),
        help_text=
        _("The number of tags to display in the recent tags block in the front page."
          )))

RECENT_AWARD_SIZE = Setting(
    'RECENT_AWARD_SIZE', 15, VIEW_SET,
    dict(
        label=_("Recent awards block size"),
        help_text=
        _("The number of awards to display in the recent awards block in the front page."
          )))
Exemplo n.º 16
0
from django.forms.widgets import Textarea
from django.utils.translation import ugettext_lazy as _
from django.conf import settings as djsettings
from django.utils.version import get_svn_revision

from forum.modules import get_modules_script_implementations

OSQA_VERSION = "Development Build"

SVN_REVISION = get_svn_revision(djsettings.SITE_SRC_ROOT)

# We'll have to keep in mind this variable on every release.
if SVN_REVISION == u'SVN-unknown':
    SVN_REVISION = u'SVN-1281'

MAINTAINANCE_MODE = Setting('MAINTAINANCE_MODE', None)

SETTINGS_PACK = Setting('SETTINGS_PACK', "default")
DJSTYLE_ADMIN_INTERFACE = Setting('DJSTYLE_ADMIN_INTERFACE', True)
NODE_MAN_FILTERS = Setting('NODE_MAN_FILTERS', [])

APP_URL = djsettings.APP_URL
APP_BASE_URL = djsettings.APP_BASE_URL
FORCE_SCRIPT_NAME = djsettings.FORCE_SCRIPT_NAME
OSQA_SKIN = djsettings.OSQA_DEFAULT_SKIN
LANGUAGE_CODE = djsettings.LANGUAGE_CODE
ADMIN_MEDIA_PREFIX = djsettings.ADMIN_MEDIA_PREFIX
ONLINE_USERS = Setting('ONLINE_USERS', {})


from basic import *
Exemplo n.º 17
0
from base import Setting, SettingSet
from django.forms.widgets import Textarea, Select
from django.utils.translation import ugettext_lazy as _

from static import RENDER_CHOICES

SIDEBAR_SET = SettingSet(
    'sidebar', 'Sidebar content',
    "Enter contents to display in the sidebar. You can use markdown and some basic html tags.",
    10, True)

SHOW_WELCOME_BOX = Setting(
    'SHOW_WELCOME_BOX', True, SIDEBAR_SET,
    dict(
        label=_("Show the Welcome box"),
        help_text=
        _("Do you want to show the welcome box when a user first visits your site."
          ),
        required=False))

APP_INTRO = Setting(
    'APP_INTRO', u'<p>Ask and answer questions, make the world better!</p>',
    SIDEBAR_SET,
    dict(
        label=_("Application intro"),
        help_text=
        _("The introductory page that is visible in the sidebar for anonymous users."
          ),
        widget=Textarea))

SIDEBAR_UPPER_SHOW = Setting(
Exemplo n.º 18
0
from base import Setting, SettingSet
from django.utils.translation import ugettext_lazy as _
""" view settings """
VIEW_SET = SettingSet('view', _('View settings'),
                      _("Set up how certain parts of the site are displayed."),
                      20)

RECENT_TAGS_SIZE = Setting(
    'RECENT_TAGS_SIZE', 25, VIEW_SET,
    dict(
        label=_("Recent tags block size"),
        help_text=
        _("The number of tags to display in the recent tags block in the front page."
          )))

RECENT_AWARD_SIZE = Setting(
    'RECENT_AWARD_SIZE', 15, VIEW_SET,
    dict(
        label=_("Recent awards block size"),
        help_text=
        _("The number of awards to display in the recent awards block in the front page."
          )))

LIMIT_RELATED_TAGS = Setting(
    'LIMIT_RELATED_TAGS', 0, VIEW_SET,
    dict(
        label=_("Limit related tags block"),
        help_text=
        _("Limit related tags block size in questions list pages. Set to 0 to display all all tags."
          )))
Exemplo n.º 19
0
from base import Setting, SettingSet
from django.utils.translation import ugettext_lazy as _

EXT_KEYS_SET = SettingSet(
    'extkeys', _('External Keys'),
    _("Keys for various external providers that your application may optionally use."
      ), 100)

GOOGLE_SITEMAP_CODE = Setting(
    'GOOGLE_SITEMAP_CODE', '', EXT_KEYS_SET,
    dict(label=_("Google sitemap code"),
         help_text="""
This is the code you get when you register your site at <a href="https://www.google.com/webmasters/tools/">Google webmaster central</a>.
""",
         required=False))

GOOGLE_ANALYTICS_KEY = Setting(
    'GOOGLE_ANALYTICS_KEY', '', EXT_KEYS_SET,
    dict(label=_("Google analytics key"),
         help_text="""
Your Google analytics key. You can get one at the <a href="http://www.google.com/analytics/">Google analytics official website</a>
""",
         required=False))
Exemplo n.º 20
0
from django.forms.widgets import PasswordInput
from django.forms.widgets import RadioSelect

EMAIL_SET = SettingSet('email', _('Email settings'),
                       _("Email server and other email related settings."), 50)

EMAIL_SUBSCRIBE_CHOICES = (
    ('y', _('Users are subscribed by default')),
    ('n', _('Users are not subscribed by default')),
)

INITIAL_EMAIL_SUBSCRIBE_OPTION = Setting(
    'INITIAL_EMAIL_SUBSCRIBE_OPTION', 'y', EMAIL_SET,
    dict(
        label=_("Default email subscription"),
        widget=RadioSelect,
        choices=EMAIL_SUBSCRIBE_CHOICES,
        help_text=
        _("Choose what should be the default email subscription status while registering."
          ),
        required=False))

EMAIL_HOST = Setting(
    'EMAIL_HOST', '', EMAIL_SET,
    dict(
        label=_("Email Server"),
        help_text=
        _("The SMTP server through which your application will be sending emails."
          ),
        required=False))

EMAIL_PORT = Setting(
Exemplo n.º 21
0
from base import Setting, SettingSet
from django.utils.translation import ugettext as _

URLS_SET = SettingSet(
    'urls', _('URL settings'),
    _("Some settings to tweak behaviour of site urls (experimental)."))

ALLOW_UNICODE_IN_SLUGS = Setting(
    'ALLOW_UNICODE_IN_SLUGS', False, URLS_SET,
    dict(label=_("Allow unicode in slugs"),
         help_text=_("Allow unicode/non-latin characters in urls."),
         required=False))

FORCE_SINGLE_URL = Setting(
    'FORCE_SINGLE_URL', True, URLS_SET,
    dict(
        label=_("Force single url"),
        help_text=
        _("Redirect the request in case there is a mismatch between the slug in the url and the actual slug"
          ),
        required=False))
Exemplo n.º 22
0
from base import Setting, SettingSet
from django.utils.translation import ugettext_lazy as _

MIN_REP_SET = SettingSet(
    'minrep', _('Minimum reputation config'),
    _("Configure the minimum reputation required to perform certain actions on your site."
      ), 300)

CAPTCHA_IF_REP_LESS_THAN = Setting(
    'CAPTCHA_IF_REP_LESS_THAN', 0, MIN_REP_SET,
    dict(
        label=_("Show captcha if user with less reputation than"),
        help_text=
        _("If the user has less reputation, captcha is used to when adding new content."
          )))

REP_TO_VOTE_UP = Setting(
    'REP_TO_VOTE_UP', 15, MIN_REP_SET,
    dict(
        label=_("Minimum reputation to vote up"),
        help_text=_(
            "The minimum reputation an user must have to be allowed to vote up."
        )))

REP_TO_VOTE_DOWN = Setting(
    'REP_TO_VOTE_DOWN', 100, MIN_REP_SET,
    dict(
        label=_("Minimum reputation to vote down"),
        help_text=
        _("The minimum reputation an user must have to be allowed to vote down."
          )))
Exemplo n.º 23
0
from base import Setting, SettingSet
from django.utils.translation import ugettext_lazy as _

VOTE_RULES_SET = SettingSet('voting', _('Voting rules'),
                            _("Configure the voting rules on your site."), 400)

ANONYMOUS_VOTES = Setting(
    'ANONYMOUS_VOTES', False, VOTE_RULES_SET,
    dict(
        label=_("User votes anonymous"),
        required=False,
        help_text=
        _("If set to True user's votes are only visible to themselves and administrators."
          )))

USER_REPUTATION_TO_MAX_VOTES = Setting(
    'USER_REPUTATION_TO_MAX_VOTES', True, VOTE_RULES_SET,
    dict(
        label=_("Add reputation to max votes per day"),
        required=False,
        help_text=
        _("The user reputation is added to the static MAX_VOTES_PER_DAY option. Users with higher reputation can vote more."
          )))

MAX_VOTES_PER_DAY = Setting(
    'MAX_VOTES_PER_DAY', 30, VOTE_RULES_SET,
    dict(label=_("Maximum votes per day"),
         help_text=_("The maximum number of votes an user can cast per day.")))

START_WARN_VOTES_LEFT = Setting(
    'START_WARN_VOTES_LEFT', 10, VOTE_RULES_SET,
Exemplo n.º 24
0
from base import Setting, SettingSet
from django.forms.widgets import Textarea, RadioSelect, Select
from django.utils.translation import ugettext_lazy as _

SITEMAP_SET = SettingSet('sitemap', _('Sitemap settings'),
                         _("Some settings connected with the Sitemaps."), 2000)

QUESTIONS_SITEMAP_LIMIT = Setting(
    'QUESTIONS_SITEMAP_LIMIT', 2500, SITEMAP_SET,
    dict(label=_("Questions Sitemap Limit"),
         help_text=_(
             "The questions limit per page for the Questions Sitemap.")))

QUESTIONS_SITEMAP_CHANGEFREQ = Setting(
    'QUESTIONS_SITEMAP_CHANGEFREQ', 'daily', SITEMAP_SET,
    dict(
        label=_("Questions Sitemap Change Fraquence"),
        help_text=
        _("Used in the Questions Sitemap <changefreq> tag and specifies the content change frequency."
          )))
Exemplo n.º 25
0
from django.forms.widgets import Textarea
from django.utils.translation import ugettext_lazy as _

PAGES_SET = SettingSet(
    'about', _('About page'),
    _("Define the text in the about page. You can use markdown and some basic html tags."
      ), 2000, True)

ABOUT_PAGE_TEXT = Setting(
    'ABOUT_PAGE_TEXT', u"""
**Please customize this text in the administration area**

Here you can **ask** and **answer** questions, **comment**
and **vote** for the questions of others and their answers. Both questions and answers
**can be revised** and improved. Questions can be **tagged** with
the relevant keywords to simplify future access and organize the accumulated material.

This <span class="orange">Q&amp;A</span> site is moderated by its members, hopefully - including yourself!
Moderation rights are gradually assigned to the site users based on the accumulated "**karma**"
points. These points are added to the users account when others vote for his/her questions or answers.
These points (very) roughly reflect the level of trust of the community.

No points are necessary to ask or answer the questions - so please - join us!

If you would like to find out more about this site - please see the **frequently asked questions** page.
""", PAGES_SET,
    dict(label=_("About page text"),
         help_text=_("""
The about page.
"""),
         widget=Textarea(attrs={'rows': '20'})))
Exemplo n.º 26
0
from base import Setting, SettingSet
from django.utils.translation import ugettext_lazy as _
""" view settings """
VIEW_SET = SettingSet('view', _('View settings'),
                      _("Set up how certain parts of the site are displayed."),
                      20)

EMBED_YOUTUBE_VIDEOS = Setting(
    'EMBED_YOUTUBE_VIDEOS', True, VIEW_SET,
    dict(label=_("Embed YouTube Videos"),
         help_text=_("If you check this YouTube videos will be embedded"),
         required=False))

SHOW_LATEST_COMMENTS_FIRST = Setting(
    'SHOW_LATEST_COMMENTS_FIRST', False, VIEW_SET,
    dict(label=_("Show latest comments first"),
         help_text=_(
             "Choose this if you want the latest comments to appear first."),
         required=False))

SUMMARY_LENGTH = Setting(
    'SUMMARY_LENGTH', 300, VIEW_SET,
    dict(
        label=_("Summary Length"),
        help_text=
        _("The number of characters that are going to be displayed in order to get the content summary."
          )))

SHOW_SUMMARY_ON_QUESTIONS_LIST = Setting(
    'SHOW_SUMMARY_ON_QUESTIONS_LIST', False, VIEW_SET,
    dict(label=_("Question summary on questions list?"),
Exemplo n.º 27
0
from base import Setting, SettingSet
from forms import StringListWidget

from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
from django.forms.widgets import Textarea, RadioSelect

MODERATION_SET = SettingSet('moderation', _('Moderation settings'),
                            _("Define the moderation workflow of your site"),
                            100)

USE_CANNED_COMMENTS = Setting(
    'USE_CANNED_COMMENTS', True, MODERATION_SET,
    dict(
        label=_("Use canned comments"),
        help_text=
        _("If you check, the canned comments feature will be activated, allowing moderators to use canned patterns for their comments."
          ),
        required=False))

CANNED_COMMENTS = Setting(
    'CANNED_COMMENTS', [
        "We require all postings to have a clear, specific QUESTION in the title field. Please edit this right away to rephrase the title as a proper question.",
    ], MODERATION_SET,
    dict(label=_("Canned comments"),
         help_text=_("""
<p>Create some canned comments to be used for easier moderation. You can access the {{ post }} and {{ settings }} variables.</p>
<p>If you want to access the current post author username you can use {{ post.author }}, for the question title use {{ post.title }}.</p>
<p>To get the application title use {{ settings.APP_TITLE }}. All settings are accessible through the settings object.</p>
"""),
         widget=StringListWidget))
Exemplo n.º 28
0
import os.path
from base import Setting, SettingSet
from forms import ImageFormWidget

from django.forms.widgets import Textarea
from django.utils.translation import ugettext_lazy as _

INTERNAL_VERSION = Setting('INTERNAL_VERSION', "201003270")
SETTINGS_PACK = Setting('SETTINGS_PACK', "default")

from basic import *
from email import *
from extkeys import *
from minrep import *
from repgain import *
from voting import *
from upload import *
from pages import *

BADGES_SET = SettingSet('badges', _('Badges config'),
                        _("Configure badges on your OSQA site."), 500)

#__all__ = locals().keys()
Exemplo n.º 29
0
from base import Setting, SettingSet
from django.forms.widgets import Textarea, Select
from django.utils.translation import ugettext_lazy as _

from static import RENDER_CHOICES

SIDEBAR_SET = SettingSet(
    'sidebar', 'Sidebar content',
    "Enter contents to display in the sidebar. You can use markdown and some basic html tags.",
    10, True)

SHOW_WELCOME_BOX = Setting(
    'SHOW_WELCOME_BOX', True, SIDEBAR_SET,
    dict(
        label=_("Show the Welcome box"),
        help_text=
        _("Do you want to show the welcome box when a user first visits your site."
          ),
        required=False))

SHOW_INTERESTING_TAGS_BOX = Setting(
    'SHOW_INTERESTING_TAGS_BOX', True, SIDEBAR_SET,
    dict(
        label=_("Show interesting tags in the sidebar"),
        help_text=
        _("Check this if you want to see the interesting tags container in the sidebar."
          ),
        required=False))

APP_INTRO = Setting(
    'APP_INTRO', u'<p>Ask and answer questions, make the world better!</p>',
Exemplo n.º 30
0
import os.path

from base import Setting, SettingSet
from forms import ImageFormWidget

from django.utils.translation import ugettext_lazy as _
from django.forms.widgets import Textarea

BASIC_SET = SettingSet('basic', _('Basic Settings'),
                       _("The basic settings for your application"), 1)

APP_LOGO = Setting(
    'APP_LOGO', '/m/default/media/images/logo.png', BASIC_SET,
    dict(label=_("Application logo"),
         help_text=_("""
Your site main logo.
"""),
         widget=ImageFormWidget))

APP_FAVICON = Setting(
    'APP_FAVICON', '/m/default/media/images/favicon.ico', BASIC_SET,
    dict(label=_("Favicon"),
         help_text=_("""
Your site favicon.
"""),
         widget=ImageFormWidget))

APP_TITLE = Setting(
    'APP_TITLE', 'OSQA: Open Source Q&A Forum', BASIC_SET,
    dict(label=_("Application title"),
         help_text=_("""