{% if edit_type == 'homepage' or edit_type == 'page' %} {% if perms.autodidact.change_page %} Edit this page {% endif %} {% endif%} {% if edit_type == 'course' %} {% if perms.autodidact.change_course %} Edit this course {% endif %} {% endif%} {% if edit_type == 'session' %} {% if request.user.is_staff and perms.autodidact.change_session %} Edit this session {% endif %} {% endif %} {% if edit_type == 'topic' %} {% if request.user.is_staff and perms.autodidact.change_topic %} Edit this topic {% endif %} {% endif %} {% if edit_type == 'assignment' %} {% if request.user.is_staff and perms.autodidact.change_assignment %} Edit this assignment {% endif %} {% if request.user.is_staff and perms.autodidact.change_assignment and perms.autodidact.change_step %} - {% endif %} {% if request.user.is_staff and perms.autodidact.change_step %} Edit this step {% if perms.autodidact.add_step %} - Add new step {% endif %} {% endif %} {% endif %}