Show requests for comments and begin work on a view for executing them
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#editor.row data-exercise-id=exercise.id data-message-timeout=t('exercises.editor.timeout', permitted_execution_time: @exercise.execution_environment.permitted_execution_time) data-errors-url=execution_environment_errors_path(exercise.execution_environment) data-submissions-url=submissions_path
|
||||
#editor.row data-exercise-id=exercise.id data-message-timeout=t('exercises.editor.timeout', permitted_execution_time: @exercise.execution_environment.permitted_execution_time) data-errors-url=execution_environment_errors_path(exercise.execution_environment) data-submissions-url=submissions_path data-user-id=@current_user.id
|
||||
.col-sm-3 = render('editor_file_tree', files: @files)
|
||||
#frames.col-sm-9
|
||||
- @files.each do |file|
|
||||
|
@@ -5,5 +5,6 @@ hr
|
||||
= render('editor_button', classes: 'btn-block btn-primary btn-sm', data: {:'data-cause' => 'file'}, icon: 'fa fa-plus', id: 'create-file', label: t('exercises.editor.create_file'))
|
||||
= render('editor_button', classes: 'btn-block btn-warning btn-sm', data: {:'data-cause' => 'file', :'data-message-confirm' => t('shared.confirm_destroy')}, icon: 'fa fa-times', id: 'destroy-file', label: t('exercises.editor.destroy_file'))
|
||||
= render('editor_button', classes: 'btn-block btn-primary btn-sm', icon: 'fa fa-download', id: 'download', label: t('exercises.editor.download'))
|
||||
= render('editor_button', classes: 'btn-block btn-primary btn-sm', icon: 'fa fa-bullhorn', id: 'request-for-comments', label: 'Request comments')
|
||||
|
||||
= render('shared/modal', id: 'modal-file', template: 'code_ocean/files/_form', title: t('exercises.editor.create_file'))
|
||||
|
@@ -40,4 +40,4 @@ h1 = Exercise.model_name.human(count: 2)
|
||||
td = link_to(t('shared.statistics'), statistics_exercise_path(exercise))
|
||||
|
||||
= render('shared/pagination', collection: @exercises)
|
||||
p = render('shared/new_button', model: Exercise)
|
||||
p = render('shared/new_button', model: Exercise)
|
33
app/views/request_for_comments/_form.html.erb
Normal file
33
app/views/request_for_comments/_form.html.erb
Normal file
@@ -0,0 +1,33 @@
|
||||
<%= form_for(@request_for_comment) do |f| %>
|
||||
<% if @request_for_comment.errors.any? %>
|
||||
<div id="error_explanation">
|
||||
<h2><%= pluralize(@request_for_comment.errors.count, "error") %> prohibited this request_for_comment from being saved:</h2>
|
||||
|
||||
<ul>
|
||||
<% @request_for_comment.errors.full_messages.each do |message| %>
|
||||
<li><%= message %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :requestorid %><br>
|
||||
<%= f.number_field :requestorid %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= f.label :exerciseid %><br>
|
||||
<%= f.number_field :exerciseid %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= f.label :fileid %><br>
|
||||
<%= f.number_field :fileid %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= f.label :requested_at %><br>
|
||||
<%= f.datetime_select :requested_at %>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<%= f.submit %>
|
||||
</div>
|
||||
<% end %>
|
12
app/views/request_for_comments/index.html.erb
Normal file
12
app/views/request_for_comments/index.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<h1>Listing comment requests</h1>
|
||||
|
||||
<div class="list-group">
|
||||
<% @request_for_comments.each do |request_for_comment| %>
|
||||
<a href="<%= request_for_comment_path(request_for_comment) %>" class="list-group-item">
|
||||
<h4 class="list-group-item-heading"><%= Exercise.find(request_for_comment.exerciseid) %></h4>
|
||||
<p class="list-group-item-text">
|
||||
<%= InternalUser.find(request_for_comment.requestorid) %> | <%= request_for_comment.requested_at %>
|
||||
</p>
|
||||
</a>
|
||||
<% end %>
|
||||
</div>
|
4
app/views/request_for_comments/index.json.jbuilder
Normal file
4
app/views/request_for_comments/index.json.jbuilder
Normal file
@@ -0,0 +1,4 @@
|
||||
json.array!(@request_for_comments) do |request_for_comment|
|
||||
json.extract! request_for_comment, :id, :requestorid, :exerciseid, :fileid, :requested_at
|
||||
json.url request_for_comment_url(request_for_comment, format: :json)
|
||||
end
|
9
app/views/request_for_comments/show.html.erb
Normal file
9
app/views/request_for_comments/show.html.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
<div class="list-group">
|
||||
<h4 class="list-group-item-heading"><%= Exercise.find(@request_for_comment.exerciseid) %></h4>
|
||||
<p class="list-group-item-text">
|
||||
<%= InternalUser.find(@request_for_comment.requestorid) %> | <%= @request_for_comment.requested_at %>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div id='editor' class='editor' data-read-only='true' data-file-id='<%=@request_for_comment.fileid%>'>
|
||||
</div>
|
1
app/views/request_for_comments/show.json.jbuilder
Normal file
1
app/views/request_for_comments/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.extract! @request_for_comment, :id, :requestorid, :exerciseid, :fileid, :requested_at, :created_at, :updated_at
|
Reference in New Issue
Block a user