From: Charles Connell Date: Fri, 7 Mar 2014 02:47:34 +0000 (-0500) Subject: More work on the front page X-Git-Tag: release-20150131~144^2~41 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=83cb359761f7111faac8a23f63bd6de032e63978;p=oweals%2Fkarmaworld.git More work on the front page --- diff --git a/karmaworld/assets/css/global.css b/karmaworld/assets/css/global.css index e5e3e7b..990b651 100644 --- a/karmaworld/assets/css/global.css +++ b/karmaworld/assets/css/global.css @@ -39,6 +39,14 @@ background-image: -o-linear-gradient(top, #ffffff, #e8e8e8); /* Opera 11.10-12.00 */ background-image: linear-gradient(to bottom, #ffffff, #e8e8e8); /* Firefox 16+, IE10, Opera 12.50+ */ border-bottom: solid 1px #bdbcbd; - -webkit-box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, .35); /* Safari 3-4, iOS 4.0.2 - 4.2, Android 2.3+ */ - box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, .35); /* Opera 10.5, IE9+, Firefox 4+, Chrome 6+, iOS 5 */ -} \ No newline at end of file +} + +#global_footer { + line-height: 1.5em; + margin: 10px 0 20px 0; +} + +#footer-links-container { + border-top: 1px dashed grey; +} + diff --git a/karmaworld/assets/css/home.css b/karmaworld/assets/css/home.css index e19b66b..6dff109 100644 --- a/karmaworld/assets/css/home.css +++ b/karmaworld/assets/css/home.css @@ -23,15 +23,6 @@ input.search-courses { margin-right: 0; } -button.search-courses { - display: inline; - border: 1px solid grey; - padding: 5px; - margin: 0; - background: white; - color: grey; -} - #course-sort-wrapper { float: right; display: inline; @@ -46,4 +37,30 @@ select.course-sort { padding: 10px 0 0 0; } +span.table-school, +span.table-note-count, +span.table-quiz-count, +span.table-thanks-count { + font-weight: bold; +} + +span.table-course-name { + font-size: 2em; + font-weight: bold; +} + +table.dataTable tbody tr { + height: 8em; + border-bottom: 1px solid grey; +} + +td.last-td { + border-bottom: 1px solid grey; +} + +#add-course-btn { + text-transform: uppercase; + font-size: 2.5em; + text-align: center; +} diff --git a/karmaworld/assets/js/course-list.js b/karmaworld/assets/js/course-list.js new file mode 100644 index 0000000..9e2d077 --- /dev/null +++ b/karmaworld/assets/js/course-list.js @@ -0,0 +1,59 @@ +$(function() { + + if (jump_to_form) { + $("#add-course-form").show(); + $('#add-course-btn').hide(); + document.getElementById('add-course-form').scrollIntoView(true); + } + + // 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": [ + { + // 3rd element: thanks + "aTargets": [ 2 ], + "bSortable": true, + "bVisible": true + }, + { + // 2nd element: notes + "aTargets": [ 1 ], + "bSortable": true, + "bVisible": true + }, + { + // 1st element: date + "aTargets": [ 0 ], + "bSortable": true, + "bVisible": true + } + ], + // Initial sorting + 'aaSorting': [[2,'desc']] + }); + + // wire up search box + $('input.search-courses').keyup(function() { + dataTable.fnFilter($(this).val()); + }); + + // 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.course-sort').val(), 'desc']]); + +}); + diff --git a/karmaworld/templates/courses/course_list.html b/karmaworld/templates/courses/course_list.html index e9e7972..45ac916 100644 --- a/karmaworld/templates/courses/course_list.html +++ b/karmaworld/templates/courses/course_list.html @@ -6,72 +6,18 @@ {% endblock %} {% block pagestyle %} - - - + + + {% endblock %} {% block pagescripts %} - - - + + + {% endblock %} {% block content %} @@ -86,15 +32,14 @@ $(document).ready(function() {