Create courses on mobile
authorCharles Connell <charles@connells.org>
Mon, 21 Apr 2014 03:08:20 +0000 (23:08 -0400)
committerCharles Connell <charles@connells.org>
Mon, 21 Apr 2014 03:08:20 +0000 (23:08 -0400)
karmaworld/apps/courses/views.py
karmaworld/assets/css/home.css
karmaworld/settings/common.py
karmaworld/templates/courses/course_list.html
karmaworld/templates/partial/add_course.html

index 08380472f30edf885d48a48d6b5a7b3c79e8917f..082a7e41f67de89fd4d81dcb5743e2b83abe6da1 100644 (file)
@@ -23,7 +23,7 @@ from karmaworld.apps.notes.models import Note
 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'
@@ -51,6 +51,8 @@ class CourseListView(View):
             # 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
 
 
index 07f595ec179699ca62f1a6b7c35f595aaf8281cd..6e31dcfc589221107db38ff3b3635df3244f2100 100644 (file)
@@ -63,3 +63,7 @@ label.validation_error {
   color: #F04124;
 }
 
+#add-course-btn {
+  width: 100%
+}
+
index 5792d31c159e56729591167e6de803088f19e637..789d5f9b5d183bf4d27a4f6710e0217a27ac33cd 100644 (file)
@@ -387,7 +387,7 @@ TAGGIT_STOPWORDS = [u'a', u'an', u'and', u'be', u'from', u'of']
 # 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
 
index 230684de3106060a5c6fb08e7b668c30143baeeb..d2a13cd3c4ec335e8a3bd7e24d333bd5e0890dfc 100644 (file)
     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">
index 5ab4073479d329fca92482a91b9d76cdb5510571..c6ca20c16836a8a09c56a979d436a826db4f07ef 100644 (file)
       {{ 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>
@@ -90,7 +90,7 @@
     </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>