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

Static page errors #82

Closed
MdreW opened this issue Sep 2, 2023 · 2 comments
Closed

Static page errors #82

MdreW opened this issue Sep 2, 2023 · 2 comments

Comments

@MdreW
Copy link
Collaborator

MdreW commented Sep 2, 2023

Hi @peppelinux and each others partecipants,

I would like to go back to talking about the error pages.
With a simple script we can generate the SPID/CIE specific error pages from the generic error page (or also from the discovery page).

With single error pages we can redirect the errors to the right error page.
Vantages:

  • we an remove jinja from requisites
  • We can load the errors messages and other details from a json file
  • Is simple presonalize the template and the messages

example - in the new proposed discovery pages I have assigned an id 'main-errors' in the template:

from bs4 import BeautifulSoup 
soup = BeautifulSoup(open("static/error_page.html", "r").read()) 
errors = {'1.html': 'message_1', '2.html': 'message_2', '3.html': '<p>message 3</p>'} # or better a json file
for key in errors.keys():
  soup.find(id='main-error').string = errors[key]
  open(key, "w").write(soup.prettify())

With six code line we can create all errors pages and is simple add this function on startup script
What don't you think? is it a solution or a complication?

@peppelinux
Copy link
Member

Good hint @MdreW

I'd like to get you in the current developements with the following scopes:

  1. moving texts to .po files (gettext) and having i18n with at least italian and english
  2. creating a setup script that replaces the constants in the static discovery page, according to what defined in the proxy (and its configured backends ...)

then I have concerns about bs4, probably we have new libraries that does that better, but this is not a priority.
I'll invite you in the next dev meeting

@MdreW
Copy link
Collaborator Author

MdreW commented Nov 10, 2023

issue withdrawn on favour of #88

@MdreW MdreW closed this as completed Nov 10, 2023
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

2 participants