Adjusted the UI
This commit is contained in:
parent
55648f5629
commit
982f2c9a53
3 changed files with 22 additions and 36 deletions
Binary file not shown.
Binary file not shown.
|
@ -16,23 +16,30 @@ def html(page, json):
|
||||||
if "licenses" in json and json["licenses"]:
|
if "licenses" in json and json["licenses"]:
|
||||||
free = True
|
free = True
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
page = page + "\n <h1>"
|
page = page + "\n <h1>"
|
||||||
try:
|
try:
|
||||||
page = page + '\n<img src="'+ json["links"]["icon"] + '" alt="Logo" style="width:50px;">'
|
page = page + '\n<img src="'+ json["links"]["icon"] + '" alt="Logo" style="width:50px;">'
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Name / Website link
|
|
||||||
name = json.get("names",["Unknown"])[0]
|
name = json.get("names",["Unknown"])[0]
|
||||||
|
|
||||||
|
|
||||||
page = page + "\n" + name
|
page = page + "\n" + name
|
||||||
|
|
||||||
page = page + "</h1>"
|
page = page + "</h1>"
|
||||||
|
|
||||||
# Few words about it
|
# Few words about it
|
||||||
page = page + "<p>"+json.get("comment","")+"</p>"
|
page = page + "<p>"+json.get("comment","")+"</p>"
|
||||||
|
|
||||||
|
# I want to show nothing else from if it's proprietary
|
||||||
|
if not free:
|
||||||
|
|
||||||
|
l = json.get("issues", [])
|
||||||
|
page = page +"<h2>Anti-Features / Problems:</h2>"
|
||||||
|
|
||||||
|
for i in l:
|
||||||
|
page = page + "<br> "+i
|
||||||
|
|
||||||
|
return page
|
||||||
|
|
||||||
|
|
||||||
# Links
|
# Links
|
||||||
|
@ -56,35 +63,14 @@ def html(page, json):
|
||||||
|
|
||||||
page = page + "<table><tr>"
|
page = page + "<table><tr>"
|
||||||
|
|
||||||
website = json.get("links",{}).get("website", "")
|
links = json.get("links", {})
|
||||||
if free and website:
|
for website in links:
|
||||||
|
if website in ["icon"]:
|
||||||
|
continue
|
||||||
|
link = links[website]
|
||||||
page = page + """
|
page = page + """
|
||||||
<th><form action=\""""+website+"""\">
|
<th><form action=\""""+link+"""\">
|
||||||
<button type="submit">Website</button>
|
<button title=\""""+link+"""\" type="submit">"""+website.upper()+"""</button>
|
||||||
</form></th>
|
|
||||||
"""
|
|
||||||
|
|
||||||
git = json.get("links",{}).get("git", "")
|
|
||||||
if git:
|
|
||||||
page = page + """
|
|
||||||
<th><form action=\""""+git+"""\">
|
|
||||||
<button type="submit">Source Code</button>
|
|
||||||
</form></th>
|
|
||||||
"""
|
|
||||||
|
|
||||||
wikipedia = json.get("links",{}).get("wikipedia", "")
|
|
||||||
if wikipedia:
|
|
||||||
page = page + """
|
|
||||||
<th><form action=\""""+wikipedia+"""\">
|
|
||||||
<button type="submit">Wikipedia</button>
|
|
||||||
</form></th>
|
|
||||||
"""
|
|
||||||
|
|
||||||
documentation = json.get("links",{}).get("documentation", "")
|
|
||||||
if documentation:
|
|
||||||
page = page + """
|
|
||||||
<th><form action=\""""+documentation+"""\">
|
|
||||||
<button type="submit">Documentation</button>
|
|
||||||
</form></th>
|
</form></th>
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -108,10 +94,10 @@ def html(page, json):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
page = page + "<details>"
|
page = page + "<details>"
|
||||||
page = page +"<summary>"+categories[c]+"</summary>"
|
page = page +"<summary>"+categories[c]+":</summary>"
|
||||||
|
|
||||||
for i in l:
|
for i in l:
|
||||||
page = page + "<span> "+i+"</span><br>"
|
page = page + " "+i+"<br>"
|
||||||
page = page + "</details>"
|
page = page + "</details>"
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue