From 6378be1f342953e35d000d32722831671b698f73 Mon Sep 17 00:00:00 2001 From: Charles Connell Date: Sun, 20 Apr 2014 23:08:20 -0400 Subject: [PATCH] Create courses on mobile --- karmaworld/apps/courses/views.py | 4 +++- karmaworld/assets/css/home.css | 4 ++++ karmaworld/settings/common.py | 2 +- karmaworld/templates/courses/course_list.html | 6 +++--- karmaworld/templates/partial/add_course.html | 14 +++++++------- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/karmaworld/apps/courses/views.py b/karmaworld/apps/courses/views.py index 0838047..082a7e4 100644 --- a/karmaworld/apps/courses/views.py +++ b/karmaworld/apps/courses/views.py @@ -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 diff --git a/karmaworld/assets/css/home.css b/karmaworld/assets/css/home.css index 07f595e..6e31dcf 100644 --- a/karmaworld/assets/css/home.css +++ b/karmaworld/assets/css/home.css @@ -63,3 +63,7 @@ label.validation_error { color: #F04124; } +#add-course-btn { + width: 100% +} + diff --git a/karmaworld/settings/common.py b/karmaworld/settings/common.py index 5792d31..789d5f9 100644 --- a/karmaworld/settings/common.py +++ b/karmaworld/settings/common.py @@ -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 (we need to make sure you're not a robot)" +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 diff --git a/karmaworld/templates/courses/course_list.html b/karmaworld/templates/courses/course_list.html index 230684d..d2a13cd 100644 --- a/karmaworld/templates/courses/course_list.html +++ b/karmaworld/templates/courses/course_list.html @@ -17,11 +17,11 @@ var csrf_token = "{{ csrf_token }}"; var dataTable_sDom = '<"top">rt<"bottom"p><"clear">'; + - {% endblock %} {% block raw_content %} @@ -45,11 +45,11 @@