aboutsummaryrefslogtreecommitdiff
blob: 3a364eb4ba49ec90039ec7116a7a0b915308d395 (plain)
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
{{define "changelog"}}
<div class="row">
    <div class="col-md-9">
        {{ $commits := (index .Packages 0).Commits}}
        {{ range $key, $value := .Packages}}
            {{if ne $key 0}}
                {{$commits = appendCommits $commits $value.Commits}}
            {{end}}
        {{end}}

        {{ if $commits }}

            <div class="col-md-12">
                <h3>Latest Commits</h3>
                <ul class="timeline">
                    <li>
                        <span class="text-muted">Commits on Jul 2, 2020</span>
                        <ul class="list-group">
                            {{$last_date := (index $commits 0).CommitterDate}}
                            {{range $commits}}
                            {{if eq ($last_date.Format "Jan 02, 2006") (.CommitterDate.Format "Jan 02, 2006")}}
                            <li class="list-group-item">
                                <div class="row">
                                    <div class="col-md-8"><b style="color:#424242!important;">{{.Message}}</b></div><div class="col-md-4 text-right text-muted"><a title="{{.Id}}" class="kk-commit" href="https://gitweb.gentoo.org/repo/gentoo.git/commit/?id={{.Id}}">{{ printf "%.7s" .Id }}</a></div>
                                    <div class="col-md-12" style="color:#424242!important;">
                                        {{ if (ne .AuthorName .CommitterName)}}
                                            <span data-toggle="tooltip" title="authored on {{ .AuthorDate }}"><img class="rounded-sm inline" data-toggle="popover" data-img="http://placehold.it/400x200" src="{{ gravatar .AuthorEmail}}">
                                    <a href="mailto:{{ .AuthorEmail }}">{{ .AuthorName }}</a> authored</span> and&nbsp;
                                        {{end}}
                                        <img class="rounded-sm inline" src="{{ gravatar .CommitterEmail}}">
                                        <a href="mailto:{{ .CommitterEmail }}">{{ .CommitterName }}</a> committed on {{ .CommitterDate.Format "2 Jan 2006 15:04:05" }}
                                    </div>
                                    <div class="col-md-12">
                                        {{$commit := .}}
                                        {{range $key, $value := .ChangedFiles.Added }}
                                            {{if le $key 100}}
                                            <style>
                                                .kk-added-file-badge {
                                                    background-color: #dff0d8;
                                                    font-weight: normal;
                                                }
                                                .kk-added-file-badge > a {
                                                    color: #424242!important;
                                                }
                                            </style>
                                            <span class="badge badge-pill kk-added-file-badge badge-light"><a class="text-muted" href="https://gitweb.gentoo.org/repo/gentoo.git/diff/{{ .Path }}?id={{ $commit.Id }}">{{ .Path }}</a></span>
                                            {{end}}
                                        {{end}}
                                        {{range $key, $value := .ChangedFiles.Modified }}
                                            {{if le $key 100}}
                                                <style>
                                                    .kk-modified-file-badge {
                                                        background-color: #fcf8e3;
                                                        font-weight: normal;
                                                    }
                                                    .kk-modified-file-badge > a {
                                                        color: #424242!important;
                                                    }
                                                </style>
                                                <span class="badge badge-pill kk-modified-file-badge badge-light"><a class="text-muted" href="https://gitweb.gentoo.org/repo/gentoo.git/diff/{{ .Path }}?id={{ $commit.Id }}">{{ .Path }}</a></span>
                                            {{end}}
                                        {{end}}
                                        {{range $key, $value := .ChangedFiles.Deleted }}
                                            {{if le $key 100}}
                                                <style>
                                                    .kk-deleted-file-badge {
                                                        background-color: #f2dede;
                                                        font-weight: normal;
                                                    }
                                                    .kk-deleted-file-badge > a {
                                                        color: #424242!important;
                                                    }
                                                </style>
                                                <span class="badge badge-pill kk-deleted-file-badge badge-light"><a class="text-muted" href="https://gitweb.gentoo.org/repo/gentoo.git/diff/{{ .Path }}?id={{ $commit.Id }}">{{ .Path }}</a></span>
                                            {{end}}
                                        {{end}}
                                    </div>
                                </div>
                            </li>
                            {{else}}
                        </ul>
                    </li>
                    <li>
                        <span class="text-muted">Commits on {{.CommitterDate.Format "Jan 02, 2006"}}</span>
                        <ul class="list-group">
                            <li class="list-group-item">
                                <div class="row">
                                    <div class="col-md-8"><b>{{.Message}}</b></div><div class="col-md-4 text-right text-muted"><a title="{{.Id}}" class="kk-commit" href="https://gitweb.gentoo.org/repo/gentoo.git/commit/?id={{.Id}}">{{ printf "%.7s" .Id }}</a></div>
                                    <div class="col-md-12">
                                        {{ if (ne .AuthorName .CommitterName)}}
                                            <span data-toggle="tooltip" title="authored on {{ .AuthorDate }}"><img class="rounded-sm inline" data-toggle="popover" data-img="http://placehold.it/400x200" src="{{ gravatar .AuthorEmail}}">
                                    <a href="mailto:{{ .AuthorEmail }}">{{ .AuthorName }}</a> authored</span> and&nbsp;
                                        {{end}}
                                        <img class="rounded-sm inline" src="{{ gravatar .CommitterEmail}}">
                                        <a href="mailto:{{ .CommitterEmail }}">{{ .CommitterName }}</a> committed on {{ .CommitterDate.Format "2 Jan 2006 15:04:05" }}
                                    </div>
                                    <div class="col-md-12">
                                        {{$commit := .}}
                                        {{range $key, $value := .ChangedFiles.Added }}
                                            {{if le $key 100}}
                                                <style>
                                                    .kk-added-file-badge {
                                                        background-color: #dff0d8;
                                                        font-weight: normal;
                                                    }
                                                    .kk-added-file-badge > a {
                                                        color: #424242!important;
                                                    }
                                                </style>
                                                <span class="badge badge-pill kk-added-file-badge badge-light"><a title="{{ .Path }} has been added" class="text-muted" href="https://gitweb.gentoo.org/repo/gentoo.git/diff/{{ .Path }}?id={{ $commit.Id }}">{{ .Path }}</a></span>
                                            {{end}}
                                        {{end}}
                                        {{range $key, $value := .ChangedFiles.Modified }}
                                            {{if le $key 100}}
                                                    <style>
                                                        .kk-modified-file-badge {
                                                            background-color: #fcf8e3;
                                                            font-weight: normal;
                                                        }
                                                        .kk-modified-file-badge > a {
                                                            color: #424242!important;
                                                        }
                                                    </style>
                                                    <span class="badge badge-pill kk-modified-file-badge badge-light"><a title="{{ .Path }} has been modified" class="text-muted" href="https://gitweb.gentoo.org/repo/gentoo.git/diff/{{ .Path}}?id={{ $commit.Id }}">{{ .Path }}</a></span>
                                            {{end}}
                                        {{end}}
                                        {{range $key, $value := .ChangedFiles.Deleted }}
                                            {{if le $key 100}}
                                                <style>
                                                    .kk-deleted-file-badge {
                                                        background-color: #f2dede;
                                                        font-weight: normal;
                                                    }
                                                    .kk-deleted-file-badge > a {
                                                        color: #424242!important;
                                                    }
                                                </style>
                                                <span class="badge badge-pill kk-deleted-file-badge badge-light"><a title="{{ .Path }} has been deleted" class="text-muted" href="https://gitweb.gentoo.org/repo/gentoo.git/diff/{{ .Path }}?id={{ $commit.Id }}">{{ .Path }}</a></span>
                                            {{end}}
                                        {{end}}
                                        {{if gt (len .ChangedFiles.Added) 100}}
                                            <a href="https://gitweb.gentoo.org/repo/gentoo.git/commit/?id={{.Id}}" class="text-muted">...</a>
                                        {{else if gt (len .ChangedFiles.Modified) 100}}
                                            <a href="https://gitweb.gentoo.org/repo/gentoo.git/commit/?id={{.Id}}" class="text-muted">...</a>
                                        {{else if gt (len .ChangedFiles.Deleted) 100}}
                                            <a href="https://gitweb.gentoo.org/repo/gentoo.git/commit/?id={{.Id}}" class="text-muted">...</a>
                                        {{end}}
                                    </div>
                                </div>
                            </li>
                            {{end}}
                            {{$last_date = .CommitterDate}}
                            {{end}}
                        </ul>
                    </li>
                </ul>
            </div>

        {{else}}
            <li class="list-group-item kk-panel-content-sorry">
                This package has not been changed since our repository has moved to Git.
                <br><br>
                <a href="https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/<%= @package.atom %>/ChangeLog?view=markup" class="btn btn-default">
                    <span class="fa fa-fw fa-history"></span>
                    View old CVS Changelog
                </a>
            </li>
        {{end}}
    </div>
</div>
{{end}}