From: Charles Connell Date: Tue, 29 Apr 2014 17:59:56 +0000 (-0400) Subject: A number of design changes X-Git-Tag: release-20150131~109 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=fba43eb7c453207a482c5c9423d76194fa99881a;p=oweals%2Fkarmaworld.git A number of design changes --- diff --git a/karmaworld/apps/courses/models.py b/karmaworld/apps/courses/models.py index de65a7a..f6b3f8c 100644 --- a/karmaworld/apps/courses/models.py +++ b/karmaworld/apps/courses/models.py @@ -316,7 +316,7 @@ class Course(models.Model): # loaded into memory. In that case, we avoid making any more database # queries. sum = 0 - for note in self.note_set: + for note in self.note_set.all(): sum += note.thanks return sum diff --git a/karmaworld/apps/courses/views.py b/karmaworld/apps/courses/views.py index 29445b2..873da73 100644 --- a/karmaworld/apps/courses/views.py +++ b/karmaworld/apps/courses/views.py @@ -77,6 +77,15 @@ class CourseListSubView(ListView): # get the course form for the form at the bottom of the homepage context['course_form'] = CourseForm() + schools = set() + for course in self.object_list: + if course.school: + schools.add(course.school) + elif course.department.school: + schools.add(course.department.school) + + context['schools'] = sorted(list(schools), key=lambda x: x.name) + # Include settings constants for honeypot for key in ('HONEYPOT_FIELD_NAME', 'HONEYPOT_VALUE'): context[key] = getattr(settings, key) diff --git a/karmaworld/assets/css/dashboard.css b/karmaworld/assets/css/dashboard.css index 426172a..1ed1390 100644 --- a/karmaworld/assets/css/dashboard.css +++ b/karmaworld/assets/css/dashboard.css @@ -16,6 +16,10 @@ div.stat-container { border-left: solid 1px #dfdfdf; + width: 200px; + float: left; + padding: 0 10px 0 20px; + margin: 5px 0 5px 0; } .activity_item { diff --git a/karmaworld/assets/css/global.css b/karmaworld/assets/css/global.css index c0cffad..ecda509 100644 --- a/karmaworld/assets/css/global.css +++ b/karmaworld/assets/css/global.css @@ -28,7 +28,21 @@ p { .top-bar-section ul li > a { font-family: inherit; - font-size: 1em; + font-size: 1.2em; + padding: 0; +} + +.top-bar-section ul li { + margin-left: 20px; + padding: 0; +} + +.top-bar-section ul li > a:hover { + background: #ffffff !important; + border-radius: 2px; + color: #333333 !important; + text-decoration: none !important; + font-family: 'museo700'; } #content-container { @@ -41,6 +55,20 @@ p { color: #d4d4d4; } +div.contain-to-grid { + padding: 5px 0 5px 0; +} + +@media only screen and (max-width: 500px) { + div.contain-to-grid { + padding: 0; + } + .top-bar-section ul li { + padding: 10px; + margin-left: 5px; + } +} + #header-login-nav { text-align: right; color: #ffffff; @@ -60,6 +88,12 @@ p { padding: 0 5px 0 5px; } +@media only screen and (max-width: 500px) { + #splash { + background-image: url('/static/img/banner_small.jpg'); + } +} + #global_footer { line-height: 1.5em; color: #d4d4d4; @@ -192,6 +226,7 @@ table.dataTable a { float: left; } +table.dataTable .table-row.even .data-table-entry-wrapper, .even { background-color: #fafafa !important; border-top: 1px solid #f0f0f0; @@ -226,19 +261,22 @@ ul.ui-autocomplete { } dl.tabs dd.active { - border-radius: 3px; + border-radius: 5px 5px 0 0; + border: 1px solid #dfdfdf; + border-bottom: none; } dl.tabs dd { - margin: 0 10px 0px 10px; - border: 1px solid #dfdfdf; border-bottom: none; + margin-left: 10px; } dl.tabs dd, -dl.tabs dd a { +dl.tabs dd a, +dl.tabs dd a:hover { border-top-left-radius: 3px; border-top-right-radius: 3px; + background: transparent; } dl.tabs dd a { @@ -258,3 +296,58 @@ ul.socialaccount_providers li{ display: inline; margin: 0 5px 0 5px; } + +.select-wrapper { + border: 1px solid #cfcfcf; + border-radius: 3px; + width: 100%; + height: 30px; + overflow: hidden; + background: url('/static/img/angle-down.png') no-repeat right #fff; + margin: 5px 20px 20px 0; +} + +select, +select:hover { + width: 120%; + height: 30px; + background: transparent; + border: 0px; + padding: 5px; +} + +input.search { + display: inline; + font-size: 1.2em; + font-family: 'adelle-sans'; + font-weight: lighter; + border-radius: 3px 0 0 3px; + width: calc(100% - 40px); + height: 40px; + margin-right: 0; +} + +i.search-icon, +button.search-icon { + background-color: black; + color: white; + height: 40px; + width: 40px; + vertical-align: top; + padding: 12px; + border-radius: 0 3px 3px 0; + margin-left: -4px; + margin-bottom: 0; + cursor: pointer; +} + +.sort-label { + font-size: 0.8em; + font-weight: normal; + margin-top: 10px; +} + +.filter-options { + border-bottom: 1px solid #a9a9a9; +} + diff --git a/karmaworld/assets/css/home.css b/karmaworld/assets/css/home.css index b5426a5..3c29050 100644 --- a/karmaworld/assets/css/home.css +++ b/karmaworld/assets/css/home.css @@ -26,21 +26,6 @@ } } /* medium screens and down */ -input.search-courses { - display: inline; - margin: 0 0 10px 5px; - max-width: 30em; -} - -#course-sort-wrapper { - float: right; - display: inline; -} - -select.course-sort { - width: 10em; -} - #course-search-bar { background: #f5f5f5; padding: 15px 0 0 0; @@ -52,6 +37,7 @@ select.course-sort { background: #ffffff; margin: 10px 0 0 0; padding: 5px 5px 5px 5px; + box-shadow: 1px 1px 3px black; } #add-course-form p { @@ -76,6 +62,10 @@ label.validation_error { } #add-course-btn { - width: 100% + width: 100%; + font-size: 1.2em; + border-radius: 3px; + height: 40px; + margin-bottom: 10px; } diff --git a/karmaworld/assets/css/note_course_pages.css b/karmaworld/assets/css/note_course_pages.css index cf9c33f..0bd7a7f 100644 --- a/karmaworld/assets/css/note_course_pages.css +++ b/karmaworld/assets/css/note_course_pages.css @@ -33,20 +33,10 @@ form.search-notes { display: inline; } -#note-sort-wrapper { - float: right; - display: inline; -} - -select.note-sort { - width: 10em; -} - #note-search-bar { background: #f5f5f5; padding: 15px 0 0 0; font: 1em 'museo300'; - margin-bottom: 20px; } ul.socialaccount_providers li @@ -69,7 +59,7 @@ table.dataTable span.note-thanks { div.return-to-course { background: #f5f5f5; padding: 10px 0 10px 0; - font-size: 0.8em; + font-size: 0.7em; } #results_header { @@ -114,6 +104,10 @@ div.header-title-row { button.add-note-btn { width: 100%; + font-size: 1.2em; + font-family: 'museo700'; + margin-bottom: 10px; + height: 40px; } .note-upload-remove-button { @@ -137,4 +131,9 @@ button.add-note-btn { font-size: inherit; margin: 0; padding: 5px; -} \ No newline at end of file +} + +#keyword-intro { + font-size: 0.8em; +} + diff --git a/karmaworld/assets/img/angle-down.png b/karmaworld/assets/img/angle-down.png new file mode 100644 index 0000000..85ffd36 Binary files /dev/null and b/karmaworld/assets/img/angle-down.png differ diff --git a/karmaworld/assets/img/global_header_logo.png b/karmaworld/assets/img/global_header_logo.png deleted file mode 100644 index 07e56aa..0000000 Binary files a/karmaworld/assets/img/global_header_logo.png and /dev/null differ diff --git a/karmaworld/assets/img/karmanotes_logo.png b/karmaworld/assets/img/karmanotes_logo.png new file mode 100644 index 0000000..dd3ec8b Binary files /dev/null and b/karmaworld/assets/img/karmanotes_logo.png differ diff --git a/karmaworld/assets/img/karmanotes_logo_small.png b/karmaworld/assets/img/karmanotes_logo_small.png new file mode 100644 index 0000000..c51b3af Binary files /dev/null and b/karmaworld/assets/img/karmanotes_logo_small.png differ diff --git a/karmaworld/assets/js/course-list.js b/karmaworld/assets/js/course-list.js index 68cc0cb..e526ef3 100644 --- a/karmaworld/assets/js/course-list.js +++ b/karmaworld/assets/js/course-list.js @@ -40,24 +40,26 @@ $(function() { dataTable.fnFilter($(this).val()); }); - function sortDirection(col) { - if (col == 3) { - return 'asc'; - } else { - return 'desc'; - } - } - // wire up sort chooser - $('select.course-sort').change(function() { + $('#sort-by').change(function() { var sortCol = $(this).val(); - dataTable.fnSort([[sortCol, sortDirection(sortCol)]]); + dataTable.fnSort([[sortCol, 'desc']]); }); // sort by current value of sort chooser, since // the browser may change this from our default - var sortCol = $('select.course-sort').val(); - dataTable.fnSort([[sortCol, sortDirection(sortCol)]]); + var sortCol = $('#sort-by').val(); + dataTable.fnSort([[sortCol, 'desc']]); + + // filter by chosen school + $('#school-filter').change(function() { + var schoolName = $(this).val(); + if (schoolName === 'ALL') { + dataTable.fnFilter(''); + } else { + dataTable.fnFilter(schoolName); + } + }); }); diff --git a/karmaworld/templates/courses/course_detail.html b/karmaworld/templates/courses/course_detail.html index 131e3ec..72df39b 100644 --- a/karmaworld/templates/courses/course_detail.html +++ b/karmaworld/templates/courses/course_detail.html @@ -74,11 +74,6 @@ {% else %} {% endif %} - {% else %} - {% endif %} @@ -157,29 +152,31 @@ {% endif %}