From: Charles Connell Date: Sun, 13 Apr 2014 23:17:26 +0000 (-0400) Subject: Merge branch 'master' into feature_course_add_with_dept X-Git-Tag: release-20150131~146 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f335ab460b0365a9598e8bdc9300d7bedec7a600;p=oweals%2Fkarmaworld.git Merge branch 'master' into feature_course_add_with_dept Conflicts: karmaworld/apps/courses/views.py karmaworld/assets/css/global.css karmaworld/assets/js/add-course.js karmaworld/templates/courses/course_detail.html karmaworld/templates/courses/course_list.html karmaworld/templates/courses/course_list_entry.html karmaworld/templates/partial/add_course.html karmaworld/templates/user_profile.html --- f335ab460b0365a9598e8bdc9300d7bedec7a600 diff --cc karmaworld/apps/courses/views.py index 30dcb77,d7ecef6..e355525 --- a/karmaworld/apps/courses/views.py +++ b/karmaworld/apps/courses/views.py @@@ -4,7 -4,8 +4,8 @@@ """ Views for the KarmaNotes Courses app """ import json -- ++g + from django.conf import settings from django.core import serializers from django.core.exceptions import MultipleObjectsReturned from django.core.exceptions import ObjectDoesNotExist @@@ -64,10 -42,14 +65,11 @@@ class CourseListSubView(ListView) # get the total number of notes context['note_count'] = Note.objects.count() # get the course form for the form at the bottom of the homepage - context['course_form'] = kwargs.get('course_form', CourseForm()) - if context['course_form'].errors: - # if there was an error in the form - context['jump_to_form'] = True + context['course_form'] = CourseForm() - # Include "Add Course" button in header - context['display_add_course'] = True + # Include settings constants for honeypot + for key in ('HONEYPOT_FIELD_NAME', 'HONEYPOT_VALUE'): + context[key] = getattr(settings, key) return context diff --cc karmaworld/assets/css/global.css index fe1f2de,6c5faaa..1213529 --- a/karmaworld/assets/css/global.css +++ b/karmaworld/assets/css/global.css @@@ -499,480 -137,112 +137,112 @@@ a.inherit-color text-decoration: underline; } - a.activity_target:hover - { - color: #f1592a; - } - - .course_details - { - font-size: 14px; - line-height: 2em; - } - - .activity_details_context, .activity_details_context a - { - font-family: "MuseoSlab-900"; - font-size: 11px; - text-transform: uppercase; - line-height: 200%; - padding: 5px 0; - } - - .activity_details_callout - { - padding: 20px 25px; - margin: 15px 0 13px; - } - - .note_preview - { - margin-bottom: 2em; - line-height: 125%; - font: 14px/1.4em "Georga", Serif; - font-style: italic; - } - - .activity_details_callout_copy - { - line-height: 125%; - font: 14px/1.4em "Georga", Serif; - font-style: italic; - } - - .activity_details_status - { - font-size: 13px; - font-family: "MuseoSans-500"; - color: #232323; - } - - .activity_details_status_number - { - color: #f1592a; - font-family: "MuseoSans-900"; - } - - .activity_details_status_secondary_number - { - font-family: "MuseoSlab-900"; - } - - .badge - { - background: none repeat scroll 0 0 #FFFFCD; - border-top-color: rgb(238, 238, 238); - border-right-color: rgb(204, 204, 204); - border-bottom-color: rgb(204, 204, 204); - border-left-color: rgb(238, 238, 238); - border-style: solid; - border-width: 1px; - font-size: 14px; - padding: 4px 6px 4px 6px; + span.table-school { font-weight: bold; - line-height: 250%; } - .course_meta_action - { - height: 36px; - width: 39px; - font-family: "MuseoSlab-900"; - font-size: 9px; - color: #FFF; - text-align: center; - padding-top: 13px; - margin-top: 20px; /* POSITION WITH JAVASCRIPT */ - } - - .course_meta_join - { - background: url(../img/course_meta_join_bg.png) no-repeat; - text-transform: uppercase; + span.table-note-count, + span.table-quiz-count, + span.table-thanks-count { + margin-right: 15px; } - .course_meta_drop - { - background: url(../img/course_meta_drop_bg.png) no-repeat; - text-transform: uppercase; + .table-course-name { + font-size: 1.8em; + margin-right: 10px; } - .add-note-btn:before { - content=""; - } - .add-note-btn:hover { - background-color: white; - color: #f05a28; - } - .add-note-btn { - padding:0; - margin: 0 auto; - } - - .add-note-btn, - #add-note-btn, - #add-course-btn, - #existing-course-btn, - #save-btn, - #save_note_tags, - #edit-save-btn - { + table.dataTable { + margin-bottom: 30px; border: none; - background-color: transparent; - color: #f05a28; - cursor: pointer; - font: 30px/1.2em "MuseoSlab-300", serif; - margin: 1px; - text-align: center; - text-transform: uppercase; - /* transition: ease-out ? ? ? */ - } - - #existing-course-btn, - #save-btn, - #edit-save-btn { - margin-top: 13px; - } - - #existing-course-btn.disabled, - #save-btn.disabled, - #edit-save-btn.disabled - { - color: #afafaf; - cursor: auto; - } - - .validation_error { - color:red; - } - ul.validation_error { - display: inline; - list-style-type: none; - } - - #add-note-form, #add-course-form, #edit-course-form - { - display: none; - } - - .progress - { - border: solid 1px black; - height: 10px; - } - - #progress-fill - { - height: 100%; - width: 0; - background-color: #f1592a; - } - - /* COPY */ - - .body_copy h1 - { - font-family: "MuseoSlab-700"; - font-size: 15px; - text-transform: uppercase; - margin-top: 18px; - margin-bottom: 10px; - } - - .body_copy p, ol, ul - { - font-family: "MuseoSlab-500"; - font-size: 15px; - margin-top: 4px; - margin-bottom: 4px; - } - - .body_copy strong - { - font-family: "MuseoSlab-700"; - } - - .body_copy p - { - white-space: pre-wrap; - } - - .body_copy ol, ul - { - padding-left: 30px; - } - - /* - * Hack to make the wrongly added code blocks look normal. Html2text should not - * actually make these code blocks, but does when users have whitespace in d - * ocuments. Longterm fix should be in Html2text. - */ - code - { - font-family: "MuseoSlab-500"; - font-size: 15px; - font-weight: normal; - color: black; - } - - - /* GLOBAL FOOTER */ - - footer#global_footer - { - width: 100%; - min-height: 164px; - color: #FFF; - padding-top: 36px; - background-color: #000; - } - - footer#global_footer a - { - color: #FFF; - } - - #footer_links_container - { - font-size: 13px; - padding-bottom: 54px; - } - - #colophon - { - font-family: "MuseoSlab-500"; - font-size: 11px; - line-height: 175%; - } - - #colophon a - { - color: #FFF; - text-decoration: underline; - } - - #cc_logo - { - margin-right: 5px; - margin-top: 3px; - } - - /* EDITS POST DESIGN */ - ul#course_menu li a - { - color: white; - } - - /* New course-list homepage css */ - - #subhead span - { - /*margin-left: 2em;*/ - font-family: "MuseoSlab-300"; - font-size: 19px; + table-layout: fixed; } - .subhead-spacer { - height: 42px; + table.dataTable div.table-entry-first-line { + font-size: 0.9em; + margin: 0 0 5px 0; } - .header_subhead - { - font-family: "MuseoSans-900"; - font-size: 10px; - text-align: center; - text-transform: uppercase; - padding-top: 20px; - padding-bottom: 1px; + table.dataTable div.table-entry-third-line { + font-size: 0.9em; + margin: 5px 0 0 0; } - .center - { - text-align: center; + table.dataTable div.data-table-entry { + margin: 20px 0 20px 0; } - #page_instruction - { - font-family: "MuseoSlab-700"; - font-size: 12px; - } - /* end new course-list homepage css */ - - a.white - { - color: white; + table.dataTable a { + color: inherit; } - a.white:hover - { - color: #FFF; - cursor: pointer; - text-decoration: underline; + .even { + background-color: #fafafa !important; + border-top: 1px solid #f0f0f0; + border-bottom: 1px solid #f0f0f0; } - /* post-designers css hacks */ - .button_disabled img - { - opacity: 0.4; - filter: alpha(opacity=40); /* msie */ + .odd { + background-color: transparent !important; } - .voted_message - { - cursor: pointer; - font-size: 13px; - font-family: "MuseoSans-500"; - color: #232323; + td { + background-color: inherit !important; } - .voted_message:hover - { - cursor: pointer; - text-decoration: underline; + ul.ui-autocomplete { + z-index: 1000; } - /* new form submit */ - .submit_upload - { - background: none; + .ui-tabs-panel { border: none; - color: white; - cursor: pointer; - font-family: "MuseoSlab-300"; - font-size: 32px; - } - - /* GAAAH, random body p copy should be readable text */ - p.text - { - font-family: "MuseoSlab-500"; - font-size: 17px; - margin: 20px 0 0; - line-height: 150%; - } - p.text a - { - color: #f05a28; - text-decoration: underline; - } - - #thankyou - { - margin: 60px 20px; - padding: 20px; - } - - #thankyou p - { - font-family: "MuseoSlab-300"; - font-size: 22px; - margin: 0px; - } - - /* Nick redesign for course page */ - #breadcrumbs, #breadcrumbs a - { - font-family: "MuseoSans-300"; - font-size: 12px; - padding-top: 10px; - color: black; + border-top: 1px solid #dfdfdf; + padding: 20px 10px 20px 10px; } - #breadcrumbs > .breadcrumbs { - /* override foundation 4 panel and outline for breadcrumbs */ - border-style: none; - background-color: white; - } - - .header_title - { - margin-top: 1em; - text-align: center; - font-family: "MuseoSlab-500"; - font-size: 24px; - } - - - #course_name a { - color: black; + .ui-tabs-nav li { + margin: 0 10px 0 10px; + border: 1px solid #dfdfdf; } - #course_name:hover a{ - text-decoration: underline; - } - - .doubleline - { - border: dotted black; - border-width: 1px 0 0; - - } - - .doubleline hr - { - - } - - hr.midrule - { - border: dotted black; - border-width: 1px 0 0; - width: 140px; - margin: 2em auto; + #tabs { + border: none; } - legend, label - { - font: 12px/2em "MuseoSlab-300"; + dl.tabs dd.active { + border-radius: 3px; } - .qq-upload-button { - margin-bottom:12px; + dl.tabs dd { + margin: 0 10px 0px 10px; + border: 1px solid #dfdfdf; + border-bottom: none; } - /* Turning font awesome icons into buttons */ - .awesome-action:hover { - /* For awesome icons with clickstates */ - color: #f05a28; - cursor: pointer; + dl.tabs dd, + dl.tabs dd a { + border-top-left-radius: 3px; + border-top-right-radius: 3px; } - #drpbx-btn { - color: #3d9ae8; - cursor: pointer; + dl.tabs dd a { + padding: 5px 10px 5px 10px; } - /* Filepicker integration */ - .fp_dropzone { - width: 100%; - height: 50px; - text-align: center; - - background-color: #F6F6F6; - border: 1px dashed #666; - border-radius: 6px; - padding: 20px; - } - .dragdrop { - text-align: center; + div.tabs-content { + margin-top: -1px; + border-top: 1px solid #dfdfdf; } - .inline-form { - border-bottom: 1px dashed #666; + div.message-container { + margin: 20px 0 0 0; } - /* Social account integration */ - - ul.socialaccount_providers li { - list-style: none; - margin: 10px 0 5px 0; + ul.socialaccount_providers { + list-style-type: none; } - - /* FOR LARGE SCREENS ONLY */ - @media only screen and (min-width: 768px) { - /* Front page intro text, large on wide, resize on small */ - #subhead span { - font-size: 22px; - } + ul.socialaccount_providers li{ + display: inline; + margin: 0 5px 0 5px; -} +} diff --cc karmaworld/assets/css/home.css index 399fadb,b9fca7d..bec3a49 --- a/karmaworld/assets/css/home.css +++ b/karmaworld/assets/css/home.css @@@ -1,126 -1,43 +1,44 @@@ - /* HOME */ - - #home_content - { - padding-top: 46px; - } - - /* VIDEO */ - - #home_video - { - margin-left: -10px; - } - - #home_video_overlay - { - background-image: url(../img/home_video_screen_80opacity.png); - position: absolute; - top: -574px; - height: 575px; - width: 1020px; - color: #FFF; - cursor: pointer; - } - - #home_video_overlay_headline - { - padding-top: 76px; - font-size: 60px; - } - - #home_video_overlay_more - { - padding-top: 164px; - font-size: 28px; - text-transform: uppercase; - } - - #home_video_overlay_more_arrow - { - margin-top: -20px; + #splash { + padding: 8% 5% 8% 5%; + color: #ffffff; + text-align: center; + font-size: 3em; + background-image: url('../img/banner_small.jpg'); + background-size: cover; + background-position: center center; } - /* HOMEPAGE RECENT */ + @media only screen and (max-width: 40.063em) { + #splash { + font-size: 1.8em; + } + } /* medium screens and down */ - #recent_uploaded_container - { - background-color: #000; + input.search-courses { + display: inline; + margin: 0 0 10px 5px; + max-width: 30em; } - #recent_uploaded_headline - { - text-transform: uppercase; - font-size: 10px; - color: #c0c0c0; - padding-top: 12px; - padding-bottom: 12px; - width: 170px!important; + #course-sort-wrapper { + float: right; + display: inline; } - #recent_uploaded_scroller_screen - { - position: absolute; - height: 34px; - width: 140px; - background: url(../img/home_recent_uploaded_scroller_screen.png) repeat-y; - z-index: 2; + select.course-sort { + width: 10em; } - #recent_uploaded_scroller_screen_right - { - position: absolute; - height: 34px; - width: 140px; - background: url(../img/home_recent_uploaded_scroller_screen_right.png) repeat-y; - z-index: 2; - margin-left: 475px; + #course-search-bar { + background: #f5f5f5; + padding: 15px 0 0 0; + font: 1em 'museo300'; } - #recent_uploaded_scroller_sled - { - position: absolute; - top: -15px; - color: #FFF; - overflow-x: hidden; - white-space: nowrap; - width: 613px; - } - - #recent_uploaded_scroller_sled ul li.recent_upload_note_name, #recent_uploaded_scroller_sled ul li.recent_upload_note_school - { - list-style: none; - font-size: 13px; - display: inline-block; - margin: 0 5px; - } - - #recent_uploaded_scroller_sled ul li.recent_upload_note_name - { + #intro-video-button { color: #f1592a; - font-size: 13px; - } - - #recent_uploaded_scroller_sled ul li.recent_upload_note_school - { - color: #fff; - text-transform: uppercase; - font-size: 11px; - padding-top: 2px; - } - - - /* HOMEPAGE COPY */ - - #home_copy p - { - font-family: "MuseoSlab-700"; - font-size: 25px; - margin: 40px 0; - } - - /* override jquery ui autocomplete styles */ - .ui-menu .ui-menu-item a { - font-size: 18px; + background: #ffffff; + margin: 10px 0 0 0; + padding: 5px 5px 5px 5px; } + diff --cc karmaworld/templates/courses/course_detail.html index 6def87e,821d517..2be0942 --- a/karmaworld/templates/courses/course_detail.html +++ b/karmaworld/templates/courses/course_detail.html @@@ -22,57 -24,34 +24,34 @@@ {% endblock %} - {% block title %} - Share Notes for {{ course.name }} | {{ course.school.name }} + Share Notes for {{ course.name }} | {% if course.school %}{{ course.school.name }}{% else %}{{ course.department.school.name }}{% endif %} {% endblock %} - {% block content %} + {% block raw_content %}
-
-
-
- {{ course.name }} -
-
- -
-
-
- {{ course.get_prof_names }} - {% if course.department %}// {{ course.department.name }}{% endif %} -
-
+
+ -
-
-
- {% if course.school %}{{ course.school.name }}{% else %}{{ course.department.school.name }}{% endif %} -
-
-
+
+
+ {{ course.name }} - +    +
-
-
-
-
+ + {% if user.is_authenticated %} {% if user.get_profile.can_edit_items %} - edit_flag +    {% endif %} {% if already_flagged %} diff --cc karmaworld/templates/courses/course_list_entry.html index 985bb85,89459af..8ae41ab --- a/karmaworld/templates/courses/course_list_entry.html +++ b/karmaworld/templates/courses/course_list_entry.html @@@ -1,26 -1,44 +1,43 @@@ - - - Updated {{ course.updated_at|date:"b d, o"|capfirst }} - {{ course.file_count }} Notes - {{ course.get_popularity }} Thanks + + {{ course.updated_at|date:"U" }} + {{ course.file_count|stringformat:"010g" }} + {{ course.get_popularity|stringformat:"010g" }} - - {% if course.department %}{{course.department.name}}: {% endif %}{{ course.name }} - - -
- - - + +
+
+ + {% if course.school.name %} + {{ course.school.name }} + {% endif %} + {% if course.department.school.name %} + {{ course.department.school.name }} + {% endif %} + + {% if course.department %} +   •   + {{ course.department.name }} + {% endif %} + {% if course.instructor_name %} +   •   + {{ course.instructor_name }} + {% endif %} + {% if couse.instructor.name %} +   •   + {{ course.instructor.name }} + {% endif %} +
+ +
+ {{ course.name }} +
+ +
+   {{ course.file_count }} Notes +   {{ course.get_popularity }} Thanks + Updated {{ course.updated_at|date:"b d, o"|capfirst }} +
+ - {% if course.school %}{{ course.school.name }}{% else %}{{ course.department.school.name }}{% endif %} - {{ course.get_prof_names }} - diff --cc karmaworld/templates/partial/add_course.html index 334f081,70298ff..fc9327a --- a/karmaworld/templates/partial/add_course.html +++ b/karmaworld/templates/partial/add_course.html @@@ -1,36 -1,108 +1,30 @@@ {% load url from future %} - - - - + +{{ course_form.media }} - + -
+
+ ×
{% csrf_token %} - {% for error in course_form.non_field_errors %} -
-
- {{ error }} -
-
- {% endfor %} - -
-
- -
- - + {% if course_form.non_field_errors %} +
+
+
    {% for error in course_form.non_field_errors %} +
  • + {% endfor %}
-
- -
-
- - -
-
+ {% endif %} -
-
- - -
-
+ {{ course_form.as_p|safe }} -
-
- - -
- -
- - -
-
- -
-
- - -
-
+
- - - Looks like this course already exists on KarmaNotes! - Go To Existing Course
diff --cc karmaworld/templates/user_profile.html index 5c5be2b,5dd52ff..a9376ed --- a/karmaworld/templates/user_profile.html +++ b/karmaworld/templates/user_profile.html @@@ -73,51 -88,85 +88,83 @@@ {% endif %}
- {% endwith %} - - {% endif %} - +
+ {% endfor %} +
+
+ + + + +
-
+
- {% endfor %} + {% if not object_list %} +
+
+

Nothing to show here yet.

+
+
+ {% endif %} - -
diff --cc karmaworld/urls.py index 895d9ec,a58194b..b567075 --- a/karmaworld/urls.py +++ b/karmaworld/urls.py @@@ -15,16 -15,16 +15,15 @@@ from karmaworld.apps.courses.views impo from karmaworld.apps.courses.views import school_course_list from karmaworld.apps.courses.views import school_course_instructor_list from karmaworld.apps.notes.views import NoteView, thank_note, NoteSearchView, flag_note, downloaded_note, edit_note_tags - from karmaworld.apps.notes.views import RawNoteDetailView from karmaworld.apps.moderation import moderator from karmaworld.apps.document_upload.views import save_fp_upload - from karmaworld.apps.quizzes.views import QuizView, KeywordEditView, quiz_answer + from karmaworld.apps.quizzes.views import QuizView, KeywordEditView, quiz_answer, get_keywords, \ + set_delete_keyword from karmaworld.apps.users.views import ProfileView - from karmaworld.apps.users.views import ControlView -# See: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#hooking-adminsite-instances-into-your-urlconf - +from ajax_select import urls as ajax_select_urls +# See: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#hooking-adminsite-instances-into-your-urlconf admin.autodiscover() # reused named regex capture groups