ctucx.git: nimstagit

[nimlang] incomplete reimplementation of stagit

1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
50 
51 
52 
#? stdtmpl | standard
#proc templateIndexPage(templateContext: TemplateContext, categories: seq[Category]): string =
#  result = ""
<!DOCTYPE html>
<html>
    <head>
        <title>$templateContext.siteTitle</title>

        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="$templateContext.description">
        <meta name="generator" content="https://cgit.ctu.cx/nimstagit">

        <link href="/style.css" rel="stylesheet" />
    </head>
    <body>
        <header>
            <h1>$templateContext.siteTitle</h1>
            <p>$templateContext.description</p>
        </header>
        <nav>
            <a class="active" href="index.html">index</a>
        </nav>
        <main>
            <h3>Overview</h3>
            <table>
                <thead>
                    <tr>
                        <td>Name</td>
                        <td>Description</td>
                        <td>Idle since</td>
                    </tr>
                </thead>
                #for category in items(categories):
                #if category.name != "":
                <tr>
                    <td colspan="3" class="reposection">$category.name</td>
                </tr>
                # end if
                # for repo in items(category.repos):
                <tr>
                    <td class="sublevel-repo"><a href="$repo.url/">$repo.name</a></td>
                    <td><a href="$repo.url/">$repo.description</a></td>
                    <td width="15%"><a href="/$repo.url/log/{$repo.objId}.html">$repo.lastActivity</a></span></td>
                </tr>
                #end for
                #end for
            </table>
        </main>
        <footer>Generated on $templateContext.generated</footer>
    </body>
</html>