This repository has been archived on 2025-05-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
s2forums/djangobb_forum/urls.py

102 lines
4.8 KiB
Python

from django.conf.urls.defaults import *
from djangobb_forum import settings as forum_settings
from djangobb_forum import views as forum_views
from djangobb_forum.feeds import LastPosts, LastTopics, LastPostsOnForum, \
LastPostsOnCategory, LastPostsOnTopic
from djangobb_forum.forms import EssentialsProfileForm, \
PersonalProfileForm, MessagingProfileForm, PersonalityProfileForm, \
DisplayProfileForm, PrivacyProfileForm, UploadAvatarForm
urlpatterns = patterns('',
# Forum
url('^$', forum_views.index, name='index'),
url('^(?P<forum_id>\d+)/$', forum_views.show_forum, name='forum'),
url('^moderate/(?P<forum_id>\d+)/$', forum_views.moderate, name='moderate'),
url('^search/$', forum_views.search, name='search'),
url('^misc/$', forum_views.misc, name='misc'),
# User
url('^user/(?P<username>.*)/upload_avatar/$', forum_views.upload_avatar, {
'form_class': UploadAvatarForm,
'template': 'djangobb_forum/upload_avatar.html'
}, name='forum_profile_upload_avatar'),
url('^user/(?P<username>.*)/privacy/$', forum_views.user, {
'section': 'privacy',
'form_class': PrivacyProfileForm,
'template': 'djangobb_forum/profile/profile_privacy.html'
}, name='forum_profile_privacy'),
url('^user/(?P<username>.*)/display/$', forum_views.user, {
'section': 'display',
'form_class': DisplayProfileForm,
'template': 'djangobb_forum/profile/profile_display.html'
}, name='forum_profile_display'),
url('^user/(?P<username>.*)/personality/$', forum_views.user, {
'section': 'personality',
'form_class': PersonalityProfileForm,
'template': 'djangobb_forum/profile/profile_personality.html'
}, name='forum_profile_personality'),
url('^user/(?P<username>.*)/messaging/$', forum_views.user, {
'section': 'messaging',
'form_class': MessagingProfileForm,
'template': 'djangobb_forum/profile/profile_messaging.html'
}, name='forum_profile_messaging'),
url('^user/(?P<username>.*)/personal/$', forum_views.user, {
'section': 'personal',
'form_class': PersonalProfileForm,
'template': 'djangobb_forum/profile/profile_personal.html'
}, name='forum_profile_personal'),
url('^user/(?P<username>.*)/essentials/$', forum_views.user, name='forum_profile_essentials'),
url('^user/(?P<username>.*)/$', forum_views.user, name='forum_profile'),
url('^users/$', forum_views.users, name='forum_users'),
# Topic
url('^topic/(?P<topic_id>\d+)/$', forum_views.show_topic, name='topic'),
url('^(?P<forum_id>\d+)/topic/add/$', forum_views.add_topic, name='add_topic'),
url('^topic/(?P<topic_id>\d+)/delete_posts/$', forum_views.delete_posts, name='delete_posts'),
url('^topic/move/$', forum_views.move_topic, name='move_topic'),
url('^topic/(?P<topic_id>\d+)/stick_unstick/(?P<action>[s|u])/$', forum_views.stick_unstick_topic, name='stick_unstick_topic'),
url('^topic/(?P<topic_id>\d+)/open_close/(?P<action>[c|o])/$', forum_views.open_close_topic, name='open_close_topic'),
# Post
url('^post/(?P<post_id>\d+)/$', forum_views.show_post, name='post'),
url('^post/(?P<post_id>\d+)/edit/$', forum_views.edit_post, name='edit_post'),
url('^post/(?P<post_id>\d+)/delete/$', forum_views.delete_post, name='delete_post'),
# Post preview
url(r'^preview/$', forum_views.post_preview, name='post_preview'),
# Subscription
url('^subscription/topic/(?P<topic_id>\d+)/delete/$', forum_views.delete_subscription, name='forum_delete_subscription'),
url('^subscription/topic/(?P<topic_id>\d+)/add/$', forum_views.add_subscription, name='forum_add_subscription'),
# Feeds
url(r'^feeds/posts/$', LastPosts(), name='forum_posts_feed'),
url(r'^feeds/topics/$', LastTopics(), name='forum_topics_feed'),
url(r'^feeds/topic/(?P<topic_id>\d+)/$', LastPostsOnTopic(), name='forum_topic_feed'),
url(r'^feeds/forum/(?P<forum_id>\d+)/$', LastPostsOnForum(), name='forum_forum_feed'),
url(r'^feeds/category/(?P<category_id>\d+)/$', LastPostsOnCategory(), name='forum_category_feed'),
)
### EXTENSIONS ###
# LOFI Extension
if (forum_settings.LOFI_SUPPORT):
urlpatterns += patterns('',
url('^lofi/$', forum_views.index, {'full':False}, name='lofi_index'),
url('^(?P<forum_id>\d+)/lofi/$', forum_views.show_forum, {'full':False}, name='lofi_forum'),
url('^topic/(?P<topic_id>\d+)/lofi/$', forum_views.show_topic, {'full':False}, name='lofi_topic'),
)
# REPUTATION Extension
if (forum_settings.REPUTATION_SUPPORT):
urlpatterns += patterns('',
url('^reputation/(?P<username>.*)/$', forum_views.reputation, name='reputation'),
)
# ATTACHMENT Extension
if (forum_settings.ATTACHMENT_SUPPORT):
urlpatterns += patterns('',
url('^attachment/(?P<hash>\w+)/$', forum_views.show_attachment, name='forum_attachment'),
)