Clean up files listing and add more commits to project index
Committed e0f669
--- a/webint_code/templates/project/index.html
+++ b/webint_code/templates/project/index.html
<style>
/* h2 {
display: none; } */
-.files, .commits {
+#files {
+ background-color: #073642;
+ font-family: UbuntuMonoPowerline;
+ padding: .5em; }
+#files ul, .commits {
list-style: none;
padding-left: 0; }
.testindicator {
</p>
$if repo.exists():
- $ git_clone = f"git clone {tx.origin}/code/projects/{project}.git"
+ $ git_clone_url = f"{tx.origin}/code/projects/{project}.git"
<script>
- copyText = () => {
- navigator.clipboard.writeText('$git_clone')
- }
+ copyText = () => { navigator.clipboard.writeText('$git_clone') }
</script>
- <pre><small><button onclick=copyText()>📋</button> \
- $git_clone</small></pre>
+ <pre><small>git clone $git_clone_url <button onclick=copyText()>📋</button></small></pre>
+ <div id=files>
$ ignorable_files = (
$ ".github",
$ ".gitignore",
$ )
$ files = sorted(repo.files)
$ prev_file = None
+ <ul>
+ $ unique_files = [f for f in files if str(f).partition("/")[0] not in ignorable_files]
+ $for file in unique_files:
+ $ file, is_dir, _ = str(file).partition("/")
+ $if file == prev_file:
+ $continue
+ <li><a href=/projects/$project/files/$file>$file</a>\
+ $if is_dir:
+ /
+ </li>
+ $ prev_file = file
+ </ul>
+ $ prev_file = None
$ known_files = [f for f in files if str(f).partition("/")[0] in ignorable_files]
<p style=font-size:.8em>\
$for file in known_files:
$if not loop.last:
,
</p>
- $ prev_file = None
- <ul class=files>
- $ unique_files = [f for f in files if str(f).partition("/")[0] not in ignorable_files]
- $for file in unique_files:
- $ file, is_dir, _ = str(file).partition("/")
- $if file == prev_file:
- $continue
- <li><a href=/projects/$project/files/$file>$file</a>\
- $if is_dir:
- /
- </li>
- $ prev_file = file
- </ul>
+ </div>
$if readme:
<link rel=stylesheet href=$tx.origin/static/solarized.css media=screen>
$if repo.exists():
<h2>Commits</h2>
<ul class="commits h-feed">
- $for commit in list(repo.log.values())[:1]:
+ $for commit in list(repo.log.values())[:5]:
$ author_url = commit['author_email']
$if "@" in author_url:
$ author_url = f"mailto:{author_url}"