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."),
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))
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))
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'iCQA: Intelligent Community Q&A Forum', BASIC_SET, dict( label=_("Application title"), help_text= _("The title of your application that will show in the browsers title bar" )))
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(
from base import Setting, SettingSet from django.forms.widgets import Textarea FAQ_SET = SettingSet( 'faq', 'FAQ page', "Define the text in the about page. You can use markdown and some basic html tags.", 2000, True) 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.
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_EMAIL_VALIDATION = Setting( 'REP_GAIN_BY_EMAIL_VALIDATION', 10, REP_GAIN_SET, dict(label=_("Rep gain by e-mail validation"), help_text=_("Reputation a user gains for validating his e-mail."))) 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.")))
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(
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." )))
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." )))
from base import Setting, SettingSet from django.forms.widgets import Textarea 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&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'})))
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',
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."
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.")))
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()
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,
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." )))
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."
from base import Setting, SettingSet from forms import StringListWidget from django.utils.translation import ugettext_lazy as _ from django.forms.widgets import Textarea MODERATION_SET = SettingSet('moderation', _('Moderation settings'), _("Define the moderation workflow of your site"), 100) FLAG_TYPES = Setting('FLAG_TYPES', ["Spam", "Advertising", "Offensive, Abusive, or Inappropriate", "Content violates terms of use", "Copyright Violation", "Misleading", "Someone is not being nice", "Not relevant/off-topic", "Other"], MODERATION_SET, dict( label = _("Flag Reasons"), help_text = _("Create some flag reasons to use in the flag post popup."), widget=StringListWidget)) CLOSE_TYPES = Setting('CLOSE_TYPES', ["Duplicate Question", "Question is off-topic or not relevant", "Too subjective and argumentative", "The question is answered, right answer was accepted", "Problem is not reproducible or outdated", "Other"], MODERATION_SET, dict( label = _("Close Reasons"), help_text = _("Create some close reasons to use in the close question popup."), widget=StringListWidget))