Clean up git URL and commit/release display
Committed 59c17d
--- a/webint_code/__init__.py
+++ b/webint_code/__init__.py
project,
gmpg.get_repo(project_dir / "working"),
readme,
- app.model.get_package_versions(project),
+ [
+ (
+ release,
+ web.application("webint_posts").model.get(
+ f"code/projects/{project}/releases/{release}"
+ ),
+ )
+ for release in reversed(
+ sorted(
+ app.model.get_package_versions(project),
+ key=semver.parse_version_info,
+ )
+ )
+ ],
pyproject,
api_python,
test_results,
--- a/webint_code/templates/project/index.html
+++ b/webint_code/templates/project/index.html
background-color: #073642;
font-family: UbuntuMonoPowerline;
padding: .5em; }
-#files ul, .commits {
+#files ul, .commits, .releases {
list-style: none;
padding-left: 0; }
+#files ul {
+ margin: 0; }
+#files p {
+ font-size: .8em;
+ margin-bottom: 0; }
.testindicator {
border-radius: 50%;
display: inline-block;
height: .9em;
width: .9em; }
+aside h2 {
+ font-size: 1.25em; }
</style>
$ issues = 0
</p>
$if repo.exists():
- $ git_url = f"{tx.origin}/code/projects/{project}.git"
- <pre><small>git clone $git_url <button
- onclick="navigator.clipboard.writeText('$git_url')">📋</button></small></pre>
-
<div id=files>
$ ignorable_files = (
$ ".github",
</ul>
$ prev_file = None
$ known_files = [f for f in files if str(f).partition("/")[0] in ignorable_files]
- <p style=font-size:.8em>\
+ <p>\
$for file in known_files:
$ file, is_dir, _ = str(file).partition("/")
$if file == prev_file:
</p>
</div>
+ $ git_url = f"{tx.origin}/code/projects/{project}.git"
+ <pre style=text-align:right><small>git clone $git_url <a href=#
+ onclick="navigator.clipboard.writeText('$git_url'); return false">📋</a></small></pre>
+
$if readme:
<link rel=stylesheet href=$tx.origin/static/solarized.css media=screen>
<div>$:mkdn(readme)</div>
$# <a class=u-author href="$author_url">$commit["author_name"]</a>
<a class=u-url href=/projects/$project/commits/$commit["hash"]><time
class=dt-published datetime=$commit["timestamp"].isoformat()>\
- $commit["timestamp"].diff_for_humans()</time></a>
+ $:commit["timestamp"].diff_for_humans().replace(" ", " ")</time></a>
</small></small>
</li>
</ul>
$if package_releases:
<h2>Releases</h2>
- <ul class=h-feed>
- $for release in list(reversed(sorted(package_releases, key=semver.parse_version_info)))[:1]:
- <li class=h-entry><a href=/projects/$project/releases/$release>$release</a></li>
+ <ul class="releases h-feed">
+ $for release, entry in package_releases[:3]:
+ <li class=h-entry>
+ <span class=p-name>$release</span>
+ <small><small>
+ <a class=u-url href=/projects/$project/releases/$release><time
+ class=dt-published datetime=$entry["published"][0].isoformat()>\
+ $:entry["published"][0].diff_for_humans().replace(" ", " ")</time></a>
+ </small></small>
+ </li>
</ul>
$var aside = aside