{% load i18n learning %}
{% if linked_course %} {# In case the resource is displayed as part of a course, it is linked to it and to the corresponding activity. #} {% else %} {# Otherwise, it can be displayed as a standard resource detail page #} {% endif %}
{% block resource_block_header %} {% get_object_perms resource user as resource_perms %} {% if "view_resource" in resource_perms %}
{% if user.is_authenticated %} {% get_resource_collaborator_object resource user as resource_collaborator %} {% if add %} {# The resource can be linked to an activity. In this case, display a button to attach it to the activity #} {% elif unlink %} {# The resource can be unlink from an activity. In this case, display a button to unlink the resource #} {% elif user == resource.author or resource_collaborator%} {% if not "similar" in request.get_full_path %} {% if not course.slug in request.get_full_path %}
{% csrf_token %} {% if user in resource.favourite_for.all %} {% else %} {% endif %}
{% endif %} {% endif %} {% endif %} {% endif %} {% else %} {% if resource.name|length >= 50 %}
{{ resource.name|truncatechars:30 }}
{% else %}
{{ resource.name }}
{% endif %} {% endif %}
{% endblock %}
{% include "learning/_includes/object_tags_line.html" with object=resource %}
{% block resource_block_content %}{% endblock %}