rfc can now be solved.

show.html still needs to be finished
This commit is contained in:
Ralf Teusner
2016-06-24 16:44:34 +02:00
parent bd6d4c4d71
commit 2a52b66daa
8 changed files with 58 additions and 8 deletions

View File

@@ -21,6 +21,11 @@
<%= t('request_for_comments.no_question') %>
<% end %>
</h5>
<% if (policy(@request_for_comment).mark_as_solved? and not @request_for_comment.solved?) %>
<button class="btn btn-default" id="mark-as-solved-button">Bla</button>
<% else %>
<% end %>
</div>
<!--
@@ -37,6 +42,22 @@ also, all settings from the rails model needed for the editor configuration in t
<script type="text/javascript">
var solvedButton = $('#mark-as-solved-button');
solvedButton.on('click', function(event){
var jqrequest = $.ajax({
dataType: 'json',
method: 'GET',
url: location + '/mark_as_solved'
});
jqrequest.done(function(response){
if(response.solved){
solvedButton.hide();
}
});
});
// set file paths for ace
var ACE_FILES_PATH = '/assets/ace/';
_.each(['modePath', 'themePath', 'workerPath'], function(attribute) {

View File

@@ -1 +1 @@
json.extract! @request_for_comment, :id, :user_id, :exercise_id, :file_id, :requested_at, :created_at, :updated_at, :user_type
json.extract! @request_for_comment, :id, :user_id, :exercise_id, :file_id, :requested_at, :created_at, :updated_at, :user_type, :solved