forums.py 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. 'route': 'admin_forums'
  19. },
  20. {
  21. 'id': 'new',
  22. 'name': _("New Node"),
  23. 'help': _("Create new forums tree node"),
  24. 'route': 'admin_forums_new'
  25. },
  26. ],
  27. route='admin_forums',
  28. urlpatterns=patterns('misago.apps.admin.forums.views',
  29. url(r'^$', 'List', name='admin_forums'),
  30. url(r'^new/$', 'NewNode', name='admin_forums_new'),
  31. url(r'^up/(?P<slug>([a-z0-9]|-)+)-(?P<target>\d+)/$', 'Up', name='admin_forums_up'),
  32. url(r'^down/(?P<slug>([a-z0-9]|-)+)-(?P<target>\d+)/$', 'Down', name='admin_forums_down'),
  33. url(r'^edit/(?P<slug>([a-z0-9]|-)+)-(?P<target>\d+)/$', 'Edit', name='admin_forums_edit'),
  34. url(r'^delete/(?P<slug>([a-z0-9]|-)+)-(?P<target>\d+)/$', 'Delete', name='admin_forums_delete'),
  35. ),
  36. ),
  37. AdminAction(
  38. section='forums',
  39. id='labels',
  40. name=_("Thread Labels"),
  41. help=_("Thread Labels allow you to group threads together within forums."),
  42. icon='tags',
  43. route='admin_forums_labels',
  44. urlpatterns=patterns('misago.apps.admin.index',
  45. url(r'^$', 'todo', name='admin_forums_labels'),
  46. ),
  47. ),
  48. AdminAction(
  49. section='forums',
  50. id='badwords',
  51. name=_("Words Filter"),
  52. help=_("Forbid usage of words in messages"),
  53. icon='volume-off',
  54. route='admin_forums_badwords',
  55. urlpatterns=patterns('misago.apps.admin.index',
  56. url(r'^$', 'todo', name='admin_forums_badwords'),
  57. ),
  58. ),
  59. AdminAction(
  60. section='forums',
  61. id='tests',
  62. name=_("Tests"),
  63. help=_("Tests that new messages have to pass"),
  64. icon='filter',
  65. route='admin_forums_tests',
  66. urlpatterns=patterns('misago.apps.admin.index',
  67. url(r'^$', 'todo', name='admin_forums_tests'),
  68. ),
  69. ),
  70. AdminAction(
  71. section='forums',
  72. id='attachments',
  73. name=_("Attachments"),
  74. help=_("Manage allowed attachment types."),
  75. icon='download-alt',
  76. route='admin_forums_attachments',
  77. urlpatterns=patterns('misago.apps.admin.index',
  78. url(r'^$', 'todo', name='admin_forums_attachments'),
  79. ),
  80. ),
  81. )