diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2021-08-08 12:08:04 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2021-08-08 12:08:20 +0200 |
commit | 9b1ec371d107b1902f67f092e2ecb7442bb1ae2e (patch) | |
tree | 8d3e2b1cec2bb67b64681651993a033066467e97 | |
parent | f700fed45a9eeeede4a592568068ab52d719512f (diff) |
Add some style
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r-- | static/main.css | 3 | ||||
-rw-r--r-- | templates/base.template | 8 | ||||
-rw-r--r-- | templates/blob.template | 48 | ||||
-rw-r--r-- | templates/branch.template | 12 | ||||
-rw-r--r-- | templates/partials/branchlist.template | 4 | ||||
-rw-r--r-- | templates/partials/sidebar.template | 27 | ||||
-rw-r--r-- | templates/partials/taglist.template | 4 | ||||
-rw-r--r-- | templates/partials/tree.template | 27 | ||||
-rw-r--r-- | templates/repos.template | 6 | ||||
-rw-r--r-- | templates/tree.template | 34 |
10 files changed, 99 insertions, 74 deletions
diff --git a/static/main.css b/static/main.css index 8c44b8b..4ddae41 100644 --- a/static/main.css +++ b/static/main.css @@ -1,3 +1,4 @@ -#code td span { +#code { white-space: pre; + font-family: monospace; } diff --git a/templates/base.template b/templates/base.template index f9cddf0..10675b9 100644 --- a/templates/base.template +++ b/templates/base.template @@ -1,9 +1,15 @@ +<!DOCTYPE html> <html> <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> <title>agix - git repo web viewer</title> + <link rel="stylesheet" type="text/css" href="/static/bulma.css"/> <link rel="stylesheet" type="text/css" href="/static/main.css"/> </head> <body> - {{> page}} + <section class="section"> + {{> page}} + </section"section"> </body> </html> diff --git a/templates/blob.template b/templates/blob.template index 12cfde6..c9e8fef 100644 --- a/templates/blob.template +++ b/templates/blob.template @@ -1,29 +1,35 @@ {{#*inline "page"}} - {{> partial-sidebar}} + <div class="columns"> + {{> partial-sidebar}} - <p>The repo goes here, with branch {{this.data.branch_name}}</p> + <div class="column"> + <p>The repo goes here, with branch {{this.data.branch_name}}</p> - <div id="content"> - <div id="blob_size"> - {{this.data.size}} bytes - </div> + <div id="content"> + <div id="blob_size"> + {{this.data.size}} bytes + </div> - {{#if this.data.is_binary }} - <div id="blob_binary"> - Blob is binary, not rendering. - </div> - {{else}} - <div id="blob"> - <table id="code"> - {{#each this.data.content}} - <tr> - <td>{{this.number}}</td> - <td>{{{this.line}}}</td> - </tr> - {{/each}} - </table id="code"> + {{#if this.data.is_binary }} + <div id="blob_binary"> + Blob is binary, not rendering. + </div> + {{else}} + <div id="blob"> + <table id="code" class="table is-hoverable is-striped is-narrow"> + <tbody> + {{#each this.data.content}} + <tr> + <td>{{this.number}}</td> + <td>{{{this.line}}}</td> + </tr> + {{/each}} + </tbody> + </table id="code"> + </div> + {{/if}} </div> - {{/if}} + </div> </div> {{/inline}} {{> (lookup this "parent")}} diff --git a/templates/branch.template b/templates/branch.template index f6df44a..f6db858 100644 --- a/templates/branch.template +++ b/templates/branch.template @@ -1,10 +1,14 @@ {{#*inline "page"}} - {{> partial-sidebar}} + <div class="columns"> + {{> partial-sidebar}} - <p>The repo goes here, with branch {{this.data.branch_name}}</p> + <div class="column"> + <p>The repo goes here, with branch {{this.data.branch_name}}</p> - <div id="content"> - {{> partial-tree}} + <div id="content"> + {{> partial-tree}} + </div> + </div> </div> {{/inline}} {{> (lookup this "parent")}} diff --git a/templates/partials/branchlist.template b/templates/partials/branchlist.template index d5858cc..e460749 100644 --- a/templates/partials/branchlist.template +++ b/templates/partials/branchlist.template @@ -1,6 +1,6 @@ -<ul class="list list-branches"> +<ul class="menu-list"> {{#each this.data.branch_names as |branch|}} - <li class="list-item list-item-branch"> + <li> <a href="/{{@root/this.data.name}}/b/{{branch}}">{{branch}}</a> </li> {{/each}} diff --git a/templates/partials/sidebar.template b/templates/partials/sidebar.template index eea6198..2e39558 100644 --- a/templates/partials/sidebar.template +++ b/templates/partials/sidebar.template @@ -1,15 +1,20 @@ -<div id="partial-sidebar"> - <div id="partial-branchlist"> - {{> partial-branchlist}} - </div> - <div id="partial-taglist"> - {{> partial-taglist}} - </div> - <div id="partial-tree"> - <ul class="list list-tree"> +<aside class="column is-3 menu"> + <p class="menu-label"> + Branches + </p> + {{> partial-branchlist}} + + <p class="menu-label"> + Tags + </p> + {{> partial-taglist}} + + <p class="menu-label"> + Files + </p> + <ul class="menu-list"> {{#each this.data.tree_elements as |elem|}} {{> partial-tree elem}} {{/each}} </ul> - </div> -</div> +</aside> diff --git a/templates/partials/taglist.template b/templates/partials/taglist.template index a8a7da6..01d53f6 100644 --- a/templates/partials/taglist.template +++ b/templates/partials/taglist.template @@ -1,6 +1,6 @@ -<ul class="list list-tags"> +<ul class="menu-list"> {{#each this.data.tag_names as |tag|}} - <li class="list-item list-item-tag"> + <li> <a href="/{{@root/this.data.name}}/tag/{{tag}}">{{tag}}</a> </li> {{/each}} diff --git a/templates/partials/tree.template b/templates/partials/tree.template index 94733c6..a8d181f 100644 --- a/templates/partials/tree.template +++ b/templates/partials/tree.template @@ -1,23 +1,22 @@ -<li class="list-item list-item-tree"> +<li> {{log this}} {{#if this.is_dir}} - <div class="list-item-tree-dir"> + <p class="menu-label"> + {{this.name}} + </p> {{else}} - <div class="list-item-tree-file"> + {{#if this.path}} + <a href="/{{@root/this.data.name}}/b/{{@root/this.data.branch_name}}/t + {{~ #each this.path ~}} + /{{~ this ~}} + {{~ /each ~}}"> + {{this.name}} + </a> + {{/if}} {{/if}} - {{#if this.path}} - <a href="/{{@root/this.data.name}}/b/{{@root/this.data.branch_name}}/t - {{~ #each this.path ~}} - /{{~ this ~}} - {{~ /each ~}}"> - {{this.name}} - </a> - {{/if}} - </div> - {{#if this.subelements}} - <ul id="list list-tree"> + <ul class="menu-list"> {{#each this.subelements}} {{> partial-tree this}} {{/each}} diff --git a/templates/repos.template b/templates/repos.template index 8dd9b94..cca3e51 100644 --- a/templates/repos.template +++ b/templates/repos.template @@ -1,11 +1,11 @@ {{#*inline "page"}} - <div id="content"> + <div id="content" class="column"> {{#if this.data.repo_names}} <h2>Repos</h2> - <ul class="list list-repos"> + <ul class="rows"> {{#each this.data.repo_names as |repo|}} - <li class="list-item list-item-repo"> + <li class="row"> <a href="/{{repo}}">{{repo}}</a> </li> {{/each}} diff --git a/templates/tree.template b/templates/tree.template index 4d5281a..20772e9 100644 --- a/templates/tree.template +++ b/templates/tree.template @@ -1,22 +1,26 @@ {{#*inline "page"}} - {{> partial-sidebar}} + <div class="columns"> + {{> partial-sidebar}} - <p>The repo goes here, with branch {{this.data.branch_name}}</p> + <div class="column"> + <p>The repo goes here, with branch {{this.data.branch_name}}</p> - <div id="content"> - <ul> - {{#each this.data.content}} - <li> - {{#if this.is_dir}} - Directory - {{else}} - File - {{/if}} + <div id="content" class="column is-four-fifths"> + <ul> + {{#each this.data.content}} + <li> + {{#if this.is_dir}} + Directory + {{else}} + File + {{/if}} - {{this.name}} - </li> - {{/each}} - </ul> + {{this.name}} + </li> + {{/each}} + </ul> + </div> + </div> </div> {{/inline}} {{> (lookup this "parent")}} |