CSS : Modify the design of download page;
Python: Add instructions for operating systems and for featured clients; SVG : Add new icons and optimize existing icons; TOML : Add a file for operating systems; XHTML : Add a page for operating systems.
This commit is contained in:
parent
6625035969
commit
8675f295e6
24 changed files with 608 additions and 1159 deletions
51
fasi.py
51
fasi.py
|
@ -667,13 +667,44 @@ class HttpInstance:
|
|||
response.headers['Content-Type'] = 'application/xhtml+xml'
|
||||
return response
|
||||
|
||||
@self.app.get('/download')
|
||||
@self.app.get('/download/{software}')
|
||||
@self.app.get('/download/{software}/{kind}')
|
||||
async def download_get(request: Request, software=None, kind=None):
|
||||
@self.app.get('/selection')
|
||||
async def selection_get(request: Request):
|
||||
filename = 'systems.toml'
|
||||
software = Data.open_file_toml(filename)['systems']
|
||||
template_file = 'software.xhtml'
|
||||
template_dict = {
|
||||
'brand_name' : brand_name,
|
||||
'brand_site' : brand_site,
|
||||
'chat_client' : chat_client,
|
||||
'request' : request,
|
||||
'software' : software,
|
||||
'url' : request.url._url}
|
||||
response = templates.TemplateResponse(template_file, template_dict)
|
||||
response.headers['Content-Type'] = 'application/xhtml+xml'
|
||||
return response
|
||||
|
||||
# TODO admin, advanced, console, desktop, graphical, mobile
|
||||
if not kind: kind = 'graphical'
|
||||
#@self.app.get('/download/select')
|
||||
#async def download_select_get(request, software=None):
|
||||
|
||||
@self.app.get('/download/{software}')
|
||||
async def download_software_get(request: Request, software):
|
||||
response = await download_get(request, featured=True, software=software)
|
||||
return response
|
||||
|
||||
@self.app.get('/download/{software}/all')
|
||||
async def download_software_all_get(request: Request, software):
|
||||
response = await download_get(request, featured=False, software=software)
|
||||
return response
|
||||
|
||||
@self.app.get('/download')
|
||||
async def download_get(request: Request, featured=True, software=None):
|
||||
|
||||
# TODO
|
||||
# Fearured clients '/download/{software}'
|
||||
# All clients '/download/{software}/all'
|
||||
# Select software '/download/select'
|
||||
|
||||
skipped = False
|
||||
|
||||
if not software:
|
||||
user_agent = request.headers.get("user-agent")
|
||||
|
@ -699,12 +730,15 @@ class HttpInstance:
|
|||
client_selection = []
|
||||
for client in clients:
|
||||
if software in clients[client]:
|
||||
if featured and 'featured' not in clients[client]['properties']:
|
||||
skipped = True
|
||||
continue
|
||||
client_selected = {
|
||||
'name' : clients[client]['title'],
|
||||
'about' : clients[client]['about'],
|
||||
'features' : clients[client]['features'],
|
||||
'iden' : client,
|
||||
'href' : clients[client][software],
|
||||
'iden' : client,
|
||||
'properties' : clients[client]['properties'],
|
||||
'resources' : clients[client]['resources'] if 'resources' in clients[client] else ''}
|
||||
client_selection.append(client_selected)
|
||||
|
||||
|
@ -714,6 +748,7 @@ class HttpInstance:
|
|||
'brand_site' : brand_site,
|
||||
'chat_client' : chat_client,
|
||||
'client_selection' : client_selection,
|
||||
'skipped' : skipped,
|
||||
'request' : request,
|
||||
'software' : software,
|
||||
'title' : name,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue