-
Notifications
You must be signed in to change notification settings - Fork 42
Description
Jan made the status page customizable.
% TODO add activation page
%
%! http:status_page(+Term, +Context, -HTML)
%
% Provide a custom error page for the forbidden action.
http:status_page(forbidden(Path), Context, HTML) :-
phrase(page([ title(\local('Access denied'))
],
[ h1(\local('Access denied')),
p([\local('You do not have sufficient privileges to access '),
Path]),
\forbidden_reason(Context)
]),
HTML).
forbidden_reason(Context) -->
{ memberchk(no_role(User, Role), Context) },
html(p(\local('The user ~p does not have role ~p'-[User,Role]))).
forbidden_reason(Context) -->
{ memberchk(needs_activation(User), Context) },
html([p(\local('The user ~p needs to activate their account'-[User])),
a(href(location_by_id(login(resend/User))), \local('Resend activation email'))]).