Skip to content

customizable status page #31

@Anniepoo

Description

@Anniepoo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions