From 4164a7cf06e0a776537a7f6a7b1359f2b0fab3f7 Mon Sep 17 00:00:00 2001 From: Alex Jordan Date: Thu, 29 Feb 2024 21:32:49 -0800 Subject: [PATCH] rearrange tables in user sets page --- .../Instructor/UserDetail.html.ep | 12 +++---- .../UserDetail/set_date_table.html.ep | 34 ++++++++++--------- .../Instructor/UserDetail/set_row.html.ep | 31 +++++++++++------ 3 files changed, 43 insertions(+), 34 deletions(-) diff --git a/templates/ContentGenerator/Instructor/UserDetail.html.ep b/templates/ContentGenerator/Instructor/UserDetail.html.ep index c0305ca478..1ef3720df6 100644 --- a/templates/ContentGenerator/Instructor/UserDetail.html.ep +++ b/templates/ContentGenerator/Instructor/UserDetail.html.ep @@ -83,16 +83,12 @@ %
- - - - +
- <%= maketext("Sets assigned to [_1] ([_2])", $userName, $userID) =%> -
+ + - - + % for my $set (@{ $c->{setRecords} }) { % my $setID = $set->set_id; diff --git a/templates/ContentGenerator/Instructor/UserDetail/set_date_table.html.ep b/templates/ContentGenerator/Instructor/UserDetail/set_date_table.html.ep index 8a701af054..6386618f0b 100644 --- a/templates/ContentGenerator/Instructor/UserDetail/set_date_table.html.ep +++ b/templates/ContentGenerator/Instructor/UserDetail/set_date_table.html.ep @@ -5,16 +5,16 @@ % my $isVersioned = $isGateway && defined $mergedRecord && $mergedRecord->can('version_id'); % $setID .= ',v' . $mergedRecord->version_id if $isVersioned; % -
<%= maketext("Sets assigned to [_1] ([_2])", $userName, $userID) =%>
<%= maketext('Assignment') %> <%= maketext('Assigned') %><%= maketext("Edit set for [_1]", $userID) %><%= maketext('Dates') %><%= maketext('Dates') %>
+
> - % if (defined $userRecord) { + % unless ($isVersioned) { % } - % unless ($isVersioned) { - % } @@ -32,13 +32,24 @@ maketext($fieldLabels->{$field}), class => 'form-label mb-0' =%> + % unless ($isVersioned) { + + % } % if (defined $userRecord) { % } - % unless ($isVersioned) { - - % } % }
- <%= $isVersioned ? maketext(q{User's Test Version Dates}) : maketext('User Overrides') =%> + <%= maketext('Assignment Dates') =%> > - <%= $isGateway ? maketext('Test Dates') : maketext('Assignment Dates') =%> + % if (defined $userRecord) { + > + <%= $isVersioned ? maketext(q{User's Test Version Dates}) : maketext('User Overrides') =%>
+ <%= 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") : () =%> +
<%= 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') @@ -60,15 +71,6 @@
- <%= 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") : () =%> -
diff --git a/templates/ContentGenerator/Instructor/UserDetail/set_row.html.ep b/templates/ContentGenerator/Instructor/UserDetail/set_row.html.ep index df4d683b12..33d26d9397 100644 --- a/templates/ContentGenerator/Instructor/UserDetail/set_row.html.ep +++ b/templates/ContentGenerator/Instructor/UserDetail/set_row.html.ep @@ -2,29 +2,40 @@ % % # my ($set, $userSet, $mergedSet, $version) = @_; % my $setID = $set->set_id; +% my $isGateway = $set->assignment_type =~ /gateway/; % my $version = stash 'version'; - - - - + % if (defined $mergedSet) { - + + % if ($isGateway) { + + <%= maketext('Test/Quiz') %> + % } <%= 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 } ) =%> - + % if ($version) { <%= hidden_field "set.$setID,v$version.assignment" => 'delete' =%> % } % } else { - <%= format_set_name_display($setID) %> + + % if ($isGateway) { + + <%= maketext('Test/Quiz') %> + % } + <%= format_set_name_display($setID) %> + % } + + + <%= include 'ContentGenerator/Instructor/UserDetail/set_date_table',