Skip to content
Snippets Groups Projects
Commit 828430d6 authored by David Ormsbee's avatar David Ormsbee
Browse files

Merge pull request #557 from MITx/feature/tomg/courseware_signin

Added a log in button to the courseware when unauthenticated
parents d095b777 4a06deca
No related merge requests found
Showing with 143 additions and 56 deletions
......@@ -61,13 +61,12 @@ nav.sequence-nav {
min-width: 20px;
a {
width: 34px;
height: 34px;
margin: 4px auto;
background-position: center 10px;
width: 100%;
height: 42px;
margin: 0;
background-position: center 14px;
background-repeat: no-repeat;
border: 1px solid transparent;
@include border-radius(35px);
cursor: pointer;
display: block;
padding: 0;
......@@ -82,7 +81,7 @@ nav.sequence-nav {
&:hover {
background-color: #fff;
background-repeat: no-repeat;
background-position: center 10px;
background-position: center 14px;
}
&.active {
......@@ -103,7 +102,7 @@ nav.sequence-nav {
&:hover {
background-color: #fff;
background-repeat: no-repeat;
background-position: center 10px;
background-position: center 14px;
}
}
......@@ -298,14 +297,16 @@ nav.sequence-bottom {
ul {
@extend .clearfix;
border: 1px solid $border-color;
@include border-radius(3px);
@include inline-block();
width: 100px;
width: 103px;
li {
float: left;
width: 50%;
width: 50px;
height: 44px;
border: 1px solid #ccc;
@include linear-gradient(top, #eee, #ddd);
@include box-shadow(0 1px 0 rgba(255, 255, 255, .7) inset);
&.prev, &.next {
margin-bottom: 0;
......@@ -318,38 +319,39 @@ nav.sequence-bottom {
padding: lh(.5) 4px;
text-indent: -9999px;
@include transition(all, .2s, $ease-in-out-quad);
outline: 0;
&:hover {
background-color: #ddd;
color: #000;
opacity: .5;
text-decoration: none;
background-position: center 15px;
}
&.disabled {
opacity: .4;
}
&:focus {
outline: 0;
}
}
}
&.prev {
border-radius: 35px 0 0 35px;
a {
background-image: url('../images/sequence-nav/previous-icon.png');
border-right: 1px solid lighten(#c6c6c6, 10%);
&:hover {
background-color: none;
}
background-position: center 15px;
}
}
&.next {
border-radius: 0 35px 35px 0;
border-left: none;
a {
background-image: url('../images/sequence-nav/next-icon.png');
&:hover {
background-color: none;
}
background-position: center 15px;
}
}
}
......@@ -360,5 +362,12 @@ div.course-wrapper section.course-content ol.vert-mod > li ul.sequence-nav-butto
list-style: none !important;
}
.xmodule_SequenceModule nav.sequence-bottom ul li.next a,
.xmodule_SequenceModule nav.sequence-bottom ul li.prev a {
outline: 0;
&:focus {
outline: 0;
}
}
......@@ -55,6 +55,7 @@ class @Sequence
element.removeClass('progress-none')
.removeClass('progress-some')
.removeClass('progress-done')
switch progress
when 'none' then element.addClass('progress-none')
when 'in_progress' then element.addClass('progress-some')
......
......@@ -13,9 +13,10 @@ class @Navigation
active: active
header: 'h3'
autoHeight: false
$('#accordion .ui-state-active').closest('.chapter').addClass('is-open')
$('#open_close_accordion a').click @toggle
$('#accordion').show()
$('#accordion a').click @setChapter
log: (event, ui) ->
log_event 'accordion',
......@@ -24,3 +25,8 @@ class @Navigation
toggle: ->
$('.course-wrapper').toggleClass('closed')
setChapter: ->
$('#accordion .is-open').removeClass('is-open')
$(this).closest('.chapter').addClass('is-open')
\ No newline at end of file
......@@ -4,13 +4,16 @@
var Gradebook = function($element) {
var _this = this;
var $element = $element;
var $body = $('body');
var $grades = $element.find('.grades');
var $studentTable = $element.find('.student-table');
var $gradeTable = $element.find('.grade-table');
var $search = $element.find('.student-search-field');
var $leftShadow = $('<div class="left-shadow"></div>');
var $rightShadow = $('<div class="right-shadow"></div>');
var tableHeight = $gradeTable.height();
var maxScroll = $gradeTable.width() - $grades.width();
var $body = $('body');
var mouseOrigin;
var tableOrigin;
......@@ -58,12 +61,35 @@ var Gradebook = function($element) {
var targetLeft = clamp($gradeTable.position().left, -maxScroll, 0);
updateHorizontalPosition(targetLeft);
setShadows(targetLeft);
}
};
var updateHorizontalPosition = function(left) {
$gradeTable.css({
'left': left + 'px'
});
};
var highlightRow = function(e) {
$element.find('.highlight').removeClass('highlight');
var index = $(this).index();
$studentTable.find('tr').eq(index + 1).addClass('highlight');
$gradeTable.find('tr').eq(index + 1).addClass('highlight');
};
var filter = function(e) {
var term = $(this).val();
if(term.length > 0) {
$studentTable.find('tbody tr').hide();
$gradeTable.find('tbody tr').hide();
$studentTable.find('tbody tr:contains(' + term + ')').each(function(i) {
$(this).show();
$gradeTable.find('tr').eq($(this).index() + 1).show();
});
} else {
$studentTable.find('tbody tr').show();
$gradeTable.find('tbody tr').show();
}
}
$leftShadow.css('height', tableHeight + 'px');
......@@ -72,5 +98,11 @@ var Gradebook = function($element) {
setShadows(0);
$grades.css('height', tableHeight);
$gradeTable.bind('mousedown', startDrag);
$element.find('tr').bind('mouseover', highlightRow);
$search.bind('keyup', filter);
$(window).bind('resize', updateWidths);
}
\ No newline at end of file
}
......@@ -27,11 +27,6 @@ var SequenceNav = function($element) {
var offset = e.pageX - mouseOrigin;
var targetLeft = clamp(listOrigin + offset, -maxScroll, 0);
console.log('---------------');
console.log('offset: ' + offset);
console.log('target left: ' + targetLeft);
console.log('max: ' + maxScroll);
updateHorizontalPosition(targetLeft);
setShadows(targetLeft);
......
......@@ -150,7 +150,8 @@ $tag-text-color: #5b614f;
//user profile
.user-profile{
.user-profile {
@extend .sidebar;
margin-top: 24px;
}
......@@ -158,6 +159,7 @@ $tag-text-color: #5b614f;
font-size: 1.5em;
font-weight: bold;
line-height: 1.5em;
margin-top: 20px;
}
.sidebar-user-roles {
......
......@@ -133,18 +133,6 @@ div.gradebook-wrapper {
box-shadow: 0 1px 0 $table-border-color inset, 0 2px 0 rgba(255, 255, 255, .7) inset;
border-left: 1px solid #ccc;
// &:before {
// content: '';
// display: block;
// position: absolute;
// left: 0;
// top: 0;
// z-index: 9999;
// width: 1px;
// height: 50px;
// @include linear-gradient(top, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, .15));
// }
&:first-child {
border-radius: 5px 0 0 0;
box-shadow: 1px 1px 0 $table-border-color inset, 1px 2px 0 rgba(255, 255, 255, .7) inset;
......@@ -205,6 +193,19 @@ div.gradebook-wrapper {
@extend .top-header;
}
}
.student-table tr:hover td,
.grade-table tr:hover td,
.student-table tr.highlight td,
.grade-table tr.highlight td {
border-color: #74b7d6;
@include linear-gradient(#8ed6f7, #76cbf4);
color: #333;
a {
color: #333;
}
}
}
......@@ -13,6 +13,7 @@ div.course-wrapper {
section.course-content {
@extend .content;
padding: 40px;
line-height: 1.6;
h1 {
margin: 0 0 lh();
......
......@@ -75,6 +75,10 @@ section.course-index {
@include box-shadow(0 1px 0 #fff inset, 0 -1px 0 rgba(0, 0, 0, .1) inset);
@include transition(background-color .1s);
&.is-open {
background: #fff;
}
&:first-child {
border-radius: 3px 0 0 0;
}
......
......@@ -67,7 +67,39 @@ header.global.slim {
@include linear-gradient(top, #fff, #eee);
.guest .secondary {
margin-right: 0;
}
.guest .secondary a {
display: none;
&#login {
display: block;
@include background-image(linear-gradient(-90deg, lighten($blue, 8%), lighten($blue, 5%) 50%, $blue 50%, darken($blue, 10%) 100%));
border: 1px solid transparent;
border-color: darken($blue, 10%);
@include border-radius(3px);
@include box-sizing(border-box);
@include box-shadow(0 1px 0 0 rgba(255,255,255, 0.6));
color: #fff;
display: inline-block;
font-family: $sans-serif;
font-size: 14px;
font-weight: bold;
@include inline-block;
letter-spacing: 0;
line-height: 1em;
margin: 4px;
padding: 6px 12px 8px;
text-decoration: none;
text-transform: none;
text-shadow: 0 -1px rgba(0, 0, 0, 0.6);
vertical-align: middle;
&:hover, &.active {
@include background-image(linear-gradient(-90deg, $blue, $blue 50%, $blue 50%, $blue 100%));
}
}
}
nav {
......@@ -86,7 +118,7 @@ header.global.slim {
height: 40px;
position: absolute;
right: 3px;
top: -8px;
top: 0;
width: 1px;
}
......@@ -97,7 +129,7 @@ header.global.slim {
height: 40px;
position: absolute;
right: 0px;
top: -12px;
top: 0;
width: 1px;
}
}
......@@ -129,7 +161,7 @@ header.global.slim {
a#signup {
position: relative;
margin-top: 4px;
margin-top: 3px;
padding: 6px 12px 8px;
text-transform: none;
font-size: 14px;
......
......@@ -68,8 +68,8 @@
@include clearfix;
border-bottom: 1px dotted rgb(220,220,220);
list-style: none;
margin-bottom: 20px;
padding-bottom: 10px;
margin-bottom: 15px;
padding-bottom: 17px;
&:hover {
.title .icon {
......@@ -77,16 +77,20 @@
}
}
span {
display: block;
}
span.title {
color: $lighter-base-font-color;
float: left;
font-family: $sans-serif;
font-size: 13px;
.icon {
background-size: cover;
float: left;
height: 19px;
margin: 2px 8px 0 0;
margin: 0 6px 0 0;
opacity: 0.6;
@include transition(all, 0.15s, linear);
width: 19px;
......@@ -112,7 +116,10 @@
span.data {
color: $lighter-base-font-color;
font-weight: 700;
margin-left: 12px;
margin-left: 26px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
}
}
......
......@@ -40,9 +40,6 @@
<script type="text/javascript">
var sequenceNav;
$(document).ready(function() {
// console.log($('.sequence-nav'));
sequenceNav = new SequenceNav($('.sequence-nav'));
console.log(sequenceNav);
});
</script>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment