Skip to content

Commit 1b4c0ac

Browse files
authored
Merge pull request #1736 from mgage/main-add-sponsor
Main add sponsor
2 parents 7242bbb + 07b7353 commit 1b4c0ac

File tree

1 file changed

+105
-55
lines changed

1 file changed

+105
-55
lines changed

lib/WeBWorK/ContentGenerator/CourseAdmin.pm

Lines changed: 105 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -384,11 +384,11 @@ sub body {
384384
[ 'hide_inactive_course', $r->maketext('Hide Courses') ],
385385
)
386386
);
387+
387388
print CGI::hr({ class => 'mt-0' });
388389
print $methodMessage;
389390

390-
print(CGI::p({ style => "text-align: center" }, $self->display_registration_form()))
391-
if $self->display_registration_form();
391+
print $self->display_registration_form;
392392

393393
my @errors = @{$self->{errors}};
394394

@@ -4136,61 +4136,111 @@ sub upgrade_notification {
41364136
our $registered_file_name = "registered_???";
41374137

41384138
sub display_registration_form {
4139-
my $self = shift;
4140-
my $ce = $self->r->ce;
4139+
my $self = shift;
4140+
my $ce = $self->r->ce;
41414141
my $ww_version = $ce->{WW_VERSION};
41424142
$registered_file_name = "registered_$ww_version";
4143-
my $registeredQ = (-e ($ce->{courseDirs}->{root})."/$registered_file_name")?1:0;
4144-
my $registration_subDisplay = ( defined($self->r->param('subDisplay') ) and $self->r->param('subDisplay') eq "registration") ? 1: 0;
4145-
my $register_site = ($self->r->param("register_site"))?1:0;
4146-
return 0 if $registeredQ or $register_site or $registration_subDisplay; #otherwise return registration form
4147-
return q!
4148-
<center>
4149-
<div class="admin-messagebox">
4150-
!,
4151-
CGI::p(join(" ",
4152-
"<strong>Please consider registering for the WW-security-announce Google group / mailing list</strong> using the ",
4153-
"join group link on the ",
4154-
CGI::a({href=>$ce->{webworkURLs}{wwSecurityAnnounce}, target=>"_blank"},"group page"),
4155-
" which appears when you are logged in to a Google account <strong>or</strong> by sending an email using ",
4156-
CGI::a({href=> join("",
4157-
'mailto:', $ce->{webworkSecListManagers} , '?subject=Joining%20ww-security-announce&',
4158-
'body=Server%20URL%3A%20' , uri_escape($ce->{apache_root_url}),
4159-
'%0AWeBWorK%20version%3A%20' , uri_escape($ce->{WW_VERSION}),
4160-
'%0AInstitution%20name%3A%20%0A' ) }, ,"this mailto link."),
4161-
"<br>This list will help us keep you updated about security issues and patches, and important related announcements.",
4162-
"<hr>")),
4163-
CGI::p(join("",
4164-
"We are often asked how many institutions are using WeBWorK and how many students are using ",
4165-
"WeBWorK. Since WeBWorK is open source and can be freely downloaded from ",
4166-
CGI::a({href=>$ce->{webworkURLs}{GitHub}, target=>"_blank"}, $ce->{webworkURLs}{GitHub}),
4167-
", it is frequently difficult for us to give a reasonable answer to this question.")),
4168-
CGI::p(join("",
4169-
"You can help by ",
4170-
CGI::a({href=>$ce->{webworkURLs}{serverRegForm}, target=>"_blank"}, "registering your current version of WeBWorK"),
4171-
". Please complete the Google form as best you can and submit your answers ",
4172-
"to the WeBWorK Project team. It takes just 2-3 minutes. Thank you!. -- The WeBWorK Project")),
4173-
CGI::p(join("",
4174-
"Eventually your site will be listed along with all of the others on the ",
4175-
CGI::a({href=>$ce->{webworkURLs}{SiteMap}, target=>"_blank"}, "site map"),
4176-
" on the main ",
4177-
CGI::a({href=>$ce->{webworkURLs}{WikiMain}, target=>"_blank"}, "WeBWorK Wiki"),".<hr>")),
4178-
CGI::p('You can hide this "registration" banner for the future by clicking the button below.'),
4179-
CGI::start_form(-method=>"POST", id=>"return_to_main_page", -action=>$self->r->uri),
4180-
$self->hidden_authen_fields,
4181-
CGI::hidden(-name=>'subDisplay', -value=>"registration"),
4182-
CGI::p({ style => "text-align: center" },
4183-
CGI::submit({
4184-
id => "register_site",
4185-
name => "register_site",
4186-
label => "Hide the banner.",
4187-
class => 'btn btn-primary'
4188-
})),
4189-
CGI::end_form(),
4190-
q!
4191-
</div>
4192-
</center>
4193-
!;
4143+
my $registeredQ = (-e "$ce->{courseDirs}{root}/$registered_file_name") ? 1 : 0;
4144+
my $registration_subDisplay =
4145+
(defined($self->r->param('subDisplay')) && $self->r->param('subDisplay') eq 'registration') ? 1 : 0;
4146+
my $register_site = ($self->r->param('register_site')) ? 1 : 0;
4147+
4148+
return CGI::div({ class => 'd-flex justify-content-center' }, "REGISTERED for WeBWorK $ww_version")
4149+
if $registeredQ || $register_site || $registration_subDisplay;
4150+
4151+
# Otherwise return registration form.
4152+
return CGI::div(
4153+
{ class => 'd-flex justify-content-center' },
4154+
CGI::div(
4155+
{ class => 'admin-messagebox' },
4156+
4157+
CGI::p(
4158+
CGI::strong('Please consider registering for the WW-security-announce Google group / mailing list'),
4159+
' using the join group link on the ',
4160+
CGI::a({ href => $ce->{webworkURLs}{wwSecurityAnnounce}, target => '_blank' }, 'group page'),
4161+
' which appears when you are logged in to a Google account ',
4162+
CGI::strong('or'),
4163+
' by sending an email using ',
4164+
CGI::a(
4165+
{
4166+
href => join('',
4167+
"mailto:$ce->{webworkSecListManagers}?subject=",
4168+
uri_escape('Joining ww-security-announce'),
4169+
'&body=',
4170+
uri_escape("Server URL: $ce->{apache_root_url}\n"),
4171+
uri_escape("WeBWorK version: $ce->{WW_VERSION}\n"),
4172+
uri_escape("Institution name: \n"))
4173+
},
4174+
,
4175+
'this mailto link'
4176+
),
4177+
'. This list will help us keep you updated about security issues and patches, '
4178+
. 'and important related announcements.'
4179+
),
4180+
4181+
CGI::hr(),
4182+
4183+
CGI::p(
4184+
'Please consider contributing to WeBWorK development either with a one time contribution or monthly ',
4185+
'support. The WeBWorK Project is a registered 501(c)(3) organization and contributions are tax ',
4186+
'deductible in the United States.'
4187+
),
4188+
CGI::div(
4189+
{ class => 'text-center' },
4190+
CGI::a(
4191+
{
4192+
class => 'btn btn-secondary',
4193+
href => 'https://github.com/sponsors/openwebwork',
4194+
target => '_blank'
4195+
},
4196+
CGI::i({ class => 'fa-regular fa-heart' }, '') . ' Sponsor',
4197+
)
4198+
),
4199+
4200+
CGI::hr(),
4201+
4202+
CGI::p("This site is not registered for WeBWorK version $ww_version."),
4203+
CGI::p(
4204+
'We are often asked how many institutions are using WeBWorK and how many students are using WeBWorK. ',
4205+
'Since WeBWorK is open source and can be freely downloaded from ',
4206+
CGI::a({ href => $ce->{webworkURLs}{GitHub}, target => '_blank' }, $ce->{webworkURLs}{GitHub}),
4207+
', it is frequently difficult for us to give a reasonable answer to this question.'
4208+
),
4209+
CGI::p(
4210+
'You can help by ',
4211+
CGI::a(
4212+
{ href => $ce->{webworkURLs}{serverRegForm}, target => '_blank' },
4213+
'registering your current version of WeBWorK'
4214+
),
4215+
'. Please complete the Google form as best you can and submit your answers ',
4216+
'to the WeBWorK Project team. It takes just 2-3 minutes. Thank you! -- The WeBWorK Project'
4217+
),
4218+
CGI::p(
4219+
'Eventually your site will be listed along with all of the others on the ',
4220+
CGI::a({ href => $ce->{webworkURLs}{SiteMap}, target => '_blank' }, 'site map'),
4221+
' on the main ',
4222+
CGI::a({ href => $ce->{webworkURLs}{WikiMain}, target => '_blank' }, 'WeBWorK Wiki'),
4223+
'.',
4224+
),
4225+
4226+
CGI::hr(),
4227+
4228+
CGI::p('You can hide this "registration" banner for the future by clicking the button below.'),
4229+
CGI::start_form({ method => 'POST', id => 'return_to_main_page', action => $self->r->uri }),
4230+
$self->hidden_authen_fields,
4231+
CGI::hidden({ name => 'subDisplay', value => 'registration' }),
4232+
CGI::div(
4233+
{ class => 'text-center' },
4234+
CGI::submit({
4235+
id => 'register_site',
4236+
name => 'register_site',
4237+
label => 'Hide the banner.',
4238+
class => 'btn btn-primary'
4239+
})
4240+
),
4241+
CGI::end_form()
4242+
)
4243+
);
41944244
}
41954245

41964246
sub registration_form {

0 commit comments

Comments
 (0)