Upload files to 'modules'
This commit is contained in:
parent
f204444115
commit
3df34cd5e1
1 changed files with 82 additions and 6 deletions
|
@ -33,31 +33,79 @@ def html(page, json):
|
|||
# Few words about it
|
||||
page = page + "<p>"+json.get("comment","")+"</p>"
|
||||
|
||||
|
||||
|
||||
# Links
|
||||
|
||||
# <table>
|
||||
# <tr>
|
||||
# <th>Company</th>
|
||||
# <th>Contact</th>
|
||||
# <th>Country</th>
|
||||
#</tr>
|
||||
|
||||
page = page + """
|
||||
<style>
|
||||
table, th, td {
|
||||
border-right:none;
|
||||
border-left:none;
|
||||
border-bottom:none;
|
||||
border-top:none
|
||||
}</style>
|
||||
"""
|
||||
|
||||
page = page + "<table><tr>"
|
||||
|
||||
website = json.get("links",{}).get("website", "")
|
||||
if free and website:
|
||||
page = page + """
|
||||
<form action=\""""+website+"""\">
|
||||
<th><form action=\""""+website+"""\">
|
||||
<button type="submit">Website</button>
|
||||
</form>
|
||||
</form></th>
|
||||
"""
|
||||
|
||||
git = json.get("links",{}).get("git", "")
|
||||
if git:
|
||||
page = page + """
|
||||
<form action=\""""+git+"""\">
|
||||
<th><form action=\""""+git+"""\">
|
||||
<button type="submit">Source Code</button>
|
||||
</form>
|
||||
</form></th>
|
||||
"""
|
||||
|
||||
wikipedia = json.get("links",{}).get("wikipedia", "")
|
||||
if wikipedia:
|
||||
page = page + """
|
||||
<form action=\""""+wikipedia+"""\">
|
||||
<th><form action=\""""+wikipedia+"""\">
|
||||
<button type="submit">Wikipedia</button>
|
||||
</form>
|
||||
</form></th>
|
||||
"""
|
||||
|
||||
page = page + "</tr></table>"
|
||||
|
||||
# Details
|
||||
|
||||
categories = {"generic_name":"Features",
|
||||
"licenses":"License(s)",
|
||||
"platforms":"Platforms",
|
||||
"networks_read":"Accesses Data from",
|
||||
"networks_write":"Interacts / Publishes to",
|
||||
"formats_read":"Opens from File-Formats",
|
||||
"formats_write":"Saves to File-Formats",
|
||||
"issues":"Anti-Features / Problems"}
|
||||
|
||||
for c in categories:
|
||||
|
||||
l = json.get(c, [])
|
||||
if not l:
|
||||
continue
|
||||
|
||||
page = page + "<details>"
|
||||
page = page +"<summary>"+categories[c]+"</summary>"
|
||||
|
||||
for i in l:
|
||||
page = page + "<span> "+i+"</span><br>"
|
||||
page = page + "</details>"
|
||||
|
||||
|
||||
return page
|
||||
|
||||
|
@ -86,4 +134,32 @@ def suggestions(page, json):
|
|||
page = page + "<br><br>"
|
||||
page = html(page, i[-1])
|
||||
|
||||
return page
|
||||
|
||||
def search_widget(page):
|
||||
|
||||
# Adds a search bar to the page
|
||||
|
||||
page = page + """
|
||||
<form action="/search" method="GET">
|
||||
<input type="text" name="item" class="search" placeholder="Name of Software">
|
||||
<button type="submit">Search</button>
|
||||
</form>
|
||||
"""
|
||||
|
||||
return page
|
||||
|
||||
def source_code_link(page):
|
||||
|
||||
# Adds a source code link
|
||||
|
||||
page = page + "<br><br><p>This website is under the GNU AGPL license.</p>"
|
||||
page = page + """
|
||||
<form action=https://notabug.org/jyamihud/FreeCompetitors>
|
||||
<button type="submit">Source Code</button>
|
||||
</form><br><br>
|
||||
"""
|
||||
|
||||
|
||||
|
||||
return page
|
||||
|
|
Loading…
Reference in a new issue