aboutsummaryrefslogtreecommitdiff
blob: 606345204a546174c7e9b885fa9af8d1a9cbafc0 (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
package arches

import "net/http"
import "soko/pkg/app/layout"
import "soko/pkg/app/utils"
import "soko/pkg/models"

templ changedVersions(currentArch string, feedName string, versions []*models.Version) {
	<div class="container mb-5">
		<div class="row">
			<div class="col-11">
				if feedName == "keyworded" {
					<h3>
						<a class="text-dark"><i class="fa fa-circle-o" aria-hidden="true"></i> Keyworded Packages</a>
						<a href={ templ.URL("/arches/" + currentArch + "/stable") } class="ml-3 text-muted"><i class="fa fa-check-circle-o" aria-hidden="true"></i> Newly Stable Packages</a>
					</h3>
				} else {
					<h3>
						<a href={ templ.URL("/arches/" + currentArch + "/keyworded") } class="text-muted"><i class="fa fa-circle-o" aria-hidden="true"></i> Keyworded Packages</a>
						<a class="ml-3 text-dark"><i class="fa fa-check-circle-o" aria-hidden="true"></i> Newly Stable Packages</a>
					</h3>
				}
			</div>
			<div class="col-1 text-right">
				<h3>
					<a title="Atom feed" href={ templ.URL("/arches/" + currentArch + "/" + feedName + ".atom") } class="kk-feed-icon"><span class="fa fa-fw fa-rss-square"></span></a>
				</h3>
			</div>
			<div class="col-12">
				<li class="list-group">
					@utils.ChangedVersionsTable(versions)
				</li>
			</div>
		</div>
	</div>
}

var tabs []layout.SubTab

func init() {
	tabs = make([]layout.SubTab, len(models.AllArches))
	for i, arch := range models.AllArches {
		tabs[i] = layout.SubTab{Name: arch, Link: templ.URL("/arches/" + arch + "/keyworded")}
	}
}

func renderPage(w http.ResponseWriter, r *http.Request, arch string, content templ.Component) {
	layout.TabbedLayout("Architectures", layout.Arches, "Architectures", "fa fa-fw fa-server", "", tabs, arch, content).Render(r.Context(), w)
}