Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint views/submissions #1969

Merged
merged 3 commits into from
Sep 22, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
address issues in code_viewer
  • Loading branch information
20wildmanj committed Sep 18, 2023
commit 9f641666ea8649b5d760a5bdd05b660ec4289442
46 changes: 26 additions & 20 deletions app/views/submissions/_code_viewer.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,25 @@
</div>
<% end %>
<% if @is_pdf %>
<div class="file-button">
<%= link_to download_course_assessment_submission_path(@course, @assessment, @submission, header_position: @header_position, annotated: true),
data: { toggle: "tooltip", placement: "top" },
title: "Download Annotated Submission" do %>
Download Annotated
<% end %>
</div>
<div class="file-button">
<%= link_to download_course_assessment_submission_path(@course, @assessment, @submission, header_position: @header_position, annotated: true),
data: { toggle: "tooltip", placement: "top" },
title: "Download Annotated Submission" do %>
Download Annotated
<% end %>
</div>
<% else %>
<div class="file-button">
<a href="#" onclick="copyFileToClipboard()">Copy Code</a>
</div>
<div class="file-button">
<a href="#" onclick="copyFileToClipboard()">Copy Code</a>
</div>
<% end %>
</div>

<% success = true %>
<% if @is_pdf %>
<div class="code-table">
<div id="pdf-doc" style="text-align: center;"></div>
</div>
<div class="code-table">
<div id="pdf-doc" style="text-align: center;"></div>
</div>
<% else %>
<div class="code-table">
<% @data.each_with_index do |(code, annotation), index| %>
Expand Down Expand Up @@ -73,17 +73,23 @@
</div>
<% end %>
<% if success == false %>
<div id="code_error"> Sorry, we could not parse your file because it contains non-UTF8 characters. Please <%= link_to download_course_assessment_submission_path(@course, @assessment, @submission, header_position: @header_position),
data: { toggle: "tooltip", placement: "top" },
title: "Download Submission" do %>
<div id="code_error">
<p>
Sorry, we could not parse your file because it contains non-UTF8 characters. Please
<%= link_to download_course_assessment_submission_path(@course, @assessment, @submission, header_position: @header_position),
data: { toggle: "tooltip", placement: "top" },
title: "Download Submission" do %>
download the file
<% end %> to view the source. </div>
<% end %>
to view the source.
</p>
</div>
<script> $('.code-table').hide() </script>
<% end %>
</div>

<% if @is_pdf %>
<script>
$(document).ready(function () { renderPdf(); });
</script>
<script>
$(document).ready(function () { renderPdf(); });
</script>
<% end %>