Ejemplo n.º 1
0
browse_patterns = patterns('materials.views',
    url(r"^/?$", "index.index", name="index"),
) + \
general_subject_patterns + \
grade_level_patterns + \
collection_patterns + \
license_patterns + \
keyword_patterns + \
alignment_patterns

course_patterns = browse_patterns + patterns('materials.views',
    url(r"^/add/?$", "forms.course.add.add", name="add"),
    url(r"^/material_types/(?P<course_material_types>[^/]+)/?$", "index.index", name="material_type_index"),
    url(r"^/(?P<course_or_module>full-course|learning-module)/?$", "index.index", name="course_or_module_index"),
    url(r"^/(?P<slug>[^/]+)/?$", ViewItem.as_view(), name="view_item"),
    url(r"^/(?P<slug>[^/]+)/view/?$", ToolbarViewItem.as_view(), name="toolbar_view_item"),
    url(r"^/(?P<slug>[^/]+)/edit/?$", "forms.course.edit.edit", name="edit"),
    url(r"^/(?P<slug>[^/]+)/delete/?$", "delete.delete", name="delete"),
    url(r"^/(?P<slug>[^/]+)/transition/(?P<transition_id>[^/]+)/?$", "transition.transition", name="transition"),
) + \
saved_item_patterns

library_patterns = browse_patterns + patterns('materials.views',
    url(r"^/add/?$", "forms.library.add.add", name="add"),
    url(r"^/material_types/(?P<library_material_types>[^/]+)/?$", "index.index", name="material_type_index"),
    url(r"^/(?P<slug>[^/]+)/?$", ViewItem.as_view(), name="view_item"),
    url(r"^/(?P<slug>[^/]+)/view/?$", ToolbarViewItem.as_view(), name="toolbar_view_item"),
    url(r"^/(?P<slug>[^/]+)/edit/?$", "forms.library.edit.edit", name="edit"),
    url(r"^/(?P<slug>[^/]+)/delete/?$", "delete.delete", name="delete"),
    url(r"^/(?P<slug>[^/]+)/transition/(?P<transition_id>[^/]+)/?$", "transition.transition", name="transition"),
Ejemplo n.º 2
0
from authoring.models import AuthoredMaterial
from authoring.views.delete import Delete, DeleteDraft
from authoring.views.edit import Edit
from authoring.views.media import MediaUpload, LoadEmbed
from authoring.views.new import New
from authoring.views.pdf import AsPdf
from authoring.views.view import ViewFullAuthoredMaterial
from django.conf.urls.defaults import patterns, url
from materials.views.view_item import ViewItem


urlpatterns = patterns("",
    url(r"^new$", New.as_view(), name="new"),
    url(r"^edit/(?P<pk>\d+)$", Edit.as_view(), name="edit"),
    url(r"^edit/(?P<pk>\d+)/upload$", MediaUpload.as_view(), name="upload"),
    url(r"^delete/(?P<pk>\d+)$", Delete.as_view(), name="delete"),
    url(r"^delete-draft/(?P<pk>\d+)$", DeleteDraft.as_view(), name="delete-draft"),
    url(r"^load-embed$", LoadEmbed.as_view(), name="load-embed"),
    url(r"^(?P<pk>\d+)(?:-(?P<slug>[^/]+))?$", ViewItem.as_view(model=AuthoredMaterial), name="view"),
    url(r"^(?P<pk>\d+)(?:-(?P<slug>[^/]+))?/view$", ViewFullAuthoredMaterial.as_view(), name="view_full"),
    url(r"^(?P<pk>\d+)(?:-(?P<slug>[^/]+))?/pdf", AsPdf.as_view(), name="pdf"),
    url(r"^(?P<pk>\d+)/preview$", ViewFullAuthoredMaterial.as_view(preview=True), name="preview"),
)