~bigbes/sr-ht-compare

ref: 04b591cd0be655f51284c69022c8854effaf9c7e sr-ht-compare/web/templates/index.html -rw-r--r-- 2.5 KiB
04b591cd — bigbes web: git.sr.ht-style dashboard and unified nav brand 11 days ago
                                                                                
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{{define "content"}}
{{if .Data.LoggedIn}}
<div class="row">
  <div class="col-md-4">
    <p>
      Compare two references — branches, tags or commits — of any git repository
      on this instance, and review the diff file by file.
    </p>
    <form method="GET" action="/jump">
      <div class="form-group">
        <label class="sr-only" for="owner">Owner</label>
        <input class="form-control" type="text" id="owner" name="owner"
               placeholder="~owner" autocomplete="off">
      </div>
      <div class="form-group">
        <label class="sr-only" for="repo">Repository</label>
        <input class="form-control" type="text" id="repo" name="repo"
               placeholder="repo" autocomplete="off">
      </div>
      <button class="btn btn-primary btn-block" type="submit">Compare</button>
    </form>
  </div>
  <div class="col-md-8">
    <hr class="d-md-none" />
    {{if .Data.Repos}}
    <div class="event-list">
      {{range .Data.Repos}}
      <div class="event">
        <h4>
          <a href="/~{{$.Username}}/{{.Name}}">~{{$.Username}}/{{.Name}}</a>
          {{if ne .Visibility "PUBLIC"}}
          <small class="pull-right">{{if eq .Visibility "UNLISTED"}}unlisted{{else}}private{{end}}</small>
          {{end}}
        </h4>
        {{if .Description}}
        <p>{{.Description}}</p>
        {{end}}
      </div>
      {{end}}
    </div>
    {{else}}
    <p class="text-muted">You have no repositories yet.</p>
    {{end}}
  </div>
</div>
{{else}}
<div class="row">
  <div class="col-md-12">
    <h2>{{.SiteName}} <span class="text-danger">compare</span></h2>
    <p>
      Compare two references — branches, tags or commits — of any git repository
      on this instance, and review the diff file by file.
    </p>
    <p>
      <a href="{{.LoginURL}}" rel="nofollow">Log in</a> to list your own
      repositories, or jump directly to any repository below.
    </p>
    <form method="GET" action="/jump" class="form-inline">
      <div class="form-group">
        <label class="sr-only" for="owner">Owner</label>
        <input class="form-control" type="text" id="owner" name="owner"
               placeholder="~owner" autocomplete="off">
      </div>
      <div class="form-group">
        <label class="sr-only" for="repo">Repository</label>
        <input class="form-control" type="text" id="repo" name="repo"
               placeholder="repo" autocomplete="off">
      </div>
      <button class="btn btn-primary" type="submit">Go</button>
    </form>
  </div>
</div>
{{end}}
{{end}}