Commit f016de78 by swdanielli

Merge pull request #6 from pmitros/dev

Dev
parents cc6716a4 5fd242af
...@@ -406,6 +406,7 @@ class RecommenderXBlock(XBlock): ...@@ -406,6 +406,7 @@ class RecommenderXBlock(XBlock):
Returns: Returns:
is_user_staff: indicator for whether the user is staff is_user_staff: indicator for whether the user is staff
""" """
tracker.emit('is_user_staff', {'is_user_staff': self.xmodule_runtime.user_is_staff})
return {'is_user_staff': self.xmodule_runtime.user_is_staff} return {'is_user_staff': self.xmodule_runtime.user_is_staff}
@XBlock.json_handler @XBlock.json_handler
...@@ -422,7 +423,6 @@ class RecommenderXBlock(XBlock): ...@@ -422,7 +423,6 @@ class RecommenderXBlock(XBlock):
Returns: Returns:
result['Success']: the boolean indicator for whether the setting is complete result['Success']: the boolean indicator for whether the setting is complete
""" """
print
self.s3_configuration['aws_access_key'] = data['aws_access_key'] self.s3_configuration['aws_access_key'] = data['aws_access_key']
self.s3_configuration['aws_secret_key'] = data['aws_secret_key'] self.s3_configuration['aws_secret_key'] = data['aws_secret_key']
self.s3_configuration['bucketName'] = data['bucketName'] self.s3_configuration['bucketName'] = data['bucketName']
...@@ -430,6 +430,7 @@ class RecommenderXBlock(XBlock): ...@@ -430,6 +430,7 @@ class RecommenderXBlock(XBlock):
self.s3_configuration['uploadedFileDir'] = data['uploadedFileDir'] self.s3_configuration['uploadedFileDir'] = data['uploadedFileDir']
else: else:
self.s3_configuration['uploadedFileDir'] = data['uploadedFileDir'] + '/' self.s3_configuration['uploadedFileDir'] = data['uploadedFileDir'] + '/'
tracker.emit('set_s3_info', self.s3_configuration)
return {'Success': True} return {'Success': True}
def student_view(self, context=None): def student_view(self, context=None):
...@@ -456,7 +457,9 @@ class RecommenderXBlock(XBlock): ...@@ -456,7 +457,9 @@ class RecommenderXBlock(XBlock):
frag = Fragment(self.template_lookup.get_template("recommender.html").render(resources = resources, upvotedIds = self.upvotedIds, downvotedIds = self.downvotedIds, flaggedIds = self.flaggedIds, flaggedReasons = self.flaggedReasons)) frag = Fragment(self.template_lookup.get_template("recommender.html").render(resources = resources, upvotedIds = self.upvotedIds, downvotedIds = self.downvotedIds, flaggedIds = self.flaggedIds, flaggedReasons = self.flaggedReasons))
frag.add_css_url("//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css") frag.add_css_url("//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css")
frag.add_javascript_url("//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js") frag.add_javascript_url("//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js")
frag.add_css(self.resource_string("static/css/tooltipster.css"))
frag.add_css(self.resource_string("static/css/recommender.css")) frag.add_css(self.resource_string("static/css/recommender.css"))
frag.add_javascript(self.resource_string("static/js/src/jquery.tooltipster.min.js"))
frag.add_javascript(self.resource_string("static/js/src/cats.js")) frag.add_javascript(self.resource_string("static/js/src/cats.js"))
frag.add_javascript(self.resource_string("static/js/src/recommender.js")) frag.add_javascript(self.resource_string("static/js/src/recommender.js"))
frag.initialize_js('RecommenderXBlock') frag.initialize_js('RecommenderXBlock')
......
/*
Colorbox Core Style:
The following CSS is consistent between example themes and should not be altered.
*/
#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
#cboxWrapper {max-width:none;}
#cboxOverlay{position:fixed; width:100%; height:100%;}
#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
#cboxContent{position:relative;}
#cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;}
#cboxTitle{margin:0;}
#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;}
.cboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;}
#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}
/*
User Style:
Change the following styles to modify the appearance of Colorbox. They are
ordered & tabbed in a way that represents the nesting of the generated HTML.
*/
#cboxOverlay{background:#fff;}
#colorbox{outline:0;}
#cboxContent{margin-top:32px; overflow:visible; background:#1d9dd9;}
.cboxIframe{background:#fff;}
#cboxError{padding:50px; border:1px solid #ccc;}
#cboxLoadedContent{background:#1d9dd9; padding:1px;}
#cboxLoadingGraphic{no-repeat center center;}
#cboxLoadingOverlay{background:#000;}
#cboxTitle{position:absolute; top:-22px; left:0; color:#000;}
#cboxCurrent{position:absolute; top:-22px; right:205px; text-indent:-9999px;}
/* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
#cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; text-indent:-9999px; width:20px; height:20px; position:absolute; top:-20px; background:url(http://s3-us-west-2.amazonaws.com/danielswli/img/controls.png) no-repeat 0 0;}
/* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
#cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;}
#cboxPrevious{background-position:0px 0px; right:44px;}
#cboxPrevious:hover{background-position:0px -25px;}
#cboxNext{background-position:-25px 0px; right:22px;}
#cboxNext:hover{background-position:-25px -25px;}
#cboxClose{background-position:-50px 0px; right:0;}
#cboxClose:hover{background-position:-50px -25px;}
.cboxSlideshow_on #cboxPrevious, .cboxSlideshow_off #cboxPrevious{right:66px;}
.cboxSlideshow_on #cboxSlideshow{background-position:-75px -25px; right:44px;}
.cboxSlideshow_on #cboxSlideshow:hover{background-position:-100px -25px;}
.cboxSlideshow_off #cboxSlideshow{background-position:-100px 0px; right:44px;}
.cboxSlideshow_off #cboxSlideshow:hover{background-position:-75px -25px;}
/* CSS for RecommenderXBlock */ /* CSS for RecommenderXBlock */
.clearFix {clear: both; height: 0;}
.recommender_block .count { .recommender_block .count {
font-weight: bold; font-weight: bold;
...@@ -20,8 +21,6 @@ ...@@ -20,8 +21,6 @@
} }
.recommender_row_top, .recommender_modify_title_container { .recommender_row_top, .recommender_modify_title_container {
/* overflow:scroll;
max-height:200px;*/
font-size: 14px; font-size: 14px;
padding-top: 0.5em; padding-top: 0.5em;
padding-left: 0.5em; padding-left: 0.5em;
...@@ -78,16 +77,11 @@ ...@@ -78,16 +77,11 @@
.recommender_modify { .recommender_modify {
width: 700px; width: 700px;
/* float: left; */
} }
.descriptionImg { .descriptionImg {
/*height: 400px; max-height: 600px;
overflow-x: scroll; max-width: 700px;
margin-top: 2em;
float: left;*/
height: 600px;
width: 700px;
margin-top: 2em; margin-top: 2em;
} }
...@@ -99,8 +93,8 @@ ...@@ -99,8 +93,8 @@
.previewingImg { .previewingImg {
margin-top: 1em; margin-top: 1em;
max-width: 100%; max-width: 700px;
max-height: 100%; max-height: 600px;
} }
.recommender_vote_arrow_down { .recommender_vote_arrow_down {
...@@ -162,7 +156,7 @@ ...@@ -162,7 +156,7 @@
.recommender_vote_arrow_down, .recommender_vote_arrow_up, .recommender_title, .resource_edit_button, .flagResource, .staffEdition, .resource_add_button, .hide-show, .paginationCell, .backToViewButton { cursor: pointer; } .recommender_vote_arrow_down, .recommender_vote_arrow_up, .recommender_title, .resource_edit_button, .flagResource, .staffEdition, .resource_add_button, .hide-show, .paginationCell, .backToViewButton { cursor: pointer; }
.resource_add_button { text-align: right; font-weight: bold; } .resource_add_button { float: right; font-weight: bold; }
.resource_edit_button { float: left; } .resource_edit_button { float: left; }
.addSourceBlockTitle, .editSourceBlockTitle, .flagSourceBlockTitle, .staffEditionBlockTitle { .addSourceBlockTitle, .editSourceBlockTitle, .flagSourceBlockTitle, .staffEditionBlockTitle {
margin-bottom: 1em; margin-bottom: 1em;
...@@ -230,5 +224,17 @@ ...@@ -230,5 +224,17 @@
.moreIcon:before { content: '...'; } .moreIcon:before { content: '...'; }
.lightgreyBg { background-color: #948f8f; } .lightgreyBg { background-color: #948f8f; }
.my-custom-theme {
background: #948f8f;
color: black;
}
.my-custom-theme .tooltipster-content {
font-family: Arial, sans-serif;
font-size: 14px;
line-height: 16px;
padding: 8px 10px;
}
a:link, a:visited { color: black; } a:link, a:visited { color: black; }
form { margin: 0em; } form { margin: 0em; }
/* This is the default Tooltipster theme (feel free to modify or duplicate and create multiple themes!): */
.tooltipster-default {
border-radius: 5px;
border: 2px solid #000;
background: #4c4c4c;
color: #fff;
}
/* Use this next selector to style things like font-size and line-height: */
.tooltipster-default .tooltipster-content {
font-family: Arial, sans-serif;
font-size: 14px;
line-height: 16px;
padding: 8px 10px;
overflow: hidden;
}
/* This next selector defines the color of the border on the outside of the arrow. This will automatically match the color and size of the border set on the main tooltip styles. Set display: none; if you would like a border around the tooltip but no border around the arrow */
.tooltipster-default .tooltipster-arrow .tooltipster-arrow-border {
/* border-color: ... !important; */
}
/* If you're using the icon option, use this next selector to style them */
.tooltipster-icon {
cursor: help;
margin-left: 4px;
}
/* This is the base styling required to make all Tooltipsters work */
.tooltipster-base {
padding: 0;
font-size: 0;
line-height: 0;
position: absolute;
left: 0;
top: 0;
z-index: 9999999;
pointer-events: none;
width: auto;
overflow: visible;
}
.tooltipster-base .tooltipster-content {
overflow: hidden;
}
/* These next classes handle the styles for the little arrow attached to the tooltip. By default, the arrow will inherit the same colors and border as what is set on the main tooltip itself. */
.tooltipster-arrow {
display: block;
text-align: center;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: -1;
}
.tooltipster-arrow span, .tooltipster-arrow-border {
display: block;
width: 0;
height: 0;
position: absolute;
}
.tooltipster-arrow-top span, .tooltipster-arrow-top-right span, .tooltipster-arrow-top-left span {
border-left: 8px solid transparent !important;
border-right: 8px solid transparent !important;
border-top: 8px solid;
bottom: -7px;
}
.tooltipster-arrow-top .tooltipster-arrow-border, .tooltipster-arrow-top-right .tooltipster-arrow-border, .tooltipster-arrow-top-left .tooltipster-arrow-border {
border-left: 9px solid transparent !important;
border-right: 9px solid transparent !important;
border-top: 9px solid;
bottom: -7px;
}
.tooltipster-arrow-bottom span, .tooltipster-arrow-bottom-right span, .tooltipster-arrow-bottom-left span {
border-left: 8px solid transparent !important;
border-right: 8px solid transparent !important;
border-bottom: 8px solid;
top: -7px;
}
.tooltipster-arrow-bottom .tooltipster-arrow-border, .tooltipster-arrow-bottom-right .tooltipster-arrow-border, .tooltipster-arrow-bottom-left .tooltipster-arrow-border {
border-left: 9px solid transparent !important;
border-right: 9px solid transparent !important;
border-bottom: 9px solid;
top: -7px;
}
.tooltipster-arrow-top span, .tooltipster-arrow-top .tooltipster-arrow-border, .tooltipster-arrow-bottom span, .tooltipster-arrow-bottom .tooltipster-arrow-border {
left: 0;
right: 0;
margin: 0 auto;
}
.tooltipster-arrow-top-left span, .tooltipster-arrow-bottom-left span {
left: 6px;
}
.tooltipster-arrow-top-left .tooltipster-arrow-border, .tooltipster-arrow-bottom-left .tooltipster-arrow-border {
left: 5px;
}
.tooltipster-arrow-top-right span, .tooltipster-arrow-bottom-right span {
right: 6px;
}
.tooltipster-arrow-top-right .tooltipster-arrow-border, .tooltipster-arrow-bottom-right .tooltipster-arrow-border {
right: 5px;
}
.tooltipster-arrow-left span, .tooltipster-arrow-left .tooltipster-arrow-border {
border-top: 8px solid transparent !important;
border-bottom: 8px solid transparent !important;
border-left: 8px solid;
top: 50%;
margin-top: -7px;
right: -7px;
}
.tooltipster-arrow-left .tooltipster-arrow-border {
border-top: 9px solid transparent !important;
border-bottom: 9px solid transparent !important;
border-left: 9px solid;
margin-top: -8px;
}
.tooltipster-arrow-right span, .tooltipster-arrow-right .tooltipster-arrow-border {
border-top: 8px solid transparent !important;
border-bottom: 8px solid transparent !important;
border-right: 8px solid;
top: 50%;
margin-top: -7px;
left: -7px;
}
.tooltipster-arrow-right .tooltipster-arrow-border {
border-top: 9px solid transparent !important;
border-bottom: 9px solid transparent !important;
border-right: 9px solid;
margin-top: -8px;
}
/* Some CSS magic for the awesome animations - feel free to make your own custom animations and reference it in your Tooltipster settings! */
.tooltipster-fade {
opacity: 0;
-webkit-transition-property: opacity;
-moz-transition-property: opacity;
-o-transition-property: opacity;
-ms-transition-property: opacity;
transition-property: opacity;
}
.tooltipster-fade-show {
opacity: 1;
}
.tooltipster-grow {
-webkit-transform: scale(0,0);
-moz-transform: scale(0,0);
-o-transform: scale(0,0);
-ms-transform: scale(0,0);
transform: scale(0,0);
-webkit-transition-property: -webkit-transform;
-moz-transition-property: -moz-transform;
-o-transition-property: -o-transform;
-ms-transition-property: -ms-transform;
transition-property: transform;
-webkit-backface-visibility: hidden;
}
.tooltipster-grow-show {
-webkit-transform: scale(1,1);
-moz-transform: scale(1,1);
-o-transform: scale(1,1);
-ms-transform: scale(1,1);
transform: scale(1,1);
-webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1);
-webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
-moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
-ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
-o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
}
.tooltipster-swing {
opacity: 0;
-webkit-transform: rotateZ(4deg);
-moz-transform: rotateZ(4deg);
-o-transform: rotateZ(4deg);
-ms-transform: rotateZ(4deg);
transform: rotateZ(4deg);
-webkit-transition-property: -webkit-transform, opacity;
-moz-transition-property: -moz-transform;
-o-transition-property: -o-transform;
-ms-transition-property: -ms-transform;
transition-property: transform;
}
.tooltipster-swing-show {
opacity: 1;
-webkit-transform: rotateZ(0deg);
-moz-transform: rotateZ(0deg);
-o-transform: rotateZ(0deg);
-ms-transform: rotateZ(0deg);
transform: rotateZ(0deg);
-webkit-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 1);
-webkit-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
-moz-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
-ms-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
-o-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
}
.tooltipster-fall {
top: 0;
-webkit-transition-property: top;
-moz-transition-property: top;
-o-transition-property: top;
-ms-transition-property: top;
transition-property: top;
-webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1);
-webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
-moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
-ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
-o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
}
.tooltipster-fall-show {
}
.tooltipster-fall.tooltipster-dying {
-webkit-transition-property: all;
-moz-transition-property: all;
-o-transition-property: all;
-ms-transition-property: all;
transition-property: all;
top: 0px !important;
opacity: 0;
}
.tooltipster-slide {
left: -40px;
-webkit-transition-property: left;
-moz-transition-property: left;
-o-transition-property: left;
-ms-transition-property: left;
transition-property: left;
-webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1);
-webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
-moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
-ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
-o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
}
.tooltipster-slide.tooltipster-slide-show {
}
.tooltipster-slide.tooltipster-dying {
-webkit-transition-property: all;
-moz-transition-property: all;
-o-transition-property: all;
-ms-transition-property: all;
transition-property: all;
left: 0px !important;
opacity: 0;
}
/* CSS transition for when contenting is changing in a tooltip that is still open. The only properties that will NOT transition are: width, height, top, and left */
.tooltipster-content-changing {
opacity: 0.5;
-webkit-transform: scale(1.1, 1.1);
-moz-transform: scale(1.1, 1.1);
-o-transform: scale(1.1, 1.1);
-ms-transform: scale(1.1, 1.1);
transform: scale(1.1, 1.1);
}
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
</div> </div>
</div> </div>
<div class="resource_add_button">Add new resource &gt;&gt;</div> <div class="resource_add_button">Add new resource &gt;&gt;</div>
<div class="clearFix"></div>
<div class='pagination'> <div class='pagination'>
<div class="paginationRowTemplate hidden"> <div class="paginationRowTemplate hidden">
<div class="paginationCell leftArrowIcon"></div> <div class="paginationCell leftArrowIcon"></div>
......
var tooltipsCats = [ var tooltipsCatsPerResource = [
'.resource_add_button',
'.resource_edit_button', '.resource_edit_button',
'.recommender_vote_arrow_up', '.recommender_vote_arrow_up',
'.recommender_vote_arrow_down', '.recommender_vote_arrow_down',
'.recommender_vote_score', '.recommender_vote_score',
'.recommender_blurb', 'a',
'.flagResource'
];
var tooltipsCats = [
'.resource_add_button',
'.previewingImg', '.previewingImg',
'.in_title', '.in_title',
'.in_url', '.in_url',
...@@ -12,9 +16,6 @@ var tooltipsCats = [ ...@@ -12,9 +16,6 @@ var tooltipsCats = [
'.edit_url', '.edit_url',
'.backToViewButton', '.backToViewButton',
'.flag_reason', '.flag_reason',
'.flagResource',
'.flagResource.problematic',
'.recommender_row_top',
'.recommender_row_top.resource_list_expanded' '.recommender_row_top.resource_list_expanded'
]; ];
...@@ -24,7 +25,7 @@ var tooltipsCatsText = { ...@@ -24,7 +25,7 @@ var tooltipsCatsText = {
'.recommender_vote_arrow_up': 'Upvote if the resource is helpful', '.recommender_vote_arrow_up': 'Upvote if the resource is helpful',
'.recommender_vote_arrow_down': 'Downvote if the resource is not helpful', '.recommender_vote_arrow_down': 'Downvote if the resource is not helpful',
'.recommender_vote_score': 'Votes', // '.recommender_vote_score': 'Votes', //
'.recommender_blurb': 'Resource title', // TODO: I would suggest making the description be the tooltip. 'a': 'Resource title', // TODO: I would suggest making the description be the tooltip.
'.previewingImg': 'Preview image (typically, a screenshot)', '.previewingImg': 'Preview image (typically, a screenshot)',
'.in_title': 'Give a short (1-3 sentence) summary of the resource; ideally, this should be concise, but give enough detail to let students know whether this resources is useful to them', '.in_title': 'Give a short (1-3 sentence) summary of the resource; ideally, this should be concise, but give enough detail to let students know whether this resources is useful to them',
'.in_url': 'Cut-and-paste the URL of the resource.', '.in_url': 'Cut-and-paste the URL of the resource.',
...@@ -32,8 +33,7 @@ var tooltipsCatsText = { ...@@ -32,8 +33,7 @@ var tooltipsCatsText = {
'.edit_url': 'Cut-and-paste the URL of the resource.', // TODO: Give instructions to go to element of learning sequence, or time in video '.edit_url': 'Cut-and-paste the URL of the resource.', // TODO: Give instructions to go to element of learning sequence, or time in video
'.backToViewButton': 'Go back to the main list', '.backToViewButton': 'Go back to the main list',
'.flag_reason': 'Give a meaningful reason for why this resource should be removed', '.flag_reason': 'Give a meaningful reason for why this resource should be removed',
'.flagResource': 'Flag this resource as problematic', '.flagResource': 'Flag this resource as problematic and give your reason',
'.flagResource.problematic': 'Unflag this problematic resource or edit the reason for it',
'.recommender_row_top': 'Show a list of student-recommented related resources', '.recommender_row_top': 'Show a list of student-recommented related resources',
'.recommender_row_top.resource_list_expanded': 'Hide the recommendations list' '.recommender_row_top.resource_list_expanded': 'Hide the recommendations list'
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment