def load_fixtures(): role = Role(name=_("Administrator").message, token='admin', protected=True) role.set_permissions({ 'name_changes_allowed': 5, 'changes_expire': 7, 'can_use_acp': True, 'can_use_signature': True, 'allow_signature_links': True, 'allow_signature_images': True, 'can_search_users': True, 'can_see_users_emails': True, 'can_see_users_trails': True, 'can_see_hidden_users': True, 'forums': {5: 1, 6: 1, 7: 1}, }) role.save(force_insert=True) role = Role(name=_("Moderator").message, token='mod', protected=True) role.set_permissions({ 'name_changes_allowed': 3, 'changes_expire': 14, 'can_use_signature': True, 'allow_signature_links': True, 'can_search_users': True, 'can_see_users_emails': True, 'can_see_users_trails': True, 'can_see_hidden_users': True, 'forums': {5: 1, 6: 1, 7: 1}, }) role.save(force_insert=True) role = Role(name=_("Registered").message, token='registered') role.set_permissions({ 'name_changes_allowed': 2, 'can_use_signature': False, 'can_search_users': True, 'forums': {5: 3, 6: 3, 7: 3}, }) role.save(force_insert=True) role = Role(name=_("Guest").message, token='guest') role.set_permissions({ 'can_search_users': True, 'forums': {5: 6, 6: 6, 7: 6}, }) role.save(force_insert=True)
def load_fixtures(): load_monitor_fixture(monitor_fixtures) load_settings_fixture(settings_fixtures) rank_staff = Rank( name=_("Forum Team").message, title=_("Forum Team").message, style='staff', special=True, order=0, as_tab=True, ) rank_lurker = Rank(name=_("Lurker").message, style='lurker', order=1, criteria="100%") rank_member = Rank(name=_("Member").message, order=2, criteria="75%") rank_active = Rank( name=_("Most Valueable Posters").message, title=_("MVP").message, style='active', order=3, criteria="5%", as_tab=True, ) rank_staff.save(force_insert=True) rank_lurker.save(force_insert=True) rank_member.save(force_insert=True) rank_active.save(force_insert=True)
def load_fixtures(): role_admin = Role( name=_("Administrator").message, token='admin', protected=True, ) role_mod = Role( name=_("Moderator").message, token='mod', protected=True, ) role_registered = Role( name=_("Registered").message, token='registered', ) role_guest = Role( name=_("Guest").message, token='guest', ) role_admin.save(force_insert=True) role_mod.save(force_insert=True) role_registered.save(force_insert=True) role_guest.save(force_insert=True)
def load_fixtures(): load_settings_fixture(settings_fixtures) Rank.objects.create( name=_("Forum Team").message, name_slug='forum-team', title=_("Forum Team").message, style='team', special=True, order=0, as_tab=True, on_index=True, ) Rank.objects.create( name=_("Most Valuable Posters").message, name_slug='most-valuable-posters', title=_("MVP").message, style='mvp', special=True, order=1, as_tab=True, ) Rank.objects.create( name=_("Lurkers").message, name_slug='lurkers', order=1, criteria="100%" ) Rank.objects.create( name=_("Members").message, name_slug='members', order=2, criteria="75%" ) Rank.objects.create( name=_("Active Members").message, name_slug='active-members', style='active', order=3, criteria="10%", as_tab=True, )
def load_fixtures(): load_monitor_fixture(monitor_fixtures) load_settings_fixture(settings_fixtures) rank_staff = Rank( name=_("Forum Team").message, title=_("Forum Team").message, style='staff', special=True, order=0, as_tab=True, ) rank_lurker = Rank( name=_("Lurker").message, style='lurker', order=1, criteria="100%" ) rank_member = Rank( name=_("Member").message, order=2, criteria="75%" ) rank_active = Rank( name=_("Most Valueable Posters").message, title=_("MVP").message, style='active', order=3, criteria="5%", as_tab=True, ) rank_staff.save(force_insert=True) rank_lurker.save(force_insert=True) rank_member.save(force_insert=True) rank_active.save(force_insert=True)
from misago.settings.fixtures import load_settings_fixture, update_settings_fixture from misago.utils import ugettext_lazy as _ from misago.utils import get_msgid settings_fixtures = ( # Register and Sign-In Settings ('brute-force', { 'name': _("Brute-force Countermeasures"), 'description': _("Those settings allow you to protect your forum from brute-force attacks."), 'settings': ( ('attempts_limit', { 'value': 3, 'default': 3, 'type': "integer", 'input': "text", 'separator': _("Brute-force Countermeasures"), 'name': _("IP invalid attempts limit"), 'description': _('Enter maximal number of allowed attempts before IP address "jams". Defautly forum records only failed sign-in attempts.'), }), ('registrations_jams', { 'value': False, 'default': False, 'type': "boolean", 'input': "yesno", 'name': _("Protect register form"), 'description': _("Set this setting to yes if you want failed register attempts to count into limit. Majority of failed register attempts are caused by CAPTCHA protection against spam-bots, however same protection may cause problems for users with disabilities or ones that have problems understanding Q&A challenge."), }), ('jams_lifetime', { 'value': 15, 'default': 15, 'type': "integer",
import base64 from misago.settings.models import Group, Setting from misago.utils import ugettext_lazy as _ from misago.utils import get_msgid try: import cPickle as pickle except ImportError: import pickle settings_fixture = ( # Basic options ('basic', { 'name': _("Basic Settings"), 'settings': ( ('board_name', { 'value': "Misago", 'type': "string", 'input': "text", 'separator': _("Board Name"), 'name': _("Board Name"), 'position': 0, }), ('board_header', { 'type': "string", 'input': "text", 'name': _("Board Header"), 'description': _("Some themes allow you to define text in board header. Leave empty to use Board Name instead."), 'position': 1, }), ('board_header_postscript', { 'value': "Work in progress ",
def load_fixtures(): role = ForumRole() role.name = _('Full Access').message role.set_permissions({ 'can_see_forum': True, 'can_see_forum_contents': True, 'can_read_threads': 2, 'can_start_threads': 2, 'can_edit_own_threads': True, 'can_soft_delete_own_threads': True, 'can_write_posts': 2, 'can_edit_own_posts': True, 'can_soft_delete_own_posts': True, 'can_upvote_posts': True, 'can_downvote_posts': True, 'can_see_posts_scores': 2, 'can_see_votes': True, 'can_make_polls': True, 'can_vote_in_polls': True, 'can_see_poll_votes': True, 'can_see_attachments': True, 'can_upload_attachments': True, 'can_download_attachments': True, 'attachment_size': 5000, 'attachment_limit': 15, 'can_approve': True, 'can_edit_labels': True, 'can_see_changelog': True, 'can_pin_threads': 2, 'can_edit_threads_posts': True, 'can_move_threads_posts': True, 'can_close_threads': True, 'can_protect_posts': True, 'can_delete_threads': 2, 'can_delete_posts': 2, 'can_delete_polls': 2, 'can_delete_attachments': True, }) role.save(force_insert=True) role = ForumRole() role.name = _('Standard Access and Upload').message role.set_permissions({ 'can_see_forum': True, 'can_see_forum_contents': True, 'can_read_threads': 2, 'can_start_threads': 2, 'can_edit_own_threads': True, 'can_write_posts': 2, 'can_edit_own_posts': True, 'can_soft_delete_own_posts': True, 'can_upvote_posts': True, 'can_downvote_posts': True, 'can_see_posts_scores': 1, 'can_make_polls': True, 'can_vote_in_polls': True, 'can_upload_attachments': True, 'can_download_attachments': True, 'attachment_size': 100, 'attachment_limit': 3, }) role.save(force_insert=True) role = ForumRole() role.name = _('Standard Access').message role.set_permissions({ 'can_see_forum': True, 'can_see_forum_contents': True, 'can_read_threads': 2, 'can_start_threads': 2, 'can_edit_own_threads': True, 'can_write_posts': 2, 'can_edit_own_posts': True, 'can_soft_delete_own_posts': True, 'can_upvote_posts': True, 'can_downvote_posts': True, 'can_see_posts_scores': 1, 'can_make_polls': True, 'can_vote_in_polls': True, 'can_download_attachments': True, }) role.save(force_insert=True) role = ForumRole() role.name = _('Read and Download').message role.set_permissions({ 'can_see_forum': True, 'can_see_forum_contents': True, 'can_read_threads': 2, 'can_download_attachments': True, 'can_see_posts_scores': 1, }) role.save(force_insert=True) role = ForumRole() role.name = _('Threads list only').message role.set_permissions({ 'can_see_forum': True, 'can_see_forum_contents': True, }) role.save(force_insert=True) role = ForumRole() role.name = _('Read only').message role.set_permissions({ 'can_see_forum': True, 'can_see_forum_contents': True, 'can_read_threads': 2, }) role.save(force_insert=True)
from misago.settings.fixtures import load_settings_fixture, update_settings_fixture from misago.utils import ugettext_lazy as _ from misago.utils import get_msgid settings_fixtures = ( # Avatars Settings ('tos', { 'name': _("Forum Terms of Service"), 'description': _("Those settings allow you to set up forum terms of service."), 'settings': ( ('tos_title', { 'value': "Terms of Service", 'type': "string", 'input': "text", 'separator': _("Terms of Service Options"), 'name': _("Page Title"), 'description': _("Title of page community ToS are displayed on."), }), ('tos_url', { 'value': "", 'type': "string", 'input': "text", 'name': _("Link to remote page with ToS"), 'description': _("If your forum's ToS are located on remote page, enter here its address."), }), ('tos_content', { 'value': "", 'type': "string", 'input': "textarea", 'name': _("OR enter ToS content"), 'description': _("Instead of linking to remote page, forum can create dedicated ToS page for you. To display ToS page, enter here your forum Terms of Service."),
from misago.ranks.models import Rank from misago.settings.fixtures import load_settings_fixture, update_settings_fixture from misago.utils import ugettext_lazy as _ from misago.utils import get_msgid settings_fixtures = ( # Users Ranking Settings ('ranking', { 'name': _("Members Ranking"), 'description': _("Those settings control mechanisms of members activity ranking which allows you to gamificate your forum."), 'settings': ( ('ranking_inflation', { 'value': 5, 'type': "integer", 'input': "text", 'extra': {'min': 0, 'max': 99}, 'separator': _("Basic Ranking Settings"), 'name': _("Ranking Inflation"), 'description': _("Enter size of ranking scores inflation in percent. Scores inflation is important mechanism that allows ranking self-regulation, punishing inactivity and requiring users to remain active in order to remain high in ranking."), }), ('ranking_positions_visible', { 'value': True, 'type': "boolean", 'input': "yesno", 'name': _("Don't Keep Users Ranking Positions Secret"), 'description': _("Changing this to yes will cause forum to display user position in ranking on his profile page."), }), ('ranking_scores_visible', { 'value': True, 'type': "boolean",
from misago.settings.fixtures import load_settings_fixture, update_settings_fixture from misago.utils import ugettext_lazy as _ from misago.utils import get_msgid settings_fixtures = ( # Spam Countermeasures ('spam', { 'name': _("Spam Countermeasures"), 'description': _("Those settings allow you to combat automatic registrations and spam messages on your forum." ), 'settings': ( ('bots_registration', { 'type': "string", 'input': "choice", 'extra': { 'choices': [('', _("No protection")), ('recaptcha', _("reCaptcha")), ('qa', _("Question & Answer"))] }, 'separator': _("Spambots Registrations"), 'name': _("CAPTCHA type"), 'description': _('CAPTCHA stands for "Completely Automated Public Turing test to tell Computers and Humans Apart". Its type of test developed on purpose of blocking automatic registrations.' ), 'position':
from misago.utils import get_msgid monitor_fixtures = { 'users': 0, 'users_inactive': 0, 'users_reported': 0, 'last_user': None, 'last_user_name': None, 'last_user_slug': None, } settings_fixtures = ( # Avatars Settings ('avatars', { 'name': _("Users Avatars Settings"), 'description': _("Those settings allow you to control your users avatars."), 'settings': ( ('avatars_types', { 'value': ['gravatar', 'gallery'], 'type': "array", 'input': "mlist", 'extra': { 'choices': [('gravatar', _("Gravatar")), ('upload', _("Uploaded Avatar")), ('gallery', _("Avatars Gallery"))] }, 'separator': _("General Settings"), 'name': _("Allowed Avatars"), 'description': _("Select Avatar types allowed on your forum."),
from misago.settings.fixtures import load_settings_fixture, update_settings_fixture from misago.utils import ugettext_lazy as _ from misago.utils import get_msgid settings_fixtures = ( # Spam Countermeasures ( "spam", { "name": _("Spam Countermeasures"), "description": _( "Those settings allow you to combat automatic registrations and spam messages on your forum." ), "settings": ( ( "bots_registration", { "type": "string", "input": "choice", "extra": { "choices": [ ("", _("No protection")), ("recaptcha", _("reCaptcha")), ("qa", _("Question & Answer")), ] }, "separator": _("Spambots Registrations"), "name": _("CAPTCHA type"), "description": _( 'CAPTCHA stands for "Completely Automated Public Turing test to tell Computers and Humans Apart". Its type of test developed on purpose of blocking automatic registrations.'
from misago.settings.fixtures import load_settings_fixture, update_settings_fixture from misago.utils import ugettext_lazy as _ from misago.utils import get_msgid settings_fixtures = ( # Register and Sign-In Settings ('accounts', { 'name': _("Users Accounts Settings"), 'description': _("Those settings allow you to increase security of your members accounts."), 'settings': ( ('account_activation', { 'type': "string", 'input': "choice", 'extra': {'choices': [('', _("No validation required")), ('user', _("Activation Token sent to User")), ('admin', _("Activation by Administrator")), ('block', _("Dont allow new registrations"))]}, 'separator': _("Users Registrations"), 'name': _("New accounts validation"), }), ('default_timezone', { 'value': "utc", 'type': "string", 'input': "select", 'extra': {'choices': '#TZ#'}, 'name': _("Default Timezone"), 'description': _("Used by guests, crawlers and newly registered users."), }), ('username_length_min', { 'value': 3, 'type': "integer", 'input': "text", 'extra': {'min': 3}, 'separator': _("Users Names"),
from misago.settings.fixtures import load_settings_fixture, update_settings_fixture from misago.utils import ugettext_lazy as _ from misago.utils import get_msgid settings_fixtures = ( # Avatars Settings ('avatars', { 'name': _("Users Avatars Settings"), 'description': _("Those settings allow you to control your users avatars."), 'settings': ( ('avatars_types', { 'value': ['gravatar', 'gallery'], 'type': "array", 'input': "mlist", 'extra': {'choices': [('gravatar', _("Gravatar")), ('upload', _("Uploaded Avatar")), ('gallery', _("Avatars Gallery"))]}, 'separator': _("General Settings"), 'name': _("Allowed Avatars"), 'description': _("Select Avatar types allowed on your forum."), }), ('default_avatar', { 'value': "gravatar", 'type': "string", 'input': "select", 'extra': {'choices': [('gravatar', _("Gravatar")), ('gallery', _("Random Avatar from Gallery"))]}, 'name': _("Default Avatar"), 'description': _("Default Avatar assigned to new members. If you creade directory and name it \"_default\", forum will select random avatar from that directory instead of regular gallery. If no avatar can be picked from gallery, Gravatar will be used."), }), ('upload_limit', { 'value': 128, 'type': "integer", 'input': "text",
import base64 from misago.admin.models import Section, Action from misago.utils import ugettext_lazy as _ from misago.utils import get_msgid admin_fixtures = { # Overview 'overview': { 'name': _('Overview'), 'icon': 'signal', 'pos': 0, }, # Users 'users': { 'name': _('Users'), 'icon': 'user', 'pos': 100, }, # Forums 'forums': { 'name': _('Forums'), 'icon': 'comment', 'pos': 200, }, # Permissions 'permissions': { 'name': _('Permissions'), 'icon': 'adjust',
from misago.utils import ugettext_lazy as _ from misago.utils import get_msgid monitor_fixtures = { 'users': 0, 'users_inactive': 0, 'users_reported': 0, 'last_user': None, 'last_user_name': None, 'last_user_slug': None, } settings_fixtures = ( # Avatars Settings ('avatars', { 'name': _("Users Avatars Settings"), 'description': _("Those settings allow you to control your users avatars."), 'settings': ( ('avatars_types', { 'value': ['gravatar', 'gallery'], 'type': "array", 'input': "mlist", 'extra': {'choices': [('gravatar', _("Gravatar")), ('upload', _("Uploaded Avatar")), ('gallery', _("Avatars Gallery"))]}, 'separator': _("General Settings"), 'name': _("Allowed Avatars"), 'description': _("Select Avatar types allowed on your forum."), 'position': 0, }), ('default_avatar', { 'value': "gravatar", 'type': "string",
from misago.settings.fixtures import load_settings_fixture, update_settings_fixture from misago.utils import ugettext_lazy as _ from misago.utils import get_msgid settings_fixtures = ( # Threads Settings ('threads', { 'name': _("Threads and Posts Settings"), 'description': _("Those settings control your forum's threads and posts."), 'settings': ( ('thread_name_min', { 'value': 4, 'type': "integer", 'input': "text", 'extra': {'min': 1}, 'separator': _("Threads"), 'name': _("Min. Thread Name Length"), 'description': _('Minimal allowed thread name length.'), }), ('thread_name_max', { 'value': 60, 'type': "integer", 'input': "text", 'extra': {'min': 5, 'max': 100}, 'name': _("Max. Thread Name Length"), 'description': _('Maximum allowed thread name length.'), }), ('threads_per_page', { 'value': 40, 'type': "integer", 'input': "text",
import base64 from misago.settings.models import Group, Setting from misago.utils import ugettext_lazy as _ from misago.utils import get_msgid try: import cPickle as pickle except ImportError: import pickle settings_fixture = ( # Basic options ('basic', { 'name': _("Basic Settings"), 'settings': ( ('board_name', { 'value': "Misago", 'type': "string", 'input': "text", 'separator': _("Board Name"), 'name': _("Board Name"), 'position': 0, }), ('board_header', { 'type': "string", 'input': "text", 'name': _("Board Header"), 'description':
from misago.settings.fixtures import load_settings_fixture, update_settings_fixture from misago.utils import ugettext_lazy as _ from misago.utils import get_msgid settings_fixtures = ( # Register and Sign-In Settings ('signin', { 'name': _("Sign-In and Sessions Settings"), 'description': _("Those settings control behaviour of signed-in accounts."), 'settings': ( ('sessions_validate_ip', { 'value': True, 'type': "boolean", 'input': "yesno", 'separator': _("Sessions Settings"), 'name': _("Check IP on session authorization"), 'description': _("Makes sessions more secure, but can cause problems with proxies and VPN's."), }), ('remember_me_allow', { 'value': True, 'type': "boolean", 'input': "yesno", 'separator': _('"Remember Me" Feature'), 'name': _('Enable "Remember Me" feature'), 'description': _("Turning this option on allows users to sign in on to your board using cookie-based tokens. This may result in account compromisation when user fails to sign out on shared computer or his cookie is stolen."), }), ('remember_me_lifetime', { 'value': 90, 'type': "integer", 'input': "text", 'name': _('"Remember Me" token lifetime'),