Skip to content

Commit

Permalink
rearrange tables in user sets page
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Jordan authored and drgrice1 committed Mar 2, 2024
1 parent aba6fff commit 4164a7c
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 34 deletions.
12 changes: 4 additions & 8 deletions templates/ContentGenerator/Instructor/UserDetail.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,12 @@
</div>
%
<div class="table-responsive">
<table class="table table-bordered table-sm font-sm align-middle">
<tr>
<th class="text-center" colspan="3">
<%= maketext("Sets assigned to [_1] ([_2])", $userName, $userID) =%>
</th>
</tr>
<table class="table table-bordered table-sm font-sm align-middle w-auto caption-top">
<caption><%= maketext("Sets assigned to [_1] ([_2])", $userName, $userID) =%></caption>
<tr>
<th class="text-center"><%= maketext('Assignment') %></th>
<th class="text-center"><%= maketext('Assigned') %></th>
<th><%= maketext("Edit set for [_1]", $userID) %></th>
<th><%= maketext('Dates') %></th>
<th class="text-center"><%= maketext('Dates') %></th>
</tr>
% for my $set (@{ $c->{setRecords} }) {
% my $setID = $set->set_id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
% my $isVersioned = $isGateway && defined $mergedRecord && $mergedRecord->can('version_id');
% $setID .= ',v' . $mergedRecord->version_id if $isVersioned;
%
<table>
<table <%== $isVersioned ? ' class="ms-auto"' : '' %>>
<tr>
% if (defined $userRecord) {
% unless ($isVersioned) {
<th scope="col" colspan="2">
<%= $isVersioned ? maketext(q{User's Test Version Dates}) : maketext('User Overrides') =%>
<%= maketext('Assignment Dates') =%>
</th>
% }
% unless ($isVersioned) {
<th scope="col" <%== defined $userRecord ? '' : 'colspan="2"' %>>
<%= $isGateway ? maketext('Test Dates') : maketext('Assignment Dates') =%>
% if (defined $userRecord) {
<th scope="col" <%== (defined $userRecord && !$isVersioned) ? '' : 'colspan="2"' %>>
<%= $isVersioned ? maketext(q{User's Test Version Dates}) : maketext('User Overrides') =%>
</th>
% }
</tr>
Expand All @@ -32,13 +32,24 @@
maketext($fieldLabels->{$field}),
class => 'form-label mb-0' =%>
</td>
% unless ($isVersioned) {
<td class="px-1 text-nowrap">
<%= text_field "set.$setID.$field.class_value" =>
$c->formatDateTime($globalValue, 'datetime_format_short'),
id => "set.$setID.$field.class_value", readonly => undef, dir => 'ltr',
class => 'form-control-plaintext form-control-sm w-auto',
size => 16,
defined $userRecord ? ('aria-labelledby' => "set.$setID.${field}_id") : () =%>
</td>
% }
% if (defined $userRecord) {
<td class="px-1 text-nowrap">
<div class="input-group input-group-sm flex-nowrap flatpickr">
<%= text_field "set.$setID.$field" =>
defined $userRecord ? $userRecord->$field : $globalValue,
id => "set.$setID.${field}_id",
class => 'form-control w-auto' . ($field eq 'open_date' ? ' datepicker-group' : ''),
class => 'form-control w-auto'
. ($field eq 'open_date' ? ' datepicker-group' : ''),
placeholder => $isGateway
? ($isVersioned && $field ne 'reduced_scoring_date'
? maketext('Required')
Expand All @@ -60,15 +71,6 @@
</div>
</td>
% }
% unless ($isVersioned) {
<td class="px-1 text-nowrap">
<%= text_field "set.$setID.$field.class_value" =>
$c->formatDateTime($globalValue, 'datetime_format_short'),
id => "set.$setID.$field.class_value", readonly => undef, dir => 'ltr',
class => 'form-control form-control-sm w-auto',
defined $userRecord ? ('aria-labelledby' => "set.$setID.${field}_id") : () =%>
</td>
% }
</tr>
% }
</table>
31 changes: 21 additions & 10 deletions templates/ContentGenerator/Instructor/UserDetail/set_row.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,40 @@
%
% # my ($set, $userSet, $mergedSet, $version) = @_;
% my $setID = $set->set_id;
% my $isGateway = $set->assignment_type =~ /gateway/;
% my $version = stash 'version';
<tr>
<td class="text-center">
<label class="form-check-label">
<%= check_box $version ? "set.$setID,v$version.assignment" : "set.$setID.assignment" => 'assigned',
class => 'form-check-input', defined $mergedSet ? (checked => undef) : () =%>
</label>
</td>
<td class="text-center">
<th class="text-center" scope="row">
% if (defined $mergedSet) {
<b dir="ltr">
<span dir="ltr">
% if ($isGateway) {
<i class="icon fa-solid fa-list-check" title="<%= maketext('Test/Quiz') %>"></i>
<span class="visually-hidden"><%= maketext('Test/Quiz') %></span>
% }
<%= link_to format_set_name_display($version ? "$setID (version $version)" : $setID) =>
$c->systemLink(
url_for('instructor_set_detail', setID => $setID . ($version ? ",v$version" : '')),
params => { editForUser => $userID }
) =%>
</b>
</span>
% if ($version) {
<%= hidden_field "set.$setID,v$version.assignment" => 'delete' =%>
% }
% } else {
<b dir="ltr"><%= format_set_name_display($setID) %></b>
<span dir="ltr">
% if ($isGateway) {
<i class="icon fa-solid fa-list-check" title="<%= maketext('Test/Quiz') %>"></i>
<span class="visually-hidden"><%= maketext('Test/Quiz') %></span>
% }
<%= format_set_name_display($setID) %>
</span>
% }
</th>
<td class="text-center">
<label class="form-check-label">
<%= check_box $version ? "set.$setID,v$version.assignment" : "set.$setID.assignment" => 'assigned',
class => 'form-check-input', defined $mergedSet ? (checked => undef) : () =%>
</label>
</td>
<td class="text-center">
<%= include 'ContentGenerator/Instructor/UserDetail/set_date_table',
Expand Down

0 comments on commit 4164a7c

Please sign in to comment.