forums.py 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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, ThreadPrefix, AttachmentType
  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='prefixes',
  42. name=_("Thread Prefixes"),
  43. help=_("Thread Prefix allow you to group and classify threads together within forums."),
  44. icon='tags',
  45. model=ThreadPrefix,
  46. actions=[
  47. {
  48. 'id': 'list',
  49. 'name': _("Prefixes List"),
  50. 'help': _("All existing prefixes"),
  51. 'link': 'admin_threads_prefixes'
  52. },
  53. {
  54. 'id': 'new',
  55. 'name': _("Add Prefix"),
  56. 'help': _("Create new threads prefix"),
  57. 'link': 'admin_threads_prefixes_new'
  58. },
  59. ],
  60. link='admin_threads_prefixes',
  61. urlpatterns=patterns('misago.apps.admin.prefixes.views',
  62. url(r'^$', 'List', name='admin_threads_prefixes'),
  63. url(r'^new/$', 'New', name='admin_threads_prefixes_new'),
  64. url(r'^edit/(?P<slug>([a-z0-9]|-)+)-(?P<target>\d+)/$', 'Edit', name='admin_threads_prefixes_edit'),
  65. url(r'^delete/(?P<slug>([a-z0-9]|-)+)-(?P<target>\d+)/$', 'Delete', name='admin_threads_prefixes_delete'),
  66. ),
  67. ),
  68. AdminAction(
  69. section='forums',
  70. id='badwords',
  71. name=_("Words Filter"),
  72. help=_("Forbid usage of words in messages"),
  73. icon='volume-off',
  74. link='admin_forums_badwords',
  75. urlpatterns=patterns('misago.apps.admin.index',
  76. url(r'^$', 'todo', name='admin_forums_badwords'),
  77. ),
  78. ),
  79. AdminAction(
  80. section='forums',
  81. id='tests',
  82. name=_("Tests"),
  83. help=_("Tests that new messages have to pass"),
  84. icon='filter',
  85. link='admin_forums_tests',
  86. urlpatterns=patterns('misago.apps.admin.index',
  87. url(r'^$', 'todo', name='admin_forums_tests'),
  88. ),
  89. ),
  90. AdminAction(
  91. section='forums',
  92. id='attachments',
  93. name=_("Attachments"),
  94. help=_("Manage allowed attachment types."),
  95. icon='download-alt',
  96. model=AttachmentType,
  97. actions=[
  98. {
  99. 'id': 'list',
  100. 'name': _("Attachment Types List"),
  101. 'help': _("All allowed attachment types."),
  102. 'link': 'admin_attachments_types'
  103. },
  104. {
  105. 'id': 'new',
  106. 'name': _("Add Attachment Type"),
  107. 'help': _("Create new allowed attachment type"),
  108. 'link': 'admin_attachments_types_new'
  109. },
  110. ],
  111. link='admin_attachments_types',
  112. urlpatterns=patterns('misago.apps.admin.attachmenttypes.views',
  113. url(r'^$', 'List', name='admin_attachments_types'),
  114. url(r'^new/$', 'New', name='admin_attachments_types_new'),
  115. url(r'^edit/(?P<slug>([a-z0-9]|-)+)-(?P<target>\d+)/$', 'Edit', name='admin_attachments_types_edit'),
  116. url(r'^delete/(?P<slug>([a-z0-9]|-)+)-(?P<target>\d+)/$', 'Delete', name='admin_attachments_types_delete'),
  117. ),
  118. ),
  119. )