def include_css(csspath, prefix = None):
    styleincludes = sphsettings.get_sph_setting( 'community_styleincludes', [])

    if csspath in styleincludes:
        return

    if prefix is None:
        prefix = settings.MEDIA_URL
    styleincludes.append(prefix + csspath)
    sphsettings.set_sph_setting( 'community_styleincludes', styleincludes )
Esempio n. 2
0
def include_css(csspath, prefix=None):
    styleincludes = sphsettings.get_sph_setting('community_styleincludes', [])

    if csspath in styleincludes:
        return

    if prefix is None:
        prefix = settings.MEDIA_URL
    styleincludes.append(prefix + csspath)
    sphsettings.set_sph_setting('community_styleincludes', styleincludes)
def include_js(jspath, prefix = None):
    jsincludes = get_sph_setting( 'community_jsincludes', [])

    if jspath in jsincludes:
        return

    if prefix is None:
        prefix = settings.MEDIA_URL
    jsincludes.append(prefix + jspath)

    sphsettings.set_sph_setting( 'community_jsincludes', jsincludes )
Esempio n. 4
0
def include_js(jspath, prefix=None):
    jsincludes = get_sph_setting('community_jsincludes', [])

    if jspath in jsincludes:
        return

    if prefix is None:
        prefix = settings.MEDIA_URL
    jsincludes.append(prefix + jspath)

    sphsettings.set_sph_setting('community_jsincludes', jsincludes)
Esempio n. 5
0
    def ready(self):
        from sphene.community.sphutils import get_sph_setting
        from sphene.community import sphsettings
        jsincludes = get_sph_setting( 'community_jsincludes', [])
        # jquery is already added by the community application.
        #jsincludes.append(settings.STATIC_URL + 'sphene/community/jquery-1.2.3.min.js')
        jsincludes.append(settings.STATIC_URL + 'sphene/community/jquery.dimensions.js')
        jsincludes.append(settings.STATIC_URL + 'sphene/community/ui.mouse.js')
        #jsincludes.append(settings.STATIC_URL + 'sphene/community/ui.draggable.js')
        jsincludes.append(settings.STATIC_URL + 'sphene/community/ui.droppable.js')
        jsincludes.append(settings.STATIC_URL + 'sphene/community/ui.sortable.js')
        jsincludes.append(settings.STATIC_URL + 'sphene/sphblockframework/blocksorting.js')

        sphsettings.set_sph_setting( 'community_jsincludes', jsincludes )
Esempio n. 6
0
    pass

# We can't import it as 'forms' because we've got a package called 'forms' .. how smart.
from django import forms as djangoforms
from django.conf import settings
from sphene.community.forms import EditProfileForm
from sphene.community.signals import profile_edit_init_form, profile_edit_save_form, profile_display
from sphene.community.sphutils import get_sph_setting
from sphene.community.models import CommunityUserProfile
from sphene.community import sphsettings
from django.utils.translation import ugettext as _

jsincludes = get_sph_setting( 'community_jsincludes', [])
jsincludes.append(settings.STATIC_URL + 'sphene/community/jquery-1.7.2.min.js')
jsincludes.append(settings.STATIC_URL + 'sphene/community/jquery.autocomplete.js')
sphsettings.set_sph_setting( 'community_jsincludes', jsincludes )


####
#
# Source code for adding an avatar .. (advanced community profile)
#
def clean_community_advprofile_avatar(self):
    f = self.cleaned_data['community_advprofile_avatar']
    if f is None:
        return f

    # Verify file size ..
    size = len(self.cleaned_data['community_advprofile_avatar'])
    max_size = get_sph_setting( 'community_avatar_max_size' )
    if size > max_size:
Esempio n. 7
0
from django.conf import settings
from sphene.community import sphsettings
from sphene.community.sphutils import get_sph_setting

jsincludes = get_sph_setting('community_jsincludes', [])
# jquery is already added by the community application.
#jsincludes.append(settings.STATIC_URL + 'sphene/community/jquery-1.2.3.min.js')
jsincludes.append(settings.STATIC_URL +
                  'sphene/community/jquery.dimensions.js')
jsincludes.append(settings.STATIC_URL + 'sphene/community/ui.mouse.js')
#jsincludes.append(settings.STATIC_URL + 'sphene/community/ui.draggable.js')
jsincludes.append(settings.STATIC_URL + 'sphene/community/ui.droppable.js')
jsincludes.append(settings.STATIC_URL + 'sphene/community/ui.sortable.js')
jsincludes.append(settings.STATIC_URL +
                  'sphene/sphblockframework/blocksorting.js')

