Merge remote-tracking branch 'origin/master' into error-info

# Conflicts:
#	app/controllers/concerns/submission_scoring.rb
#	app/views/application/_navigation.html.slim
#	config/locales/de.yml
#	config/locales/en.yml
#	db/schema.rb
This commit is contained in:
Maximilian Grundke
2017-10-15 17:02:19 +02:00
65 changed files with 1190 additions and 405 deletions

View File

@@ -14,6 +14,7 @@
//
//= require ace/ace
//= require chosen.jquery.min
//= require jquery-ui.min
//= require d3
//= require jquery.turbolinks
//= require jquery_ujs

View File

@@ -59,8 +59,6 @@ CodeOceanEditorCodePilot = {
}
};
//Request for comments does currently not work on staging platform (no relative root_url used here).
//To fix this rely on ruby routes
CodeOceanEditorRequestForComments = {
requestComments: function () {
var user_id = $('#editor').data('user-id');
@@ -83,6 +81,8 @@ CodeOceanEditorRequestForComments = {
}).done(function () {
this.hideSpinner();
$.flash.success({text: $('#askForCommentsButton').data('message-success')});
// trigger a run
this.runSubmission.call(this, submission);
}.bind(this)).error(this.ajaxError.bind(this));
};

View File

@@ -142,19 +142,21 @@ CodeOceanEditorSubmissions = {
* Execution-Logic
*/
runCode: function(event) {
event.preventDefault();
if ($('#run').is(':visible')) {
this.createSubmission('#run', null, function(response) {
//Run part starts here
$('#stop').data('url', response.stop_url);
this.running = true;
this.showSpinner($('#run'));
$('#score_div').addClass('hidden');
this.toggleButtonStates();
var url = response.run_url.replace(this.FILENAME_URL_PLACEHOLDER, this.active_file.filename.replace(/#$/,'')); // remove # if it is the last character, this is not part of the filename and just an anchor
this.initializeSocketForRunning(url);
}.bind(this));
}
event.preventDefault();
if ($('#run').is(':visible')) {
this.createSubmission('#run', null, this.runSubmission.bind(this));
}
},
runSubmission: function (submission) {
//Run part starts here
$('#stop').data('url', submission.stop_url);
this.running = true;
this.showSpinner($('#run'));
$('#score_div').addClass('hidden');
this.toggleButtonStates();
var url = submission.run_url.replace(this.FILENAME_URL_PLACEHOLDER, this.active_file.filename.replace(/#$/,'')); // remove # if it is the last character, this is not part of the filename and just an anchor
this.initializeSocketForRunning(url);
},
saveCode: function(event) {

View File

@@ -62,7 +62,9 @@ a.file-heading {
fill: #ffd897;
}
.container > form > .actions {
margin-bottom: 200px;
}
.d3-tip {
line-height: 1;

View File

@@ -1,7 +1,98 @@
#commentitor {
margin-top: 2rem;
height: 600px;
background-color:#f9f9f9
.rfc {
h5 {
color: #008CBA;
}
.text {
font-size: larger;
}
.text.collapsed {
max-height: 50px;
overflow-y: hidden;
}
.collapse-button {
position: relative;
float: right;
margin-top: 5px;
margin-right: 5px;
cursor: pointer;
}
.description {
.text {
padding: 5px;
background-color: #FAFAFA;
border: 1px solid #CCCCCC;
}
}
.question {
.text {
font-weight: bold;
}
}
.testruns {
.text {
padding: 5px;
background-color: #FAFAFA;
border: 1px solid #CCCCCC;
}
pre {
background-color: inherit;
border: none;
}
}
}
.testrun-assess-results {
display: flex;
.result {
margin-right: 10px;
width: 10px;
height: 10px;
}
.passed {
border-radius: 50%;
background-color: #8efa00;
-webkit-box-shadow: 0 0 11px 1px rgba(44,222,0,1);
-moz-box-shadow: 0 0 11px 1px rgba(44,222,0,1);
box-shadow: 0 0 11px 1px rgba(44,222,0,1);
}
.unknown {
border-radius: 50%;
background-color: #ffca00;
-webkit-box-shadow: 0 0 11px 1px rgb(255, 202, 0);
-moz-box-shadow: 0 0 11px 1px rgb(255, 202, 0);
box-shadow: 0 0 11px 1px rgb(255, 202, 0);
}
.failed {
border-radius: 50%;
background-color: #ff2600;
-webkit-box-shadow: 0 0 11px 1px rgba(222,0,0,1);
-moz-box-shadow: 0 0 11px 1px rgba(222,0,0,1);
box-shadow: 0 0 11px 1px rgba(222,0,0,1);
}
}
#mark-as-solved-button {
margin-top: 20px;
}
#thank-you-container {
@@ -11,6 +102,10 @@
border: solid lightgrey 1px;
background-color: rgba(20, 180, 20, 0.2);
border-radius: 4px;
button {
margin-right: 10px;
}
}
#thank-you-note {
@@ -18,49 +113,142 @@
height: 200px;
}
#commentitor {
margin-bottom: 2rem;
height: 600px;
background-color:#f9f9f9
}
.ace_tooltip {
display: none !important;
}
p.comment {
width: 400px;
.modal-content {
min-height: 512px;
min-width: 360px;
max-height: 90vh;
display: flex;
flex-direction: column;
.modal-body {
flex-grow: 1;
display: flex;
flex-direction: column;
#otherComments {
flex-grow: 1;
display: flex;
flex-direction: column;
.container {
flex-grow: 1;
}
}
}
}
.popover-header {
.comment {
width: 100%;
overflow: hidden;
padding-bottom: 10px;
margin: auto;
min-width: 200px;
.comment-header {
width: 100%;
overflow: hidden;
padding-bottom: 10px;
margin: auto;
.comment-username {
font-weight: bold;
width: 60%;
float: left;
}
.comment-date {
text-align: right;
color: #008cba;
margin-left: 60%;
font-size: x-small;
}
.comment-updated {
text-align: right;
margin-left: 60%;
font-size: x-small;
}
}
.comment-content {
word-wrap: break-word;
margin-bottom: 10px;
}
.comment-editor {
display: none;
width: 100%;
height: auto;
background-color: inherit;
}
.comment-actions {
display: none;
}
}
.popover-username {
font-weight: bold;
width: 60%;
float: left;
}
.popover-date {
text-align: right;
color: #008cba;
margin-left: 60%;
font-size: x-small;
}
.popover-updated {
text-align: right;
margin-left: 60%;
font-size: x-small;
}
.popover-comment {
word-wrap: break-word;
margin-bottom: 10px;
}
.popover-divider {
.comment-divider {
width: 100%;
height: 1px;
background-color: #008cba;
overflow: hidden;
margin-top: 10px;
margin-bottom: 10px;
}
#otherComments {
h5 {
margin-top: 0;
}
.container {
width: 100%;
overflow-y: auto;
border: 1px solid #cccccc;
padding: 15px;
.comment-removed {
margin-top: 20px;
margin-bottom: 20px;
font-style: italic;
}
.comment-actions {
display: flex;
button {
margin-right: 5px;
}
}
}
}
input#subscribe {
margin-top: 5px;
margin-right: 5px;
}
#myComment {
margin-top: 20px;
margin-bottom: 10px;
textarea {
resize: none;
}
button {
margin-top: 10px;
}
}
.popover-footer {
color: #008cba;
margin-top: 10px;
}

View File

@@ -42,6 +42,14 @@ div.positive-result {
box-shadow: 0px 0px 11px 1px rgba(44,222,0,1);
}
div.unknown-result {
border-radius: 50%;
background-color: #ffca00;
-webkit-box-shadow: 0px 0px 11px 1px rgb(255, 202, 0);
-moz-box-shadow: 0px 0px 11px 1px rgb(255, 202, 0);
box-shadow: 0px 0px 11px 1px rgb(255, 202, 0);
}
div.negative-result {
border-radius: 50%;
background-color: #ff2600;