From 1427d007ea1783ff44cfdc96f399e4913c957941 Mon Sep 17 00:00:00 2001 From: Charles Connell Date: Sun, 30 Mar 2014 12:33:09 -0400 Subject: [PATCH] Note search page, starting on account pages --- karmaworld/assets/css/dashboard.css | 179 ------------ karmaworld/assets/css/global.css | 15 ++ karmaworld/assets/css/note_course_pages.css | 20 +- karmaworld/assets/css/search.css | 21 -- karmaworld/assets/css/search_results.css | 255 ------------------ karmaworld/assets/js/course-detail.js | 42 --- karmaworld/assets/js/note-list.js | 41 +++ karmaworld/templates/account/base.html | 2 +- karmaworld/templates/base.html | 2 +- karmaworld/templates/control_panel.html | 16 +- .../templates/courses/course_detail.html | 11 +- karmaworld/templates/courses/course_list.html | 1 + .../templates/notes/note_list_entry.html | 8 +- .../templates/notes/search_results.html | 163 ++++------- karmaworld/templates/user_profile.html | 114 ++++---- 15 files changed, 202 insertions(+), 688 deletions(-) delete mode 100644 karmaworld/assets/css/search.css delete mode 100644 karmaworld/assets/css/search_results.css create mode 100644 karmaworld/assets/js/note-list.js diff --git a/karmaworld/assets/css/dashboard.css b/karmaworld/assets/css/dashboard.css index 4c85687..e69de29 100644 --- a/karmaworld/assets/css/dashboard.css +++ b/karmaworld/assets/css/dashboard.css @@ -1,179 +0,0 @@ -/* DASHBOARD */ - -#dashboard_content -{ - padding-top: 46px; -} - -/* STATS */ -#stats_container -{ - height: 210px; - margin-bottom: 20px; -} - -.stat_lead_in -{ - padding-top: 25px; - font-family: "MuseoSlab-900"; - font-size: 11px; - text-transform: uppercase; -} - -.stat_number -{ - font-family: "MuseoSlab-900"; - font-size: 57px; - padding-top: 5px; -} - -.stat_object -{ - font-family: "MuseoSlab-900"; - font-size: 13px; - text-transform: uppercase; -} - -.stat_earned -{ - color: #f05a28; -} - -.stat_uploaded -{ - color: #9ccf00; -} - -.stat_downloaded -{ - color: #00cf9c; -} - -.stat_liked -{ - color: #009ccf; -} - -/* PROFILE */ -#profile_box_container -{ - padding-top: 20px; - padding-bottom: 20px; - background-color: #efefef; - background-image: -webkit-gradient(linear, left top, left bottom, from(#efefef), to(#d7d7d8)); /* Safari 4+, Chrome */ - background-image: -webkit-linear-gradient(top, #efefef, #d7d7d8); /* Chrome 10+, Safari 5.1+, iOS 5+ */ - background-image: -moz-linear-gradient(top, #efefef, #d7d7d8); /* Firefox 3.6-15 */ - background-image: -o-linear-gradient(top, #efefef, #d7d7d8); /* Opera 11.10-12.00 */ - background-image: linear-gradient(to bottom, #efefef, #d7d7d8); /* Firefox 16+, IE10, Opera 12.50+ */ - border: solid 1px #c5c5c5; - margin-bottom: 29px; -} - -#profile_box -{ - margin: 0 20px; -} - -#profile_name -{ - font-family: "MuseoSlab-500"; - font-size: 20px; - padding-left: 0px; -} - -#profile_school -{ - font-family: "MuseoSans-700"; - text-transform: uppercase; -} - -#profile_school_header -{ - font-size: 8px; - padding-bottom: 5px; - border-bottom: solid 1px #3a3426; -} - -#profile_school_list -{ - padding-top: 5px; - font-size: 12px; -} - -#profile_courses -{ - font-family: "MuseoSans-700"; - text-transform: uppercase; -} - -#profile_courses_header -{ - font-size: 8px; - padding-bottom: 5px; - margin-bottom: 2px; - border-bottom: solid 1px #3a3426; -} - -#profile_courses_list ul -{ - margin-bottom: 0px; -} - -#profile_courses_list li -{ - list-style: none; - font-size: 12px; -} - -#profile_courses_links -{ - padding-top: 5px; - font-size: 9px; -} - -#profile_courses_links a -{ - color: #f05a28; - font-size: 9px; - text-decoration: underline; - margin-right: 16px; -} - -#profile_actions -{ - padding-right: 20px; -} - -#profile_actions img -{ - padding-bottom: 10px; -} - -#profile_actions div, #profile_actions a -{ - font-family: "MuseoSlab-700"; - text-transform: uppercase; - font-size: 14px; - color: #f05a28; -} - -/* ACTIVITY */ - -.activity_item -{ - margin: 20px 20px; -} - -#activity_more -{ - text-align: center; - padding: 20px 0; -} - -#no_activity -{ - font-family: "MuseoSlab-900"; - font-size: 10px; - color: #8e8e8e; - margin-bottom: 20px; -} \ No newline at end of file diff --git a/karmaworld/assets/css/global.css b/karmaworld/assets/css/global.css index c3521f0..422329d 100644 --- a/karmaworld/assets/css/global.css +++ b/karmaworld/assets/css/global.css @@ -176,3 +176,18 @@ ul.ui-autocomplete { z-index: 1000; } +.ui-tabs-panel { + border: none; + border-top: 1px solid #dfdfdf; + padding: 20px 10px 20px 10px; +} + +.ui-tabs-nav li { + margin: 0 10px 0 10px; + border: 1px solid #dfdfdf; +} + +#tabs { + border: none; +} + diff --git a/karmaworld/assets/css/note_course_pages.css b/karmaworld/assets/css/note_course_pages.css index 0efa0da..be014aa 100644 --- a/karmaworld/assets/css/note_course_pages.css +++ b/karmaworld/assets/css/note_course_pages.css @@ -73,6 +73,11 @@ div.return-to-course { font-size: 0.8em; } +#results_header { + margin: 20px 0 20px 0; + font-size: 1.8em; +} + div#note_header { margin: 20px 0 20px 0; } @@ -93,21 +98,6 @@ div.header-title-row { font-size: 0.8em; } -.ui-tabs-panel { - border: none; - border-top: 1px solid #dfdfdf; - padding: 20px 10px 20px 10px; -} - -.ui-tabs-nav li { - margin: 0 10px 0 10px; - border: 1px solid #dfdfdf; -} - -#tabs { - border: none; -} - #outline-btn, #minus-btn, #plus-btn { diff --git a/karmaworld/assets/css/search.css b/karmaworld/assets/css/search.css deleted file mode 100644 index d7a3755..0000000 --- a/karmaworld/assets/css/search.css +++ /dev/null @@ -1,21 +0,0 @@ - -#results_header { - padding-bottom: 20px; - margin-bottom: 20px; -} - -#no_results -{ - font-family: "MuseoSlab-900"; - font-size: 10px; - color: #8e8e8e; - margin-bottom: 20px; -} - -#search_nav_buttons -{ - font-family: "MuseoSlab-900"; - font-size: 25px; - color: #8e8e8e; - margin-bottom: 20px; -} \ No newline at end of file diff --git a/karmaworld/assets/css/search_results.css b/karmaworld/assets/css/search_results.css deleted file mode 100644 index 8c851f2..0000000 --- a/karmaworld/assets/css/search_results.css +++ /dev/null @@ -1,255 +0,0 @@ -/* DASHBOARD */ - -#results_content -{ - padding-top: 46px; -} - -/* SEARCH HEADER BAR */ - -#search_header -{ - height: 140px; - margin-bottom: 50px; -} - -#searched_for_leadin -{ - font-family: "MuseoSans-900"; - font-size: 10px; - text-align: center; - padding-top: 39px; -} - -#searched_for_term -{ - font-family: "MuseoSlab-500"; - font-size: 24px; - text-align: center; - padding-top: 9px; -} - -#search_filters -{ - height: 33px; - width: 580px; - margin: 0 auto; - padding-top: 15px; - padding-bottom: 10px; -} - -#search_filters ul -{ - margin: 0; -} - -#search_filters li -{ - list-style: none; - float: left; - cursor: pointer; -} - -#search_filters .filter_button -{ - margin: 1px; - padding: 8px 13px 4px; - font-family: "MuseoSlab-700"; - font-size: 12px; - text-align: center; - color: #000; - text-transform: uppercase; -} - -#search_filters .filter_button.button_interior -{ - color: #FFF; -} - -/* COLUMNS */ - -.course_result, .notes_result -{ - margin-bottom: 20px!important; -} - -.no_result -{ - font-family: "MuseoSlab-500"; - font-size: 11px; - color: #555; - line-height: 150%; -} - -/* COURSE COLUMN */ - -.course_meta_stat -{ - font-family: "MuseoSlab-900"; - font-size: 33px; - color: #bababa; -} - -.course_meta_name -{ - font-family: "MuseoSlab-900"; - font-size: 8px; - color: #bababa; -} - -/* NOTES COLUMN */ - -.notes_result_container -{ - padding: 0 10px; -} - -.notes_result -{ - padding: 10px; -} - -.wide .notes_result -{ - padding: 10px 20px; -} - -/* PROF, SCHOOLS, USERS COLUMN */ - -.prof_result_container, .school_result_container, .user_result_container -{ - padding: 0 10px; -} - -.prof_result, .school_result, .user_result -{ - margin-bottom: 10px!important; - padding: 5px 5px 0px; - margin-top: -10px!important; -} - -.user_karma_points -{ - color: #FFF; - background-color: #f05a28; - font-family: "MuseoSlab-900"; - font-size: 11px; - padding: 2px; - display: inline-block; - margin-top: 2px; -} - -.prof_school -{ - font-family: "MuseoSans-700"; - font-size: 9px; - text-transform: uppercase; -} - -.school_result.tall, .user_result.tall -{ - padding: 10px!important; -} - -.result_grid_row -{ - padding-bottom: 10px; -} - -.prof_name, .user_name, .school_name -{ - font-family: "MuseoSlab-700"; - font-size: 13px; -} - -.school_result_points -{ - background-color: #f05a28; - color: #FFF; - font-family: "MuseoSlab-900"; - text-align: center; - width: 45px; - height: 45px; - padding: 5px 1px; - float: right; - margin-bottom: 5px; -} - -.school_result_points_count -{ - font-size: 18px; -} - -.school_result_points_caption -{ - font-size: 8px; - text-transform: uppercase; -} - -.school_result_name -{ - font-family: "MuseoSlab-700"; - font-size: 13px; - color: black; -} - -/* PAGINATION */ - -#search_pagination -{ - margin: 45px auto; - padding-bottom: 45px; -} - -#search_pagination_left, #search_pagination_right -{ - float: left; - width: 21px; - cursor: pointer; -} - -#search_pagination_left img, #search_pagination_right img -{ - padding-bottom: 8px; - -} - -#search_pagination_numbers ul -{ - margin: 0; -} - -#search_pagination_numbers li -{ - list-style: none; - float: left; - font-family: "MuseoSlab-700"; - font-size: 15px; - padding: 0 11px; - cursor: pointer; -} - -#search_pagination_numbers li.button_interior -{ - color: #FFF; -} - -#search_pagination_right -{ - text-align: right; -} - -/* ADD */ -#add_result -{ - background-color: #d3d3d3; - padding: 25px 45px; - font-family: "MuseoSlab-500"; - font-size: 12px; -} - -#add_result a -{ - color: #000; - text-decoration: underline; -} diff --git a/karmaworld/assets/js/course-detail.js b/karmaworld/assets/js/course-detail.js index 1e9d5e7..3a5e5b6 100644 --- a/karmaworld/assets/js/course-detail.js +++ b/karmaworld/assets/js/course-detail.js @@ -94,46 +94,4 @@ $(function() { KARMAWORLD.Course.initCourseNameAutocomplete({}); KARMAWORLD.Course.initInstructorNameAutocomplete({}); - $(function() { - - // load dataTable for course data - var dataTable = $('#data_table_list').dataTable({ - // we will set column widths explicitly - 'bAutoWidth': false, - // don't provide a option for the user to change the table page length - 'bLengthChange': false, - // sepcify the number of rows in a page - 'iDisplayLength': 20, - // Position the filter bar at the top - 'sDom': '<"top">rt<"bottom"p><"clear">', - // Specify options for each column - "aoColumnDefs": [ - { - // 2nd element: thanks - "aTargets": [ 1 ], - "bSortable": true, - "bVisible": true - }, - { - // 1st element: date - "aTargets": [ 0 ], - "bSortable": true, - "bVisible": true - } - ], - // Initial sorting - 'aaSorting': [[1,'desc']] - }); - - // wire up sort chooser - $('select.course-sort').change(function() { - dataTable.fnSort([[$(this).val(), 'desc']]); - }); - - // sort by current value of sort chooser, since - // the browser may change this from our default - dataTable.fnSort([[$('select.note-sort').val(), 'desc']]); - - }); - }); diff --git a/karmaworld/assets/js/note-list.js b/karmaworld/assets/js/note-list.js new file mode 100644 index 0000000..9022f01 --- /dev/null +++ b/karmaworld/assets/js/note-list.js @@ -0,0 +1,41 @@ +$(function() { + // load dataTable for course data + var dataTable = $('#data_table_list').dataTable({ + // we will set column widths explicitly + 'bAutoWidth': false, + // don't provide a option for the user to change the table page length + 'bLengthChange': false, + // sepcify the number of rows in a page + 'iDisplayLength': 20, + // Position the filter bar at the top + 'sDom': dataTable_sDom, + // Specify options for each column + "aoColumnDefs": [ + { + // 2nd element: thanks + "aTargets": [ 1 ], + "bSortable": true, + "bVisible": true + }, + { + // 1st element: date + "aTargets": [ 0 ], + "bSortable": true, + "bVisible": true + } + ], + // Initial sorting + 'aaSorting': [[1,'desc']] + }); + + if (dataTable.length > 0) { + // wire up sort chooser + $('select.note-sort').change(function() { + dataTable.fnSort([[$(this).val(), 'desc']]); + }); + + // sort by current value of sort chooser, since + // the browser may change this from our default + dataTable.fnSort([[$('select.note-sort').val(), 'desc']]); + } +}); diff --git a/karmaworld/templates/account/base.html b/karmaworld/templates/account/base.html index dae2b6b..fee6871 100644 --- a/karmaworld/templates/account/base.html +++ b/karmaworld/templates/account/base.html @@ -3,7 +3,7 @@ {% block raw_content %}
-
+
{% block content %} {% endblock %}
diff --git a/karmaworld/templates/base.html b/karmaworld/templates/base.html index b2df969..01e9ed0 100644 --- a/karmaworld/templates/base.html +++ b/karmaworld/templates/base.html @@ -9,10 +9,10 @@ - + diff --git a/karmaworld/templates/control_panel.html b/karmaworld/templates/control_panel.html index d98582e..c549ccf 100644 --- a/karmaworld/templates/control_panel.html +++ b/karmaworld/templates/control_panel.html @@ -3,16 +3,16 @@ {% load i18n %} {% load account %} -{% block head_title %}Control Panel{% endblock %} +{% block title %}Control Panel{% endblock %} {% block content %} -

Hello {% user_display user %}!

- -

Control Panel

- -

Add/Remove Emails

-

Change Password

-

Social Accounts

+

Hello {% user_display user %}!

+

Your account control panel:

+ {% endblock %} diff --git a/karmaworld/templates/courses/course_detail.html b/karmaworld/templates/courses/course_detail.html index 32a71ed..96ff83f 100644 --- a/karmaworld/templates/courses/course_detail.html +++ b/karmaworld/templates/courses/course_detail.html @@ -3,16 +3,14 @@ {% block pagescripts %} - - - {% endblock %} @@ -23,6 +21,9 @@ {% block bodyscripts %} + + + {% endblock %} @@ -148,9 +149,9 @@ {{ file_upload_form.fp_file }}
-
+ - +
diff --git a/karmaworld/templates/courses/course_list.html b/karmaworld/templates/courses/course_list.html index 515c8de..c161f1b 100644 --- a/karmaworld/templates/courses/course_list.html +++ b/karmaworld/templates/courses/course_list.html @@ -18,6 +18,7 @@ var json_school_course_list = "{% url 'json_school_course_list' %}" var json_school_course_instructor_list = "{% url 'json_school_course_instructor_list' %}" var csrf_token = "{{ csrf_token }}"; + var dataTable_sDom = '<"top">rt<"bottom"p><"clear">'; diff --git a/karmaworld/templates/notes/note_list_entry.html b/karmaworld/templates/notes/note_list_entry.html index f9c89d0..39efb3c 100644 --- a/karmaworld/templates/notes/note_list_entry.html +++ b/karmaworld/templates/notes/note_list_entry.html @@ -13,7 +13,13 @@ {{ note.thanks }} thanks
-
{{ note.text|slice:":500" }} …
+ {% if note_preview %} +
{{ note_preview|safe }} …
+ {% elif note.text|length <= 500 %} +
{{ note.text }}
+ {% else %} +
{{ note.text|slice:":500" }} …
+ {% endif %}
{% if note.tags.count > 0 %} Tags: diff --git a/karmaworld/templates/notes/search_results.html b/karmaworld/templates/notes/search_results.html index 4b0965b..ff51b1a 100644 --- a/karmaworld/templates/notes/search_results.html +++ b/karmaworld/templates/notes/search_results.html @@ -6,142 +6,81 @@ {% endblock %} {% block pagestyle %} - + {% endblock %} -{% block pagescripts %} - - +{% block bodyscripts %} + + + {% endblock %} {% block raw_content %}
- -
- - {% if course %} + {% if course %} +
- - {% endif %} - -
-
- YOU SEARCHED FOR -
+ {% endif %} +
-
- {{ query }} +
+ You searched for "{{ query }}" in + {% if course %} + {{ course.name }} + {% else %} + all notes + {% endif %}
+
- {% if course %} -
-
- IN COURSE -
-
- -
-
- {{ course.name }} -
+
{% if object_list %} -
+
- - - - - - - - + + + + + + + {% for tuple in object_list %} {% include 'notes/note_list_entry.html' with note=tuple.0 note_preview=tuple.1 %} diff --git a/karmaworld/templates/user_profile.html b/karmaworld/templates/user_profile.html index 71ab51b..31c62c0 100644 --- a/karmaworld/templates/user_profile.html +++ b/karmaworld/templates/user_profile.html @@ -6,6 +6,14 @@ {% endblock %} +{% block bodyscripts %} + +{% endblock %} + {% block title %} Your KarmaNotes Profile {% endblock %} @@ -53,6 +61,64 @@
+
+
+ +
+ {% for item in object_list %} + +
+
+ +
+ {% if 'KarmaEvent' in item.0 %} + {% with event=item.1 %} +
+
+ {{ event.timestamp|date:"D b j Y" }} +
+
+ {% if event.points > 0 %} + +{{ event.points }} + {% else %} + {{ event.points }} + {% endif %} + {{ event.get_message }} +
+ {% if item.0 == 'NoteKarmaEvent' %} + + + {% endif %} + {% if item.0 == 'CourseKarmaEvent' %} + +
+ {{ event.course.school.name }} +
+ {% endif %} + +
+ {% endwith %} + + {% endif %} + + +
+ +
+
+ + {% endfor %} +
+
+
@@ -68,55 +134,7 @@
{% endif %} - {% for item in object_list %} - -
-
- -
- {% if 'KarmaEvent' in item.0 %} - {% with event=item.1 %} -
-
- {{ event.timestamp|date:"D b j Y" }} -
-
- {% if event.points > 0 %} - +{{ event.points }} - {% else %} - {{ event.points }} - {% endif %} - {{ event.get_message }} -
- {% if item.0 == 'NoteKarmaEvent' %} - - - {% endif %} - {% if item.0 == 'CourseKarmaEvent' %} - -
- {{ event.course.school.name }} -
- {% endif %} - -
- {% endwith %} - - {% endif %} - - -
- -
-
- {% endfor %}
-- 2.25.1
Sort by: Date Popularity Name Tags Preview
Date Popularity Preview