diff --git a/Kinza/lib/Kinza/Schema/Result/Student.pm b/Kinza/lib/Kinza/Schema/Result/Student.pm index bcd2624..42293ca 100644 --- a/Kinza/lib/Kinza/Schema/Result/Student.pm +++ b/Kinza/lib/Kinza/Schema/Result/Student.pm @@ -194,6 +194,18 @@ sub allowed_courses { return $self->form->year->allowed_courses; } +sub is_registered { + my $self = shift; + + return length $self->password; +} + +sub is_verified { + my $self = shift; + + return $self->is_registered && ! $self->verify; +} + # You can replace this text with custom code or comments, and it will be preserved on regeneration __PACKAGE__->meta->make_immutable; 1; diff --git a/Kinza/views/years.tt b/Kinza/views/years.tt index 6048d79..aac01af 100644 --- a/Kinza/views/years.tt +++ b/Kinza/views/years.tt @@ -15,8 +15,8 @@ END -%] NameEmailRegisteredVerifiedSelected [% FOREACH student IN form.students.sort('name') -%] [% student.name %][% student.email %] -[% ok(student.password) %] -[% ok(student.password AND NOT student.verify) %] +[% ok(student.is_registered) %] +[% ok(student.is_verified) %] [% ok(student.locked) %] [% END -%] [% END -%]