from karmaworld.apps.users.models import CourseKarmaEvent
from karmaworld.apps.notes.forms import FileUploadForm
from karmaworld.utils import ajax_increment, format_session_increment_field
-
+from django.contrib import messages
FLAG_FIELD = 'flags'
USER_PROFILE_FLAGS_FIELD = 'flagged_courses'
# Replace blank form with invalid form.
ret.context_data['course_form'] = badform
ret.context_data['jump_to_form'] = True
+ else:
+ messages.add_message(request, messages.SUCCESS, 'You\'ve just created this course. Nice!')
return ret
color: #F04124;
}
+#add-course-btn {
+ width: 100%
+}
+
# https://github.com/sunlightlabs/django-honeypot
HONEYPOT_FIELD_NAME = "instruction_url" # see that "_url"? bots gotta want that.
HONEYPOT_VALUE = ""
-HONEYPOT_LABEL = "Do not fill in this field <span class='required-field'>(we need to make sure you're not a robot)</span>"
+HONEYPOT_LABEL = "Humans, leave this blank so we can prevent robots from submitting bogus courses"
HONEYPOT_ERROR = "You did not follow directions."
########## END HONEYPOT CONFIGURATION
var csrf_token = "{{ csrf_token }}";
var dataTable_sDom = '<"top">rt<"bottom"p><"clear">';
</script>
+ <script src="//cdnjs.cloudflare.com/ajax/libs/datatables/1.9.4/jquery.dataTables.min.js"></script>
<script src="{{ STATIC_URL }}js/setup-ajax.js"></script>
<script src="{{ STATIC_URL }}js/course.js"></script>
<script src="{{ STATIC_URL }}js/add-course.js"></script>
<script src="{{ STATIC_URL }}js/course-list.js"></script>
- <script src="//cdnjs.cloudflare.com/ajax/libs/datatables/1.9.4/jquery.dataTables.min.js"></script>
{% endblock %}
{% block raw_content %}
<div id="course-search-bar">
<div class="row">
- <div class="large-2 columns show-for-large-up">
+ <div class="small-12 large-2 columns">
<button id="add-course-btn" class="inline-button important" data-reveal-id="add-course-form">Add a Course</button>
</div>
<div class="small-12 large-6 columns">
- <input class="search-courses" type="text" placeholder="Search Courses" />
+ <input class="search-courses" type="text" placeholder="Search Courses and Schools" />
</div>
<div class="large-4 columns show-for-large-up">
<div id="course-sort-wrapper">
{{ hidden }}
{% endfor %}
<div class="row">
- <div class="small-6 columns add-course-field">
+ <div class="small-12 large-6 columns add-course-field">
{% with course_form.get_forms.department.school as field %}
{{ field.errors|safe }}
<label for="{{ field.id_for_label }}">{{ field.label }}:</label>
{{ field }}
{% endwith %}
</div>
- <div class="small-6 columns add-course-field">
+ <div class="small-12 large-6 columns add-course-field">
{% with course_form.get_forms.department.name as field %}
{{ field.errors|safe }}
<label for="{{ field.id_for_label }}">{{ field.label }}:</label>
</div>
<div class="row">
- <div class="small-6 columns add-course-field">
+ <div class="small-12 large-6 columns add-course-field">
{% with course_form.get_forms.professor.name as field %}
{{ field.errors|safe }}
<label for="{{ field.id_for_label }}">{{ field.label }}:</label>
{{ field }}
{% endwith %}
</div>
- <div class="small-6 columns add-course-field">
+ <div class="small-12 large-6 columns add-course-field">
{% with course_form.get_forms.professor.email as field %}
{{ field.errors|safe }}
<label for="{{ field.id_for_label }}">{{ field.label }}:</label>
</div>
<div class="row">
- <div class="small-6 columns add-course-field">
+ <div class="small-12 large-6 columns add-course-field">
{% with course_form.name as field %}
{{ field.errors|safe }}
<label for="{{ field.id_for_label }}">{{ field.label }}:</label>
{{ field }}
{% endwith %}
</div>
- <div class="small-6 columns add-course-field">
+ <div class="small-12 large-6 columns add-course-field">
{% with course_form.url as field %}
{{ field.errors|safe }}
<label for="{{ field.id_for_label }}">{{ field.label }}:</label>
</div>
<div class="row">
- <div class="small-4 large-8 columns small-centered text-center">
+ <div class="small-12 columns small-centered text-center">
<button id="save-btn" type="submit">
<i class="fa fa-save"></i> Save
</button>