diff --git a/links/models.py b/links/models.py index 890472e..cc988bc 100644 --- a/links/models.py +++ b/links/models.py @@ -23,5 +23,14 @@ class Link(Resource): verbose_name_plural = "Links" def __str__(self): - pass + return self.name + + def access_link(self): + return 'links:view' + + def update_link(self): + return 'links:update' + + def delete_link(self): + return 'links:delete' \ No newline at end of file diff --git a/links/templates/links/delete.html b/links/templates/links/delete.html new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/links/templates/links/delete.html diff --git a/links/templates/links/update.html b/links/templates/links/update.html new file mode 100644 index 0000000..7104b04 --- /dev/null +++ b/links/templates/links/update.html @@ -0,0 +1,36 @@ +{% extends 'subjects/view.html' %} + +{% load static i18n django_bootstrap_breadcrumbs %} + +{% block style %} + {{block.super}} + +{% endblock %} + +{% block javascript %} + {{block.super}} + +{% endblock %} + +{% block breadcrumbs %} + {{ block.super }} + + {% breadcrumb topic 'subjects:topic_view' topic.subject.slug topic.slug %} + + {% trans 'Edit: ' as bread %} + {% with bread|add:link.name as bread_slug %} + {% breadcrumb bread_slug 'links:update' topic.slug link.slug %} + {% endwith %} +{% endblock %} + +{% block content %} +