admin.py 1.1 KB

1234567891011121314151617181920212223242526
  1. from django.conf.urls import url
  2. from django.utils.translation import ugettext_lazy as _
  3. from .views.admin.attachmenttypes import (
  4. AttachmentTypesList, DeleteAttachmentType, EditAttachmentType, NewAttachmentType)
  5. class MisagoAdminExtension(object):
  6. def register_urlpatterns(self, urlpatterns):
  7. # AttachmentType
  8. urlpatterns.namespace(r'^attachment-types/', 'attachment-types', 'system')
  9. urlpatterns.patterns('system:attachment-types',
  10. url(r'^$', AttachmentTypesList.as_view(), name='index'),
  11. url(r'^new/$', NewAttachmentType.as_view(), name='new'),
  12. url(r'^edit/(?P<pk>\d+)/$', EditAttachmentType.as_view(), name='edit'),
  13. url(r'^delete/(?P<pk>\d+)/$', DeleteAttachmentType.as_view(), name='delete'),
  14. )
  15. def register_navigation_nodes(self, site):
  16. site.add_node(
  17. name=_("Attachment types"),
  18. icon='fa fa-cubes',
  19. parent='misago:admin:system',
  20. after='misago:admin:system:settings:index',
  21. link='misago:admin:system:attachment-types:index'
  22. )