sphsettings.set_sph_setting('community_jsincludes', jsincludes)
# We can't import it as 'forms' because we've got a package called 'forms' .. how smart.
from django import forms as djangoforms
from django.conf import settings
from sphene.community.forms import EditProfileForm, Separator
from sphene.community.signals import profile_edit_init_form, profile_edit_save_form, profile_display
from sphene.community.sphutils import get_sph_setting
from sphene.community.models import CommunityUserProfile
from sphene.community import sphsettings
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy

jsincludes = get_sph_setting("community_jsincludes", [])
jsincludes.append(settings.MEDIA_URL + "sphene/community/jquery-1.2.3.min.js")
jsincludes.append(settings.MEDIA_URL + "sphene/community/jquery.autocomplete.js")
sphsettings.set_sph_setting("community_jsincludes", jsincludes)


####
#
# Source code for adding an avatar .. (advanced community profile)
#


def clean_community_advprofile_avatar(self):
    f = self.cleaned_data["community_advprofile_avatar"]
    if f is None:
        return f

    # Verify file size ..
    size = len(self.cleaned_data["community_advprofile_avatar"])
Esempio n. 9
0
    def ready(self):
        from sphene.community import sphsettings
        from sphene.community.sphutils import add_setting_defaults
        from django.conf import settings

        post_migrate.connect(init_data, sender=self)

        add_setting_defaults({
            'board_count_views': True,
            'board_heat_days': 30,
            'board_heat_post_threshold': 10,
            'board_heat_view_threshold': 100,
            'board_heat_calculator': 'sphene.sphboard.models.calculate_heat',

            # Defines if the 'Notify Me' checkbox should be selected by default.
            'board_default_notifyme': True,

            # How long a user is allowed to edit his post in seconds.
            # -1: forever,
            # 0: never
            'board_edit_timeout': -1,  # 30 * 60,

            # How long a user is allowed to hide his post in seconds.
            # -1: forever,
            # 0: never
            'board_hide_timeout': -1,  # 30 * 60,

            # Timeout for the rendered body in the cache
            # Default 6 hours
            'board_body_cache_timeout': 6 * 3600,
            'board_signature_cache_timeout': 6 * 3600,
            'board_signature_required_post_count': 0,
            'board_no_limits_users': [],
            'board_authorinfo_cache_timeout': 6 * 3600,

            # See http://code.djangoproject.com/ticket/4789
            # When activating this setting, select_related() will not be used.
            'workaround_select_related_bug': False,

            'board_post_paging': 10,

            # Allow users to attach files to their posts ?
            'board_allow_attachments': True,

            # Pass the board and blog posts through the wiki camel case
            # markup. This will allow wiki links to be automatically placed
            # into the posts. It is better to turn this off and use the
            # sph extended BBCODE wiki label.
            'board_auto_wiki_link_enabled': True,
            # default location of emoticons
            'board_emoticons_root': settings.STATIC_URL + 'sphene/emoticons/',
            'board_emoticons_list': {
                '0:-)': 'angel.gif',
                'O:-)': 'angel.gif',
                ':angel:': 'angel.gif',
                ':)': 'smile.gif',
                ':(': 'sad.gif',
                ':D': 'grin.gif',
                ':p': 'tongue.gif',
                ';)': 'wink.gif',
                ':-)': 'smile.gif',
                ':-(': 'sad.gif',
                ':-D': 'grin.gif',
                ':-P': 'tongue.gif',
                ':-p': 'tongue.gif',
                ':-/': 'unsure.gif',
                ':-\\': 'unsure.gif',
                ';-)': 'wink.gif',
                ':-$': 'confused.gif',
                ':-S': 'confused.gif',
                'B-)': 'cool.gif',
                ':lol:': 'lol.gif',
                ':batman:': 'batman.gif',
                ':rolleyes:': 'rolleyes.gif',
                ':icymad:': 'bluemad.gif',
                ':mad:': 'mad.gif',
                ':crying:': 'crying.gif',
                ':eek:': 'eek.gif',
                ':eyebrow:': 'eyebrow.gif',
                ':grim:': 'grim_reaper.gif',
                ':idea:': 'idea.gif',
                ':rotfl:': 'rotfl.gif',
                ':shifty:': 'shifty.gif',
                ':sleep:': 'sleep.gif',
                ':thinking:': 'thinking.gif',
                ':wave:': 'wave.gif',
                ':bow:': 'bow.gif',
                ':sheep:': 'sheep.gif',
                ':santa:': 'santaclaus.gif',
                ':anvil:': 'anvil.gif',
                ':bandit:': 'bandit.gif',
                ':chop:': 'behead.gif',
                ':biggun:': 'biggun.gif',
                ':mouthful:': 'blowingup,gif',
                ':gun:': 'bluekillsred.gif',
                ':box:': 'boxing.gif',
                ':gallows:': 'hanged.gif',
                ':jedi:': 'lightsaber1.gif',
                ':bosh:': 'mallet1.gif',
                ':saw:': 'saw.gif',
                ':stupid:': 'youarestupid.gif',
            },

            # default tag used when rendering user signatures in posts
            'board_signature_tag': '<div class="signature">%(signature)s</div>',

            # default link in board posts
            'board_post_link': '<a href="%(url)s">%(text)s</a>',

            'board_attachments_upload_to': 'var/sphene/sphwiki/attachment/%Y/%m/%d',

            'board_slugify_links': True,

            # Display the reply form directly below a thread instead of just a 'Post Reply' link.
            'board_quick_reply': False,

            # Activates the experimental WYSIWYG editor -
            #   only if 'bbcode' is the only markup choice.
            # If you are using it, please provide feedback in the
            # forums at http://sct.spene.net !
            'board_wysiwyg': False,
            # This options let users test the wysiwyg editor by appending
            # ?wysiwyg=1 to the post URL. (I just added it so it can be seen on
            # sct.sphene.net and tested by users.)
            'board_wysiwyg_testing': False,
        })

        styleincludes = sphsettings.get_sph_setting('community_styleincludes', [])
        styleincludes.append(settings.STATIC_URL + 'sphene/sphboard/styles/base.css')
        sphsettings.set_sph_setting('community_styleincludes', styleincludes)
