<div class="row">
<div class="small-12 column center">
{% if user.is_authenticated %}
- <a href="#" id="edit-button"><img src="{{ STATIC_URL }}img/edit.png" alt="edit_flag" width="25" height="35"/></a>
+ {% if user.get_profile.can_edit_courses %}
+ <a href="#" id="edit-button"><img src="{{ STATIC_URL }}img/edit.png" alt="edit_flag" width="25" height="35"/></a>
+ {% endif %}
+
{% if already_flagged %}
<img src="{{ STATIC_URL }}img/note_flag_disabled.png"
alt="course_flag"
</div>
</div><!-- /course_header -->
- <section id="edit-course-form">
- <form>
- {% csrf_token %}
+ {% if user.get_profile.can_edit_courses %}
+ <section id="edit-course-form">
+ <form>
+ {% csrf_token %}
- <div class="row">
- <div id="course_form_errors" class="small-12 columns">
- {{ course_form.non_field_errors }}
+ <div class="row">
+ <div id="course_form_errors" class="small-12 columns">
+ {{ course_form.non_field_errors }}
+ </div>
</div>
- </div>
- <div class="row hide">
- <div class="small-12 columns">
- <legend>School</legend>
- <div>
- <input id="id_school" value="{{ course.school.id }}" name="school" type='hidden'/>
+ <div class="row hide">
+ <div class="small-12 columns">
+ <legend>School</legend>
+ <div>
+ <input id="id_school" value="{{ course.school.id }}" name="school" type='hidden'/>
+ </div>
</div>
- </div>
- </div> <!-- .row -->
+ </div> <!-- .row -->
- <div class="row">
- <div class="small-12 columns">
- <legend>Course Name:</legend>
- <input id="id_name" class="" type="text" name="name" maxlength="255" value="{{ course.name }}"/>
- </div>
- </div> <!-- .row -->
+ <div class="row">
+ <div class="small-12 columns">
+ <legend>Course Name:</legend>
+ <input id="id_name" class="" type="text" name="name" maxlength="255" value="{{ course.name }}"/>
+ </div>
+ </div> <!-- .row -->
- <div class="row">
- <div class="small-12 columns large-6">
- <legend>Instructor Name:</legend>
- <input id="id_instructor_name" class="" type="text" name="instructor_name" maxlength="75" value="{{ course.instructor_name }}"/>
- </div>
+ <div class="row">
+ <div class="small-12 columns large-6">
+ <legend>Instructor Name:</legend>
+ <input id="id_instructor_name" class="" type="text" name="instructor_name" maxlength="75" value="{{ course.instructor_name }}"/>
+ </div>
- <div class="small-12 columns large-6">
- <legend>Instructor Email:</legend>
- <input id="id_instructor_email" class="" type="text" name="instructor_email" maxlength="75" value="{{ course.instructor_email }}"/>
- </div>
- </div> <!-- .row -->
+ <div class="small-12 columns large-6">
+ <legend>Instructor Email:</legend>
+ <input id="id_instructor_email" class="" type="text" name="instructor_email" maxlength="75" value="{{ course.instructor_email }}"/>
+ </div>
+ </div> <!-- .row -->
- <div class="row">
- <div class="small-12 columns">
- <legend>Course url:</legend>
- <input id="id_url" class="" type="text" name="url" maxlength="255" value="{{ course.url }}"/>
- </div>
- </div> <!-- .row -->
+ <div class="row">
+ <div class="small-12 columns">
+ <legend>Course url:</legend>
+ <input id="id_url" class="" type="text" name="url" maxlength="255" value="{{ course.url }}"/>
+ </div>
+ </div> <!-- .row -->
- <div class="row">
- <div class="small-4 large-8 columns small-centered text-center">
- <button id="edit-save-btn" type=button><i class="fa fa-save"></i> Save</button>
+ <div class="row">
+ <div class="small-4 large-8 columns small-centered text-center">
+ <button id="edit-save-btn" type=button><i class="fa fa-save"></i> Save</button>
+ </div>
</div>
- </div>
- </form>
- </section>
+ </form>
+ </section>
+ {% endif %}
<div class="row">
<div class="small-10 columns small-offset-1"> <hr/> </div>