aceberg/git-confed

View on GitHub
internal/web/templates/index.html

Summary

Maintainability
Test Coverage
{{ define "index" }}

<body>
    <div class="container">
        <br>
        <div class="row">
            <div class="col"></div>
            <div class="col">
                <form action="/folder_add/" method="post" class="input-group">
                    <input name="path" type="text" class="form-control" placeholder="Path to folder with git repos">
                    <button type="submit" class="btn btn-primary">Add</button>
                </form>
            </div>
            <div class="col"></div>
        </div>
        <br>
        <div class="row">
            <table class="table table-striped">
                <tr>
                    <th style="width: 1%;"></th>
                    <th>Path &nbsp;&nbsp;<a href="/sort?tag=path-up"><i class="bi bi-caret-up"></i></a>&nbsp;&nbsp;&nbsp;<a href="/sort?tag=path-down"><i class="bi bi-caret-down"></i></a>
                    </th>
                    <th>Branch</th>
                    <th>User</th>
                    <th>Remote</th>
                    <th>URL</th>
                    <th>Other</th>
                    <th style="width: 1%;"></th>
                </tr>
                {{ range .Repos }}
                <tr>
                    <td>
                        <a style="color: #{{ .Color }};" href="/filter?tag=folder&name={{ .Folder }}">
                            <i class="bi bi-folder-fill"></i>
                        </a>
                    </td>
                    <td>{{ .Path }}</td>
                    <td>
                        <a href="/filter?tag=branch&name={{ .Branch }}">{{ .Branch }}</a>
                    </td>
                    <td>
                        <a href="/filter?tag=user&name={{ .User }}">{{ .User }}</a>
                    </td>
                    <td>
                        {{ range .Remote }}<a href="/filter?tag=remote&name={{ . }}">{{ . }}</a><br>{{ end }}
                    </td>
                    <td>
                        {{ range .URL }}<a href="/filter?tag=url&name={{ . }}">{{ . }}</a><br>{{ end }}
                    </td>
                    <td>
                        {{ range .Other }}<a href="/filter?tag=other&name={{ . }}">{{ . }}</a><br>{{ end }}
                    </td>
                    <td>
                        <a href="/edit?path={{ .Path }}">
                            <button type="submit" class="btn btn-primary">
                                <i class="bi bi-pencil"></i>
                            </button>
                        </a>
                    </td>
                </tr>
                {{ end }}
            </table>
        </div>
    </div>

{{ template "footer" }}
{{ end }}