Esempio n. 10
0
    def ready(self):
        from sphene.community import sphsettings
        from sphene.community.sphutils import add_setting_defaults
        from django.conf import settings

        post_migrate.connect(init_data, sender=self)

        add_setting_defaults({
            'board_count_views': True,
            'board_heat_days': 30,
            'board_heat_post_threshold': 10,
            'board_heat_view_threshold': 100,
            'board_heat_calculator': 'sphene.sphboard.models.calculate_heat',

            # Defines if the 'Notify Me' checkbox should be selected by default.
            'board_default_notifyme': True,

            # How long a user is allowed to edit his post in seconds.
            # -1: forever,
            # 0: never
            'board_edit_timeout': -1,  # 30 * 60,

            # How long a user is allowed to hide his post in seconds.
            # -1: forever,
            # 0: never
            'board_hide_timeout': -1,  # 30 * 60,

            # Timeout for the rendered body in the cache
            # Default 6 hours
            'board_body_cache_timeout': 6 * 3600,
            'board_signature_cache_timeout': 6 * 3600,
            'board_signature_required_post_count': 0,
            'board_no_limits_users': [],
            'board_authorinfo_cache_timeout': 6 * 3600,

            # See http://code.djangoproject.com/ticket/4789
            # When activating this setting, select_related() will not be used.
            'workaround_select_related_bug': False,
            'board_post_paging': 10,

            # Allow users to attach files to their posts ?
            'board_allow_attachments': True,

            # Pass the board and blog posts through the wiki camel case
            # markup. This will allow wiki links to be automatically placed
            # into the posts. It is better to turn this off and use the
            # sph extended BBCODE wiki label.
            'board_auto_wiki_link_enabled': True,
            # default location of emoticons
            'board_emoticons_root': settings.STATIC_URL + 'sphene/emoticons/',
            'board_emoticons_list': {
                '0:-)': 'angel.gif',
                'O:-)': 'angel.gif',
                ':angel:': 'angel.gif',
                ':)': 'smile.gif',
                ':(': 'sad.gif',
                ':D': 'grin.gif',
                ':p': 'tongue.gif',
                ';)': 'wink.gif',
                ':-)': 'smile.gif',
                ':-(': 'sad.gif',
                ':-D': 'grin.gif',
                ':-P': 'tongue.gif',
                ':-p': 'tongue.gif',
                ':-/': 'unsure.gif',
                ':-\\': 'unsure.gif',
                ';-)': 'wink.gif',
                ':-$': 'confused.gif',
                ':-S': 'confused.gif',
                'B-)': 'cool.gif',
                ':lol:': 'lol.gif',
                ':batman:': 'batman.gif',
                ':rolleyes:': 'rolleyes.gif',
                ':icymad:': 'bluemad.gif',
                ':mad:': 'mad.gif',
                ':crying:': 'crying.gif',
                ':eek:': 'eek.gif',
                ':eyebrow:': 'eyebrow.gif',
                ':grim:': 'grim_reaper.gif',
                ':idea:': 'idea.gif',
                ':rotfl:': 'rotfl.gif',
                ':shifty:': 'shifty.gif',
                ':sleep:': 'sleep.gif',
                ':thinking:': 'thinking.gif',
                ':wave:': 'wave.gif',
                ':bow:': 'bow.gif',
                ':sheep:': 'sheep.gif',
                ':santa:': 'santaclaus.gif',
                ':anvil:': 'anvil.gif',
                ':bandit:': 'bandit.gif',
                ':chop:': 'behead.gif',
                ':biggun:': 'biggun.gif',
                ':mouthful:': 'blowingup,gif',
                ':gun:': 'bluekillsred.gif',
                ':box:': 'boxing.gif',
                ':gallows:': 'hanged.gif',
                ':jedi:': 'lightsaber1.gif',
                ':bosh:': 'mallet1.gif',
                ':saw:': 'saw.gif',
                ':stupid:': 'youarestupid.gif',
            },

            # default tag used when rendering user signatures in posts
            'board_signature_tag':
            '<div class="signature">%(signature)s</div>',

            # default link in board posts
            'board_post_link': '<a href="%(url)s">%(text)s</a>',
            'board_attachments_upload_to':
            'var/sphene/sphwiki/attachment/%Y/%m/%d',
            'board_slugify_links': True,

            # Display the reply form directly below a thread instead of just a 'Post Reply' link.
            'board_quick_reply': False,

            # Activates the experimental WYSIWYG editor -
            #   only if 'bbcode' is the only markup choice.
            # If you are using it, please provide feedback in the
            # forums at http://sct.spene.net !
            'board_wysiwyg': False,
            # This options let users test the wysiwyg editor by appending
            # ?wysiwyg=1 to the post URL. (I just added it so it can be seen on
            # sct.sphene.net and tested by users.)
            'board_wysiwyg_testing': False,
        })

        styleincludes = sphsettings.get_sph_setting('community_styleincludes',
                                                    [])
        styleincludes.append(settings.STATIC_URL +
                             'sphene/sphboard/styles/base.css')
        sphsettings.set_sph_setting('community_styleincludes', styleincludes)
Esempio n. 11
0
    },

    # default tag used when rendering user signatures in posts
    'board_signature_tag':'<div class="signature">%(signature)s</div>',

    # default link in board posts
    'board_post_link':'<a href="%(url)s">%(text)s</a>',

    'board_attachments_upload_to': 'var/sphene/sphwiki/attachment/%Y/%m/%d',

    'board_slugify_links': True,

    # Display the reply form directly below a thread instead of just a 'Post Reply' link.
    'board_quick_reply': False,

    # Activates the experimental WYSIWYG editor -
    #   only if 'bbcode' is the only markup choice.
    # If you are using it, please provide feedback in the
    # forums at http://sct.spene.net !
    'board_wysiwyg': False,
    # This options let users test the wysiwyg editor by appending
    # ?wysiwyg=1 to the post URL. (I just added it so it can be seen on
    # sct.sphene.net and tested by users.)
    'board_wysiwyg_testing': False,
    })


styleincludes = sphsettings.get_sph_setting( 'community_styleincludes', [])
styleincludes.append(settings.STATIC_URL + 'sphene/sphboard/styles/base.css')
sphsettings.set_sph_setting( 'community_styleincludes', styleincludes )
Esempio n. 12
0
    6 * 3600,
    'board_signature_cache_timeout':
    6 * 3600,
    'board_authorinfo_cache_timeout':
    6 * 3600,

    # See http://code.djangoproject.com/ticket/4789
    # When activating this setting, select_related() will not be used.
    'workaround_select_related_bug':
    False,
    'board_post_paging':
    10,

    # Allow users to attach files to their posts ?
    'board_allow_attachments':
    True,

    # Pass the board and blog posts through the wiki camel case
    # markup. This will allow wiki links to be automatically placed
    # into the posts. It is better to turn this off and use the
    # sph extended BBCODE wiki label.
    'board_auto_wiki_link_enabled':
    True,
    'board_attachments_upload_to':
    'var/sphene/sphwiki/attachment/%Y/%m/%d',
})

styleincludes = sphsettings.get_sph_setting('community_styleincludes', [])
styleincludes.append(settings.MEDIA_URL + 'sphene/sphboard/styles/base.css')
sphsettings.set_sph_setting('community_styleincludes', styleincludes)