Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

customizable status page #31

Open
Anniepoo opened this issue Jun 17, 2020 · 0 comments
Open

customizable status page #31

Anniepoo opened this issue Jun 17, 2020 · 0 comments

Comments

@Anniepoo
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant