diff --git a/.gitignore b/.gitignore index da23abb..46f377c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ -*.pyc -*.swp -*.sqlite +*.pyc +*.swp +*.sqlite +*.egg-info/ +build/ diff --git a/LICENSE b/LICENSE index 7512fbe..0b2f044 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,2 @@ BSD License http://creativecommons.org/licenses/BSD/ - -FluxBB Skin is base on FluxBB(by Paul Sullivan). -GPL -http://www.gnu.org/licenses/old-licenses/gpl-1.0.html diff --git a/MANIFEST.in b/MANIFEST.in index 603bbcc..af01bb0 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,7 +2,8 @@ include README.rst include LICENSE include MANIFEST.in include requirements.txt -recursive-include lbforum/locale * -recursive-include lbforum/templates *.html -recursive-include lbforum/templates_v2ex *.html recursive-include lbforum/static * +recursive-include lbforum/fixtures *.json +recursive-include lbforum/templates *.html *.txt +recursive-include lbforum/locale *.po *.mo +recursive-include docs * diff --git a/README.rst b/README.rst index 3101c21..41b9a15 100644 --- a/README.rst +++ b/README.rst @@ -6,13 +6,12 @@ LBForum .. |rst| replace:: :emphasis:`re`\ :strong:`Structured`\ :sup:`Text` -LBForum is a quick and simple forum which uses the Django Framework (written -in Python language). LBForum is a reusable Django application, can be added +LBForum is a quick and simple forum which uses the Django Framework (written +in Python language). LBForum is a reusable Django application, can be added to any existing django project. -LBForum is distributed under the BSD and GPL license. +LBForum is distributed under the BSD. -Demo site(Skin FluxBB): http://vik.haoluobo.com/lbforum/ -Demo site(Skin V2EX): http://vik.haoluobo.com/lbforum2/ +Demo site: http://vik.haoluobo.com/lbforum/ Demo site's source: https://github.com/vicalloy/lbforum-site @@ -23,7 +22,7 @@ Features * the ease of integration into any Django project and the ease of installation * classic view of the forum like FluxBB * Allow users to upload attachments to their posts(by AJAX). -* avatar support(Gravatar or user upload) +* avatar support * BBCode support * friendly edtor(by markItUp!). * Sticky threads (These threads are always sorted first in the list of threads) @@ -31,29 +30,11 @@ Features Requirements ============ -* `Python 2.5+`_ -* `Django 1.3+`_ -* PIL_ -* django-pagination_ -* `south 0.7.2+`_ -* postmarkup_ -* BeautifulSoup_ -* django-helper_ -* django-lb-attachments_ -* django-onlineuser_ -* django-simple-avatar_ - -.. _`Python 2.5+`: http://python.org/ -.. _`Django 1.3+`: http://www.djangoproject.com/ -.. _PIL: http://www.pythonware.com/products/pil/ -.. _django-pagination: http://code.google.com/p/django-pagination/ -.. _`south 0.7.2+`: http://south.aeracode.org/ -.. _BeautifulSoup: http://www.crummy.com/software/BeautifulSoup/ -.. _postmarkup: http://code.google.com/p/postmarkup/ -.. _django-helper: https://github.com/vicalloy/django-helper -.. _django-lb-attachments: https://github.com/vicalloy/django-lb-attachments -.. _django-onlineuser: https://github.com/vicalloy/onlineuser -.. _django-simple-avatar: https://github.com/vicalloy/django-simple-avatar +* `Python 2.7`_ +* `Django 1.10`_ + +.. _`Python 2.7`: http://python.org/ +.. _`Django 1.10`: http://www.djangoproject.com/ Installation ============ @@ -76,68 +57,66 @@ Configuration Config urls.py:: - (r'^attachments/', include('attachments.urls')), - (r'^', include('lbforum.urls')), + url(r'^', include('lbforum.urls')), + url(r'^attachments/', include('lbattachment.urls')), The LBForum has some settings should be set in `settings.py`: #. Add the following app to ``INSTALLED_APPS``:: - 'pagination', - 'south', + 'el_pagination', + 'easy_thumbnails', + 'constance', + 'constance.backends.database', + 'djangobower', + 'lbforum', - 'simpleavatar', - 'djangohelper', - 'onlineuser', - 'attachments', + 'lbattachment', + 'lbutils', -#. Add the following middleware to ``MIDDLEWARE_CLASSES``:: +#. Add the following middleware to ``TEMPLATES['OPTIONS']['context_processors']``:: - 'pagination.middleware.PaginationMiddleware', - 'onlineuser.middleware.OnlineUserMiddleware', + 'django.contrib.messages.context_processors.messages', -#. add ``"djangohelper.context_processors.ctx_config",`` to ``TEMPLATE_CONTEXT_PROCESSORS``:: - - TEMPLATE_CONTEXT_PROCESSORS = ( - "django.core.context_processors.auth", - "django.core.context_processors.debug", - "django.core.context_processors.i18n", - "django.core.context_processors.media", - "django.core.context_processors.static", - "django.core.context_processors.request", - - "djangohelper.context_processors.ctx_config", - ) - #. setting urls for lbforum:: - # URL prefix for lbforum media -- CSS, JavaScript and images. Make sure to use a - # trailing slash. - # Examples: "http://foo.com/media/", "/media/". + STATIC_URL = '/static/' + STATIC_ROOT = os.path.join(PRJ_ROOT, 'collectedstatic') + + HOST_URL = '' + MEDIA_URL_ = '/media/' + MEDIA_URL = HOST_URL + MEDIA_URL_ + MEDIA_ROOT = os.path.join(PRJ_ROOT, 'media') - #The URL where requests are redirected after login + SIGNUP_URL = '/accounts/signup/' + LOGIN_URL = '/accounts/login/' + LOGOUT_URL = '/accounts/logout/' LOGIN_REDIRECT_URL = '/' - #The URL where requests are redirected for login - LOGIN_URL = "/accounts/login/" - #LOGIN_URL counterpart - LOGOUT_URL = "/accounts/logout/" - #register url - REGISTER_URL = '%saccounts/register/' % ROOT_URL - -#. vars for templates:: + CHANGE_PASSWORD_URL = '/accounts/password/change/' + +#. settings for constance:: - CTX_CONFIG = { - 'LBFORUM_TITLE': 'LBForum', - 'LBFORUM_SUB_TITLE': 'A forum engine written in Python using Django', - 'FORUM_PAGE_SIZE': 50, - 'TOPIC_PAGE_SIZE': 20, + CONSTANCE_BACKEND = 'constance.backends.database.DatabaseBackend' + + CONSTANCE_CONFIG = { + 'forbidden_words': ('', 'Forbidden words', str), + } + +#. settings for bower:: + + from django.conf.global_settings import STATICFILES_FINDERS + STATICFILES_FINDERS += (('djangobower.finders.BowerFinder'),) + + BOWER_COMPONENTS_ROOT = PRJ_ROOT + + BOWER_INSTALLED_APPS = ( + 'jquery#1.12', + 'markitup#1.1.14', + 'mediaelement#2.22.0', + 'blueimp-file-upload#9.12.5', + ) - 'LOGIN_URL': LOGIN_URL, - 'LOGOUT_URL': LOGOUT_URL, - 'REGISTER_URL': REGISTER_URL, - } - #. settings for BBCODE:: BBCODE_AUTO_URLS = True @@ -170,22 +149,9 @@ The LBForum has some settings should be set in `settings.py`: 'usemap', 'valign', 'value', 'vspace', 'width', 'style'] """ -#. if you want to use skin v2ex, you should add the follow config to settings.py:: - - #always show topic post in topic page. - LBF_STICKY_TOPIC_POST = True - #show last topic in index page - LBF_LAST_TOPIC_NO_INDEX = True - #add v2ex template dir to TEMPLATE_DIRS - import lbforum - V2EX_TEMPLATE_DIR = os.path.join(lbforum.__path__[0], 'templates_v2ex') - TEMPLATE_DIRS = ( - os.path.join(HERE, 'templates_plus'), - os.path.join(HERE, 'templates_v2ex'), - V2EX_TEMPLATE_DIR, - ) - -Initialize The Database +Initialize The Database & Static Files ----------------------- +#. Run command ``manage.py bower install`` + #. Run command ``manage.py migrate`` diff --git a/lbforum/fixtures/test_lbforum.json b/lbforum/fixtures/test_lbforum.json index 583d808..745f5b4 100644 --- a/lbforum/fixtures/test_lbforum.json +++ b/lbforum/fixtures/test_lbforum.json @@ -39,11 +39,11 @@ "pk": 1, "model": "lbforum.category", "fields": { - "ordering": 1, + "oid": 1, "updated_on": null, "created_on": "2012-10-30T04:44:26.852", "name": "category", - "description": "category" + "descn": "category" } }, { @@ -52,12 +52,11 @@ "fields": { "category": 1, "description": "a test forum", - "ordering": 1, + "oid": 1, "created_on": "2012-10-30T04:44:51.666", "num_posts": 4, "updated_on": null, "num_topics": 2, - "last_post": "gAJ9cQAoVQlwb3N0ZWRfYnlxAVgIAAAAdmljYWxsb3lxAlUGdXBkYXRlcQNjZGF0ZXRpbWUKZGF0ZXRpbWUKcQRVCgfcCh4UEywAnpdxBYVxBlJxB3Uu", "slug": "forum", "name": "forum" } @@ -91,7 +90,6 @@ "updated_on": null, "post": 1, "sticky": false, - "last_post": "gAJ9cQAoVQlwb3N0ZWRfYnlxAVgIAAAAdmljYWxsb3lxAlUGdXBkYXRlcQNjZGF0ZXRpbWUKZGF0ZXRpbWUKcQRVCgfcCh4UEywAnpdxBYVxBlJxB3Uu", "posted_by": 2, "last_reply_on": "2012-10-30T20:19:44.040", "subject": "topic" @@ -116,7 +114,6 @@ "updated_on": null, "post": 2, "sticky": false, - "last_post": "gAJ9cQAoVQlwb3N0ZWRfYnlxAVgFAAAAYWRtaW5xAlUGdXBkYXRlcQNjZGF0ZXRpbWUKZGF0ZXRpbWUKcQRVCgfcCh4UEi8OwB1xBYVxBlJxB3Uu", "posted_by": 1, "last_reply_on": "2012-10-30T20:18:47.966", "subject": "topic" @@ -136,8 +133,7 @@ "topic_post": false, "updated_on": null, "has_attachments": false, - "message": "user reply", - "edited_by": "" + "message": "user reply" } }, { @@ -154,8 +150,7 @@ "topic_post": false, "updated_on": null, "has_attachments": false, - "message": "reply", - "edited_by": "" + "message": "reply" } }, { @@ -172,8 +167,7 @@ "topic_post": true, "updated_on": null, "has_attachments": false, - "message": "test topic", - "edited_by": "" + "message": "test topic" } }, { @@ -190,30 +184,21 @@ "topic_post": true, "updated_on": null, "has_attachments": false, - "message": "topic content.", - "edited_by": "" + "message": "topic content." } }, { "pk": 1, "model": "lbforum.lbforumuserprofile", "fields": { - "last_activity": "2012-10-30T20:19:06.046", - "userrank": "Junior Member", - "signature": "", - "user": 1, - "last_posttime": "2012-10-30T20:18:47.966" + "user": 1 } }, { "pk": 2, "model": "lbforum.lbforumuserprofile", "fields": { - "last_activity": "2012-10-30T20:19:56.574", - "userrank": "Junior Member", - "signature": "", - "user": 2, - "last_posttime": "2012-10-30T20:19:44.040" + "user": 2 } } ] diff --git a/lbforum/templates/lbforum/topic.html b/lbforum/templates/lbforum/topic.html index 647ebd4..a25fa8f 100644 --- a/lbforum/templates/lbforum/topic.html +++ b/lbforum/templates/lbforum/topic.html @@ -15,6 +15,11 @@ {% include 'lbforum/widgets/cur_user_profile.html' %} {% endblock %} +{% block extra_header %} + {{ block.super }} + +{% endblock %} + {% block content_content %} {% paginate posts %} {% get_pages %}