-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a template instead of redirecting when visiting the web root
With Github builds not being local, simply redirecting to /builds isn't very useful, so instead create a landing page with customizable templates.
- Loading branch information
1 parent
dd4ecea
commit d485219
Showing
5 changed files
with
260 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<html> | ||
<head> | ||
<title>LineageOTA Builds for <?php echo $branding['name']; ?></title> | ||
</head> | ||
<body> | ||
<h1>Currently available builds for <?php echo $branding['name']; ?></h1> | ||
<?php | ||
foreach( $builds as $build ) { | ||
echo "<a href=" . $build['url'] . "'>" . $build['filename'] . '</a><br>' . PHP_EOL; | ||
} | ||
?> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
h1 { | ||
text-align: center; | ||
} | ||
|
||
h2 { | ||
text-align: center; | ||
margin-bottom: 0px; | ||
} | ||
|
||
h3 { | ||
text-align: center; | ||
margin-top: 0px; | ||
} | ||
|
||
table { | ||
margin-left: auto; | ||
margin-right: auto; | ||
border-collapse: collapse; | ||
} | ||
|
||
th { | ||
vertical-align: bottom; | ||
background: blue; | ||
color: white; | ||
font-weight: bold; | ||
padding: 5px; | ||
border: 0px; | ||
} | ||
|
||
tr:nth-child(even) { | ||
background-color: lightgrey; | ||
} | ||
|
||
td { | ||
padding: 5px; | ||
border: 0px; | ||
} | ||
|
||
table th:nth-child(1) { | ||
text-align: left; | ||
} | ||
|
||
table th:nth-child(2) { | ||
text-align: center; | ||
} | ||
|
||
table th:nth-child(3) { | ||
text-align: center; | ||
} | ||
|
||
table th:nth-child(4) { | ||
text-align: center; | ||
} | ||
|
||
table th:nth-child(5) { | ||
text-align: center; | ||
} | ||
|
||
table td:nth-child(2) { | ||
text-align: center; | ||
} | ||
|
||
table td:nth-child(3) { | ||
text-align: center; | ||
} | ||
|
||
table td:nth-child(4) { | ||
text-align: center; | ||
} | ||
|
||
table td:nth-child(5) { | ||
text-align: center; | ||
} | ||
|
||
ul { | ||
text-align: center; | ||
} | ||
|
||
li { | ||
display: inline-block; | ||
padding-right: 10px; | ||
} | ||
|
||
ul li:not(:first-child)::before { | ||
content: "\00b7 "; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<html> | ||
<head> | ||
<title>LineageOTA Builds for <?php echo $branding['name']; ?></title> | ||
<link rel="stylesheet" href="views/ota-list-tables.css"> | ||
</head> | ||
<body> | ||
<h1>Currently available builds for <?php echo $branding['name']; ?></h1> | ||
<ul> | ||
<?php | ||
foreach( $sortedBuilds as $model => $build ) { | ||
if( array_key_exists( $model, $deviceNames ) ) { | ||
echo '<li><a href="#' . $model . '">' . $model . '</a> (' . $vendorNames[$model] . ' ' . $deviceNames[$model] . ')</li>' . PHP_EOL; | ||
} else { | ||
echo '<li><a href="#' . $model . '">' . $model . '</a></li>' . PHP_EOL; | ||
} | ||
} | ||
?> | ||
</ul> | ||
|
||
<p><hr /></p> | ||
|
||
<?php | ||
foreach( $sortedBuilds as $model => $builds ) { | ||
if( array_key_exists( $model, $deviceNames ) ) { | ||
echo '<h2 id="' . $model . '">' . $model . '</h2>' . PHP_EOL; | ||
echo '<h3>(' . $vendorNames[$model] . ' ' . $deviceNames[$model] . ')</h3>' . PHP_EOL; | ||
} else { | ||
echo '<h2 id="' . $model . '">' . $model . '</h2>' . PHP_EOL; | ||
} | ||
?> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>Filename</th> | ||
<th>Source</th> | ||
<th>Date<br>(Y//M/D)</th> | ||
<th>Channel</th> | ||
<th>Version</th> | ||
<th>MD5 Checksum</th> | ||
</tr> | ||
</thead> | ||
|
||
<tbody> | ||
<?php | ||
foreach( $builds as $build ) { | ||
$source = '<a href="' . $branding['LocalURL'] . '">local</a>'; | ||
if( strstr( $build['url'], 'github.com' ) ) { $source = '<a href="' . $branding['GithubURL'] . '">Github</a>'; } | ||
|
||
echo "\t\t<tr>" . PHP_EOL; | ||
echo "\t\t\t<td><a href=" . $build['url'] . "'>" . $build['filename'] . '</a></td>' . PHP_EOL; | ||
echo "\t\t\t<td>" . $source . '</td>' . PHP_EOL; | ||
echo "\t\t\t<td>" . date( 'Y/m/d', $build['timestamp'] ) . '</td>' . PHP_EOL; | ||
echo "\t\t\t<td>" . $build['channel'] . '</td>' . PHP_EOL; | ||
echo "\t\t\t<td>" . $build['version'] . '</td>' . PHP_EOL; | ||
echo "\t\t\t<td>" . $build['md5sum'] . '</td>' . PHP_EOL; | ||
echo "\t\t</tr>" . PHP_EOL; | ||
} | ||
?> | ||
</tbody> | ||
</table> | ||
|
||
<p><hr /></p> | ||
|
||
<?php | ||
} | ||
?> | ||
|
||
</body> | ||
</html> |