2009-01-05 14:30:08 +02:00
from django . conf . urls . defaults import *
2009-08-02 19:51:00 +03:00
from forum import settings as forum_settings
from forum import views as forum_views
from openauth import views as openauth_views
2009-01-05 14:30:08 +02:00
urlpatterns = patterns ( ' ' ,
# Account
2009-09-04 16:16:33 +03:00
url ( r ' ^auth/registration/$ ' , openauth_views . registration , name = ' openauth-registration ' ) ,
url ( r ' ^auth/login/$ ' , openauth_views . login , name = ' openauth-login ' ) ,
url ( r ' ^auth/openid-login/$ ' , openauth_views . openid_login , name = ' openauth-openid-login ' ) ,
url ( r ' ^auth/openid-complete/$ ' , openauth_views . openid_complete , name = ' openauth-openid-complete ' ) ,
url ( r ' ^auth/openid-registration/$ ' , openauth_views . openid_registration , name = ' openauth-openid-registration ' ) ,
url ( r ' ^auth/logout/$ ' , openauth_views . logout , name = ' openauth-logout ' ) ,
url ( r ' ^auth/reset-password/$ ' , openauth_views . reset_password , name = ' openauth-reset-password ' ) ,
url ( r ' ^auth/change-password/$ ' , openauth_views . change_password , name = ' openauth-change-password ' ) ,
#(r'', include('confirmation.urls'))# needed for activation
2009-01-05 14:30:08 +02:00
# Misc
2009-08-02 19:51:00 +03:00
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 ' ) ,
2009-09-04 16:16:33 +03:00
2009-01-05 14:30:08 +02:00
# User
2009-08-02 19:51:00 +03:00
url ( ' ^user/(?P<username>.*)/$ ' , forum_views . user , name = ' forum_profile ' ) ,
url ( ' ^users/$ ' , forum_views . users , name = ' forum_users ' ) ,
2009-01-05 14:30:08 +02:00
# Topic
2009-08-02 19:51:00 +03:00
url ( ' ^topic/(?P<topic_id> \ d+)/$ ' , forum_views . show_topic , name = ' topic ' ) ,
url ( ' ^(?P<forum_id> \ d+)/topic/add/$ ' , forum_views . add_post ,
2009-01-05 14:30:08 +02:00
{ ' topic_id ' : None } , name = ' add_topic ' ) ,
2009-08-02 19:51:00 +03:00
url ( ' ^topic/(?P<topic_id> \ d+)/delete_posts/$ ' , forum_views . delete_posts , name = ' delete_posts ' ) ,
url ( ' ^topic/(?P<topic_id> \ d+)/move/$ ' , forum_views . move_topic , name = ' move_topic ' ) ,
url ( ' ^topic/(?P<topic_id> \ d+)/stick/$ ' , forum_views . stick_topic , name = ' stick_topic ' ) ,
url ( ' ^topic/(?P<topic_id> \ d+)/unstick/$ ' , forum_views . unstick_topic , name = ' unstick_topic ' ) ,
url ( ' ^topic/(?P<topic_id> \ d+)/close/$ ' , forum_views . close_topic , name = ' close_topic ' ) ,
url ( ' ^topic/(?P<topic_id> \ d+)/open/$ ' , forum_views . open_topic , name = ' open_topic ' ) ,
2009-01-05 14:30:08 +02:00
# Post
2009-08-02 19:51:00 +03:00
url ( ' ^topic/(?P<topic_id> \ d+)/post/add/$ ' , forum_views . add_post ,
2009-01-05 14:30:08 +02:00
{ ' forum_id ' : None } , name = ' add_post ' ) ,
2009-08-02 19:51:00 +03:00
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 ' ) ,
2009-01-05 14:30:08 +02:00
# Post preview
2009-08-02 19:51:00 +03:00
url ( r ' ^preview/$ ' , forum_views . post_preview ) ,
2009-01-05 14:30:08 +02:00
# Subscription
2009-08-02 19:51:00 +03:00
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 ' ) ,
2009-01-05 14:30:08 +02:00
)
2009-04-03 19:13:47 +03:00
### EXTENSIONS ###
# LOFI Extension
if ( forum_settings . LOFI_SUPPORT ) :
urlpatterns + = patterns ( ' ' ,
2009-08-02 19:51:00 +03:00
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 ' ) ,
2009-04-03 19:13:47 +03:00
)
# PM Extension
if ( forum_settings . PM_SUPPORT ) :
urlpatterns + = patterns ( ' ' ,
2009-08-02 19:51:00 +03:00
url ( ' ^pm/new/$ ' , forum_views . create_pm , name = ' forum_create_pm ' ) ,
url ( ' ^pm/outbox/$ ' , forum_views . pm_outbox , name = ' forum_pm_outbox ' ) ,
url ( ' ^pm/inbox/$ ' , forum_views . pm_inbox , name = ' forum_pm_inbox ' ) ,
url ( ' ^pm/show/(?P<pm_id> \ d+)/$ ' , forum_views . show_pm , name = ' forum_show_pm ' ) ,
2009-04-03 19:13:47 +03:00
)
# REPUTATION Extension
if ( forum_settings . REPUTATION_SUPPORT ) :
urlpatterns + = patterns ( ' ' ,
2009-08-02 19:51:00 +03:00
url ( ' ^reputation/(?P<username>.*)/$ ' , forum_views . reputation , name = ' reputation ' ) ,
2009-04-03 19:13:47 +03:00
)
2009-09-04 16:16:33 +03:00
2009-04-14 14:57:17 +03:00
# ATTACHMENT Extension
if ( forum_settings . ATTACHMENT_SUPPORT ) :
urlpatterns + = patterns ( ' ' ,
2009-08-02 19:51:00 +03:00
url ( ' ^attachment/(?P<hash> \ w+)/$ ' , forum_views . show_attachment , name = ' forum_attachment ' ) ,
)