Skip to content

Commit

Permalink
Merge pull request #2269 from Alex-Jordan/footer
Browse files Browse the repository at this point in the history
reposition footer
  • Loading branch information
pstaabp authored Jan 24, 2024
2 parents 02ac4c8 + 896ab2c commit b2b054f
Show file tree
Hide file tree
Showing 11 changed files with 140 additions and 108 deletions.
5 changes: 0 additions & 5 deletions htdocs/themes/math4/math4.scss
Original file line number Diff line number Diff line change
Expand Up @@ -710,11 +710,6 @@ ul.courses-list {
padding: 1em;
margin-top: 1em;

div {
margin-left: auto;
margin-right: auto;
}

a {
color: #555;
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/themes/math4/system.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
% }
%
% # Footer
<div id="footer" role="contentinfo"><%= include 'ContentGenerator/Base/footer' %></div>
<%= include 'ContentGenerator/Base/footer' =%>
</div>
</div>
%
Expand Down
2 changes: 2 additions & 0 deletions lib/WeBWorK/ContentGenerator.pm
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ async sub go ($c) {

my $tx = $c->render_later->tx;

$c->stash->{footerWidthClass} = $c->can('info') ? 'col-md-8' : 'col-12';

if ($c->can('pre_header_initialize')) {
my $pre_header_initialize = $c->pre_header_initialize;
await $pre_header_initialize
Expand Down
24 changes: 14 additions & 10 deletions templates/ContentGenerator/Base/footer.html.ep
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
<div id="last-modified"><%= maketext('Page generated [_1]', $c->timestamp) %></div>
<div id="copyright">
<%== maketext(
'WeBWorK &copy; [_1] | theme: [_2] | ww_version: [_3] | pg_version [_4]',
$ce->{WW_COPYRIGHT_YEARS} || '1996-2023',
$ce->{defaultTheme} || 'unknown -- set defaultTheme in localOverides.conf',
$ce->{WW_VERSION} || 'unknown -- set WW_VERSION in VERSION',
$ce->{PG_VERSION} || 'unknown -- set PG_VERSION in ../pg/VERSION'
) %>
<div id="footer" role="contentinfo" class="row">
<div class="<%= $footerWidthClass %>">
<div id="last-modified"><%= maketext('Page generated [_1]', $c->timestamp) %></div>
<div id="copyright">
<%== maketext(
'WeBWorK &copy; [_1] | theme: [_2] | ww_version: [_3] | pg_version [_4]',
$ce->{WW_COPYRIGHT_YEARS} || '1996-2023',
$ce->{defaultTheme} || 'unknown -- set defaultTheme in localOverides.conf',
$ce->{WW_VERSION} || 'unknown -- set WW_VERSION in VERSION',
$ce->{PG_VERSION} || 'unknown -- set PG_VERSION in ../pg/VERSION'
) %>
</div>
<a href="https://openwebwork.org/"><%= maketext('The WeBWorK Project') %></a>
</div>
</div>
<a href="https://openwebwork.org/"><%= maketext('The WeBWorK Project') %></a>
60 changes: 34 additions & 26 deletions templates/ContentGenerator/Instructor/Assigner.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
<%= maketext('Select one or more sets and one or more users below to assign/unassign '
. 'each selected set to/from all selected users.') =%>
</p>
%
% $c->stash->{footerWidthClass} = 'col-xl-10 col-md-12';
%
<%= form_for current_route, method => 'post', begin =%>
<%= $c->hidden_authen_fields =%>
%
Expand Down Expand Up @@ -50,32 +53,37 @@
) =%>
</div>
</div>
<div>
<%= submit_button maketext('Assign selected sets to selected users'),
name => 'assign', class => 'btn btn-primary mb-2' =%>
<div class="alert alert-danger p-1 mb-2">
<div class="mb-1"><%= maketext('Do not unassign students unless you know what you are doing.') =%></div>
<div><%= maketext('There is NO undo for unassigning students.') =%></div>
</div>
<div class="d-flex align-items-center">
<%= submit_button maketext('Unassign selected sets from selected users'),
name => 'unassign', class => 'btn btn-primary me-2' =%>
<label class="form-check-label">
<%= maketext('Read only') =%>
<%= radio_button unassignFromAllSafety => 0, checked => undef, class => 'form-check-input mx-1' =%>
</label>
<label class="form-check-label">
<%= maketext('Allow unassign') =%>
<%= radio_button unassignFromAllSafety => 1, class => 'form-check-input mx-1' =%>
</label>
</div>
<div class="mt-2">
<%= maketext(
'When you unassign a set from students, you destroy all of the data for the set for those '
. 'students. If the set is re-assigned to these students, then they will receive new versions '
. 'of problems in the set. Make sure this is what you want to do before unassigning sets '
. 'from students.'
) =%>
<div class="row">
<div class="col-xl-10 col-md-12">
<%= submit_button maketext('Assign selected sets to selected users'),
name => 'assign', class => 'btn btn-primary mb-2' =%>
<div class="alert alert-danger p-1 mb-2">
<div class="mb-1">
<%= maketext('Do not unassign students unless you know what you are doing.') =%>
</div>
<div><%= maketext('There is NO undo for unassigning students.') =%></div>
</div>
<div class="d-flex align-items-center">
<%= submit_button maketext('Unassign selected sets from selected users'),
name => 'unassign', class => 'btn btn-primary me-2' =%>
<label class="form-check-label">
<%= maketext('Read only') =%>
<%= radio_button unassignFromAllSafety => 0, checked => undef,
class => 'form-check-input mx-1' =%>
</label>
<label class="form-check-label">
<%= maketext('Allow unassign') =%>
<%= radio_button unassignFromAllSafety => 1, class => 'form-check-input mx-1' =%>
</label>
</div>
<div class="mt-2">
<%= maketext(
'When you unassign a set from students, you destroy all of the data for the set for those '
. 'students. If the set is re-assigned to these students, then they will receive new '
. 'versions of problems in the set. Make sure this is what you want to do before '
. 'unassigning sets from students.'
) =%>
</div>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
% $files = [];
% }
%
% $c->stash->{footerWidthClass} = 'col-md-8';
%
% # Directory menu and date/size checkbox
<div class="row">
<div class="col-md-8 mb-2">
Expand Down
2 changes: 2 additions & 0 deletions templates/ContentGenerator/Instructor/Index.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
<%= maketext('Select user(s) and/or set(s), and click the action button of your choice below.') =%>
</p>
%
% stash->{footerWidthClass} = 'col-xl-10 col-md-12';
%
<%= form_for current_route, method => 'POST', id => 'instructor-tools-form', begin =%>
<%= $c->hidden_authen_fields =%>
%
Expand Down
145 changes: 79 additions & 66 deletions templates/ContentGenerator/Instructor/Scoring.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -13,83 +13,96 @@
% }
%
% my $scoringDir = $ce->{courseDirs}{scoring};
% $c->stash->{footerWidthClass} = 'col-md-12 col-lg-10 col-xl-8';
%
<div class="border border-dark p-2" style="max-width:700px">
<%= form_for current_route, name => 'scoring-form', id => 'scoring-form', method => 'POST', begin =%>
<%= $c->hidden_authen_fields =%>
<%= hidden_field returning => 1 =%>
<div class="row">
<div class="col-sm-5 mb-2">
<%= label_for selectedSet => maketext('Selected sets:'), class => 'form-label' =%>
<%= select_field selectedSet =>
[ map { [ format_set_name_display($_) => $_ ] } @{ $c->{ra_set_ids} } ],
id => 'selectedSet', class => 'form-select', size => 10, multiple => undef, dir => 'ltr' =%>
</div>
<div class="col-sm-7 my-sm-auto mb-2">
<div class="form-check">
<label class="form-check-label">
<%= check_box includeIndex => 1, class => 'form-check-input' =%>
<%= maketext('Include Success Index') =%>
</label>
<div class="row">
<div class="col-md-12 col-lg-10 col-xl-8">
<div class="border border-dark p-2">
<%= form_for current_route, name => 'scoring-form', id => 'scoring-form', method => 'POST', begin =%>
<%= $c->hidden_authen_fields =%>
<%= hidden_field returning => 1 =%>
<div class="row">
<div class="col-sm-6 mb-2">
<%= label_for selectedSet => maketext('Selected sets:'), class => 'form-label' =%>
<%= select_field selectedSet =>
[ map { [ format_set_name_display($_) => $_ ] } @{ $c->{ra_set_ids} } ],
id => 'selectedSet', class => 'form-select', size => 10, multiple => undef, dir => 'ltr' =%>
</div>
<div class="col-sm-6 mt-sm-5">
<div class="form-check">
<label class="form-check-label">
% param('padFields', 1) unless param('returning');
<%= check_box padFields => 1, class => 'form-check-input' =%>
<%= maketext('Pad fields') =%>
</label>
</div>
<div class="form-check">
<label class="form-check-label">
% param('includePercentEachSet', 1) unless param('returning');
<%= check_box includePercentEachSet => 1, class => 'form-check-input' =%>
<%= maketext('Include percentage columns') =%>
</label>
</div>
<div class="form-check">
<label class="form-check-label">
<%= check_box includeIndex => 1, class => 'form-check-input' =%>
<%= maketext('Include success index columns') =%>
</label>
</div>
<div class="form-check">
<label class="form-check-label">
<%= check_box recordSingleSetScores => 1, class => 'form-check-input' =%>
<%= maketext('Record scores for each set') =%>
</label>
</div>
</div>
</div>
<div class="form-check">
<label class="form-check-label">
<%= check_box recordSingleSetScores => 1, class => 'form-check-input' =%>
<%= maketext('Record Scores for Single Sets') =%>
</label>
<div class="d-flex flex-sm-nowrap flex-wrap">
<%= submit_button maketext('Score selected set(s) and save to:'), name => 'score-sets',
id => 'score-sets', class => 'btn btn-primary btn-sm me-2 mb-sm-0 mb-2' =%>
<%= text_field scoringFileName => $c->{scoringFileName}, class => 'form-control form-control-sm',
size => '40', 'aria-labelledby' => 'score-sets' =%>
</div>
<div class="form-check">
<label class="form-check-label">
% param('padFields', 1) unless param('returning');
<%= check_box padFields => 1, class => 'form-check-input' =%>
<%= maketext('Pad Fields') =%>
</label>
</div>
<div class="form-check">
<label class="form-check-label">
% param('includePercentEachSet', 1) unless param('returning');
<%= check_box includePercentEachSet => 1, class => 'form-check-input' =%>
<%= maketext('Include percentage grades columns for all sets') =%>
</label>
</div>
</div>
</div>
<div class="d-flex flex-sm-nowrap flex-wrap">
<%= submit_button maketext('Score selected set(s) and save to:'), name => 'score-sets',
id => 'score-sets', class => 'btn btn-primary btn-sm me-2 mb-sm-0 mb-2' =%>
<%= text_field scoringFileName => $c->{scoringFileName}, class => 'form-control form-control-sm',
size => '40', 'aria-labelledby' => 'score-sets' =%>
<% end =%>
</div>
<% end =%>
</div>
</div>
%
% my @selected = param('selectedSet');
% if (@selected) {
<p><%= maketext('All of these files will also be made available for mail merge.') %></p>
% }
%
% for my $setID (@selected) {
% my @validFiles;
% for my $type ('scr', 'ful') {
% my $filename = "s$setID$type.csv";
% my $path = "$scoringDir/$filename";
% push @validFiles, $filename if -f $path;
% }
% if (@validFiles) {
<h2 dir="ltr"><%= format_set_name_display($setID) %></h2>
% for my $filename (@validFiles) {
<div class="mb-3">
<%= link_to $filename =>
$c->systemLink(url_for('instructor_scoring_download'), params => { getFile => $filename }) =%>
</div>
<p class="mt-2"><%= maketext('All of these files will also be made available for mail merge.') %></p>
<dl>
% for my $setID (@selected) {
% my @validFiles;
% for my $type ('scr', 'ful') {
% my $filename = "s$setID$type.csv";
% my $path = "$scoringDir/$filename";
% push @validFiles, $filename if -f $path;
% }
<hr>
% if (@validFiles) {
<dt dir="ltr"><%= format_set_name_display($setID) %></dt>
<dd>
<ul>
% for my $filename (@validFiles) {
<li>
<%= link_to $filename =>
$c->systemLink(url_for('instructor_scoring_download'), params => { getFile => $filename }) =%>
</li>
% }
</ul>
</dd>
% }
</dl>
% }
% }
%
% if (-f "$scoringDir/$c->{scoringFileName}") {
<h2><%= maketext('Totals') %></h2>
<h2 class="my-2"><%= maketext('Scores') %></h2>
<%= maketext("Download: ") %>
<%= link_to $c->{scoringFileName} =>
$c->systemLink(url_for('instructor_scoring_download'), params => { getFile => $c->{scoringFileName} }) =%>
<hr>
<pre style="font-size:smaller"><%== WeBWorK::Utils::readFile("$scoringDir/$c->{scoringFileName}") =%></pre>
$c->systemLink(url_for('instructor_scoring_download'), params => { getFile => $c->{scoringFileName} }),
class => 'font-monospace' =%>
<pre class="mt-2 bg-light border" style="font-size:smaller; width:fit-content; max-width:100%;">
<%== WeBWorK::Utils::readFile("$scoringDir/$c->{scoringFileName}") =%>\
</pre>
% }
2 changes: 2 additions & 0 deletions templates/ContentGenerator/Instructor/Stats/index.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
%
% my $type = current_route =~ s/instructor_//r;
%
% stash->{footerWidthClass} = 'col-lg-10 col-sm-12';
%
<div class="row">
<div class="col-lg-5 col-sm-6 mb-2">
<div class="card h-100">
Expand Down
2 changes: 2 additions & 0 deletions templates/ContentGenerator/Options.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
% my $userID = $c->{user}->user_id;
% my $eUserName = $c->{effectiveUser}->first_name . ' ' . $c->{effectiveUser}->last_name;
%
% $c->stash->{footerWidthClass} = 'col-lg-8 col-md-10';
%
%= form_for current_route, method => 'POST', begin
<%= $c->hidden_authen_fields =%>
%
Expand Down
2 changes: 2 additions & 0 deletions templates/ContentGenerator/Problem.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
% last;
% }
%
% stash->{footerWidthClass} = 'col-lg-10';
%
<%== $c->post_header_text =%>
<div id="custom_edit_message" class="row"><div class="col-lg-10"><%= $c->output_custom_edit_message %></div></div>
<div class="row"><div id="output_summary" class="col-lg-10"><%= $c->output_summary %></div></div>
Expand Down

0 comments on commit b2b054f

Please sign in to comment.