|
1 | 1 | % use WeBWorK::Utils::CourseManagement qw(listCourses); |
2 | 2 | % |
| 3 | +% content_for js => begin |
| 4 | + <%= javascript getAssetURL($ce, 'js/CourseAdmin/restrict_select.js'), defer => undef =%> |
| 5 | +% end |
| 6 | +% |
3 | 7 | % # Create an array of permission values for the permission selects. |
4 | 8 | % my $permissionLevels = []; |
5 | 9 | % for my $role (sort { $ce->{userRoles}{$a} <=> $ce->{userRoles}{$b} } keys %{ $ce->{userRoles} }) { |
|
217 | 221 | <%= maketext('course institution (will override "Institution" input above)') =%> |
218 | 222 | </label> |
219 | 223 | </div> |
220 | | - <div class="form-check mt-3 mb-2"> |
221 | | - <label class="form-check-label"> |
222 | | - <%= check_box copy_config_file => 1, class => 'form-check-input' =%> |
223 | | - <%= maketext('course configuration file') =%> |
224 | | - <a class="help-popup" role="button" tabindex="0" data-bs-placement="top" data-bs-toggle="popover" |
225 | | - data-bs-content="<%= maketext('Copying the course configuration file may copy configuration ' |
226 | | - . 'settings that are specific to the original course instructor. If this is a new course ' |
227 | | - . 'for a new instructor, use the fields above to add the new instructor and do not copy ' |
228 | | - . 'the course configuration file. Then if there is something in the course configuration ' |
229 | | - . 'file that should be carried into the new course, the administrator can copy that manually. ' |
230 | | - . 'Alternatively, do copy the course configuration file, but then the administrator should ' |
231 | | - . 'inspect the new course configuration file and make adjustments for the new instructor.') =%>" |
232 | | - > |
233 | | - <i class="icon fas fa-question-circle" aria-hidden="true"></i> |
234 | | - <span class="visually-hidden"> |
235 | | - <%= maketext('Notes regarding copying the course configuration file') =%> |
236 | | - </span> |
237 | | - </a> |
238 | | - </label> |
239 | | - </div> |
| 224 | + % my @addOnConfFiles; |
| 225 | + % if (-d $ce->{webworkDirs}{addOnConf}) { |
| 226 | + % @addOnConfFiles = glob "$ce->{webworkDirs}{addOnConf}/*.conf"; |
| 227 | + % for (0 .. $#addOnConfFiles){ |
| 228 | + % $addOnConfFiles[$_] =~ s/^.*\/|\.conf$//g; |
| 229 | + % } |
| 230 | + % } |
| 231 | + % if (@addOnConfFiles) { |
| 232 | + <div class="row my-2"> |
| 233 | + <%= label_for add_on_conf => maketext('Configuration File:'), |
| 234 | + class => 'col-auto col-form-label fw-bold' =%> |
| 235 | + <div class="col-auto"> |
| 236 | + <%= select_field add_on_conf => [ |
| 237 | + c( |
| 238 | + maketext('Default') |
| 239 | + => [ [ maketext('Use distribution default config file') => '', selected => undef ] ], |
| 240 | + 'data-single' => 'true', |
| 241 | + ), |
| 242 | + c( |
| 243 | + maketext('Source Course') |
| 244 | + => [ [ maketext("Use source course's config file") => '*' ] ], |
| 245 | + 'data-single' => 'true' |
| 246 | + ), |
| 247 | + c( |
| 248 | + maketext('Append to distribution default') |
| 249 | + => [ map { [ $_ => "$_.conf" ] } @addOnConfFiles ] |
| 250 | + ) |
| 251 | + ], |
| 252 | + id => 'add_on_conf', |
| 253 | + multiple => undef, |
| 254 | + size => 8, |
| 255 | + class => 'form-select' =%> |
| 256 | + </div> |
| 257 | + </div> |
| 258 | + % } else { |
| 259 | + <div class="form-check mt-3 mb-2"> |
| 260 | + <label class="form-check-label"> |
| 261 | + <%= check_box copy_config_file => 1, class => 'form-check-input' =%> |
| 262 | + <%= maketext('course configuration file') =%> |
| 263 | + <a class="help-popup" role="button" tabindex="0" data-bs-placement="top" |
| 264 | + data-bs-toggle="popover" data-bs-content="<%= maketext('Copying the course configuration ' |
| 265 | + . 'file may copy configuration settings that are specific to the original course ' |
| 266 | + . 'instructor. If this is a new course for a new instructor, use the fields above to ' |
| 267 | + . 'add the new instructor and do not copy the course configuration file. Then if ' |
| 268 | + . 'there is something in the course configuration file that should be carried into ' |
| 269 | + . 'the new course, the administrator can copy that manually. Alternatively, do copy ' |
| 270 | + . 'the course configuration file, but then the administrator should inspect the new ' |
| 271 | + . 'course configuration file and make adjustments for the new instructor.') =%>" |
| 272 | + > |
| 273 | + <i class="icon fas fa-question-circle" aria-hidden="true"></i> |
| 274 | + <span class="visually-hidden"> |
| 275 | + <%= maketext('Notes regarding copying the course configuration file') =%> |
| 276 | + </span> |
| 277 | + </a> |
| 278 | + </label> |
| 279 | + </div> |
| 280 | + % } |
240 | 281 | </fieldset> |
241 | 282 | <%= hidden_field last_page_was_add_course => 1 =%> |
242 | 283 | <%= $c->hidden_fields('number_of_additional_users') =%> |
|
0 commit comments