forums.py 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. from django.conf.urls import patterns, include, url
  2. from django.utils.translation import ugettext_lazy as _
  3. from misago.admin import AdminAction
  4. from misago.models import Forum
  5. ADMIN_ACTIONS = (
  6. AdminAction(
  7. section='forums',
  8. id='forums',
  9. name=_("Forums List"),
  10. help=_("Create, edit and delete forums."),
  11. icon='comment',
  12. model=Forum,
  13. actions=[
  14. {
  15. 'id': 'list',
  16. 'name': _("Forums List"),
  17. 'help': _("All existing forums"),
  18. 'link': 'admin_forums'
  19. },
  20. {
  21. 'id': 'new',
  22. 'name': _("New Node"),
  23. 'help': _("Create new forums tree node"),
  24. 'link': 'admin_forums_new'
  25. },
  26. ],
  27. link='admin_forums',
  28. urlpatterns=patterns('misago.apps.admin.forums.views',
  29. url(r'^$', 'List', name='admin_forums'),
  30. url(r'^sync/$', 'resync_forums', name='admin_forums_resync'),
  31. url(r'^sync/(?P<forum>\d+)/(?P<progress>\d+)/$', 'resync_forums', name='admin_forums_resync'),
  32. url(r'^new/$', 'NewNode', name='admin_forums_new'),
  33. url(r'^up/(?P<slug>([a-z0-9]|-)+)-(?P<target>\d+)/$', 'Up', name='admin_forums_up'),
  34. url(r'^down/(?P<slug>([a-z0-9]|-)+)-(?P<target>\d+)/$', 'Down', name='admin_forums_down'),
  35. url(r'^edit/(?P<slug>([a-z0-9]|-)+)-(?P<target>\d+)/$', 'Edit', name='admin_forums_edit'),
  36. url(r'^delete/(?P<slug>([a-z0-9]|-)+)-(?P<target>\d+)/$', 'Delete', name='admin_forums_delete'),
  37. ),
  38. ),
  39. AdminAction(
  40. section='forums',
  41. id='labels',
  42. name=_("Thread Labels"),
  43. help=_("Thread Labels allow you to group threads together within forums."),
  44. icon='tags',
  45. link='admin_forums_labels',
  46. urlpatterns=patterns('misago.apps.admin.index',
  47. url(r'^$', 'todo', name='admin_forums_labels'),
  48. ),
  49. ),
  50. AdminAction(
  51. section='forums',
  52. id='badwords',
  53. name=_("Words Filter"),
  54. help=_("Forbid usage of words in messages"),
  55. icon='volume-off',
  56. link='admin_forums_badwords',
  57. urlpatterns=patterns('misago.apps.admin.index',
  58. url(r'^$', 'todo', name='admin_forums_badwords'),
  59. ),
  60. ),
  61. AdminAction(
  62. section='forums',
  63. id='tests',
  64. name=_("Tests"),
  65. help=_("Tests that new messages have to pass"),
  66. icon='filter',
  67. link='admin_forums_tests',
  68. urlpatterns=patterns('misago.apps.admin.index',
  69. url(r'^$', 'todo', name='admin_forums_tests'),
  70. ),
  71. ),
  72. AdminAction(
  73. section='forums',
  74. id='attachments',
  75. name=_("Attachments"),
  76. help=_("Manage allowed attachment types."),
  77. icon='download-alt',
  78. link='admin_forums_attachments',
  79. urlpatterns=patterns('misago.apps.admin.index',
  80. url(r'^$', 'todo', name='admin_forums_attachments'),
  81. ),
  82. ),
  83. )