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

make submission summary fill up space #1624

Merged
merged 5 commits into from
Oct 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
30 changes: 27 additions & 3 deletions app/assets/stylesheets/style.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1347,10 +1347,34 @@ a.skip-main:active {
font-size: 1em;
z-index: 999;
}

// used in submission_history_table.html.erb
table.sub {
display: block;
overflow-x: scroll;
display: table;
}
.sub th{

.sub th {
vertical-align: top;
}

.submissions {
20wildmanj marked this conversation as resolved.
Show resolved Hide resolved
overflow-x: scroll;
}

.submission-history-button {
white-space: nowrap;
text-transform: unset !important;
font-size: 13px;
width: 100%;
border-radius: 5px;
color: #0882af;
box-shadow: 0px -0.5px 0.5px 0px rgba(0, 0, 0, 0.15),
0px 0.5px 0.5px 0.5px rgba(0, 0, 0, 0.15),
0px 0.5px 0.5px -0.5px rgba(0, 0, 0, 0.15);
display: flex;
justify-content: center;
}

.submission-history-button:hover {
color: white !important;
}
33 changes: 20 additions & 13 deletions app/views/assessments/_downloadSubmission.html.erb
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
<div class="history-download-pane" style="margin-right: 30px;">
<% if can_always_download or not (sub.assessment.exam or sub.assessment.course.exam_in_progress) then %>
<% if link = view_course_assessment_submission_path(@course, @assessment, sub) then %>
<%= button_to link, data: {toggle: "tooltip", placement: "top"}, title: "View Source",
aria: {label: "Justify"}, style: "margin-right:3px",
class: "btn btn-small white submission-history-button", :method => :get do
%>
<span><i class="material-icons">zoom_in</i></span>
 View Source
<% end %>
<% end %>
<div style="height: 4px">
<br>
</div>
<% mime_type = sub.detected_mime_type %>
<% if mime_type =~ /text\/.*/ then %>
<%= link_to download_course_assessment_submission_path(@course, @assessment, sub, forceMime: 'text/plain'),
data: {toggle: "tooltip", placement: "top"}, title: "Download as text/plain", style:"white-space: nowrap" do %>
<%= button_to download_course_assessment_submission_path(@course, @assessment, sub, forceMime: 'text/plain'),
data: {toggle: "tooltip", placement: "top"}, title: "Download as text/plain",
class: "btn btn-small white submission-history-button", :method => :get do
%>
<span style="margin-right:3px;"><i class="material-icons">file_download</i></span>
Download Submission
<% end %>
<% else %>
<%= link_to download_course_assessment_submission_path(@course, @assessment, sub),
data: {toggle: "tooltip", placement:"top"}, title: "Download Submission", style:"white-space: nowrap" do %>
<%= button_to download_course_assessment_submission_path(@course, @assessment, sub),
data: {toggle: "tooltip", placement:"top"}, title: "Download Submission",
style:"", class: "btn btn-small white submission-history-button", :method => :get do
%>
<span style="margin-right:3px;"><i class="material-icons">file_download</i></span>
Download Submission
<% end %>
<% end %>
<div style="height: 4px">
<br>
</div>
<% if link = view_course_assessment_submission_path(@course, @assessment, sub) then %>
<%= link_to link, data: {toggle: "tooltip", placement: "top"}, title: "View Source", aria: {label: "Justify"}, style: "margin-right:3px; white-space: nowrap" do %>
<span><i class="material-icons">zoom_in</i></span>
 View Source
<% end %>
<% end %>
<% else %>
<%= sub.filename %>
<% end %>
Expand Down
9 changes: 6 additions & 3 deletions app/views/assessments/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,11 @@
No Submissions yet!
<% else %>
<%= render partial: "submission_history_table", locals: {download_access: download_access, limit: 3} %>
<h6>
<%= link_to "See all #{@submissions.size}" + " submission".pluralize(@submissions.size), {:action => "history"} %></li>
</h6>
<% if @submissions.size > 3 then %>
<!-- display link to history only if we exceed summary limit (since they are the same component) -->
<h6>
<%= link_to "See all #{@submissions.size}" + " submission".pluralize(@submissions.size), {:action => "history"} %>
</h6>
<% end %>
<% end %>
</div>