swiplwebtut icon indicating copy to clipboard operation
swiplwebtut copied to clipboard

customizable status page

Open Anniepoo opened this issue 4 years ago • 0 comments

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'))]).

Anniepoo avatar Jun 17 '20 14:06 Anniepoo