gostart/templates/main.html

172 lines
5.3 KiB
HTML
Raw Normal View History

2022-11-29 19:55:00 -07:00
<html lang="en">
<head>
<style>
2022-12-02 20:53:05 -07:00
.icon {
cursor: pointer;
2022-11-29 19:55:00 -07:00
padding: 10px;
margin: 10px;
2022-12-02 20:53:05 -07:00
width: 100px;
height: 100px;
2022-11-29 19:55:00 -07:00
border-radius: 10px;
border: 1px solid black;
list-style-type: none;
text-align: center;
}
2022-12-02 20:53:05 -07:00
.icon img {
2022-11-29 19:55:00 -07:00
width: 50px;
hight: 50px;
}
2022-11-29 20:47:23 -07:00
2022-12-02 20:53:05 -07:00
.grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 5px;
}
.col {
border: 1px solid black;
border-radius: 10px;
}
.icon-grid {
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: 3px;
}
header {
padding: 0px !important;
}
main {
padding: 5px !important;
}
2022-12-04 19:03:59 -07:00
ul li span {
cursor: pointer;
}
2022-11-29 19:55:00 -07:00
</style>
<title>{{.Title}}::{{.Node.ComputedName}}</title>
</head>
<body>
<header>
<h1>{{.Title}} for {{.Node.ComputedName}}</h1>
2022-12-02 20:53:05 -07:00
Remaining queries: {{.CurrentLimits.Remaining}}
</header>
<main>
2022-12-02 20:53:05 -07:00
<div class="grid">
<div class="col">
{{ $len := len .PullRequests }}{{if ne $len 0}}
<h3>Pull Requests</h3>
<ul>
2022-12-02 20:53:05 -07:00
{{range .PullRequests}}
<li>{{.Repo}} {{.Number}} ( {{.ID}} )</li>
{{end}}
</ul>
2022-12-02 20:53:05 -07:00
{{end}}
</div>
<div class="col">
{{ $len := len .Watches }}{{if ne $len 0}}
<h3>Watch Items</h3>
<ul class="">
{{range .Watches}}
<li><b>{{.Repo}} :: {{.Name}}</b>
<ul>
{{range .Data.Search.Edges}}
2022-12-04 19:03:59 -07:00
{{if includeWatch .Node.Repository.NameWithOwner .Node.Number $.Ignores}}
<li>
<b>
<a href="{{.Node.URL}}">{{.Node.Number}}</a>
</b> ::
<span></span>
<span onclick="addIgnore({{.Node.Number}}, '{{.Node.Repository.NameWithOwner}}')"></span> ::
2022-12-02 20:53:05 -07:00
{{.Node.Title}}
</li>
{{end}}
2022-12-04 19:03:59 -07:00
{{end}}
2022-12-02 20:53:05 -07:00
</ul>
</li>
{{end}}
</ul>
{{end}}
</div>
<div class="col">
{{ $len := len .Links }}{{if ne $len 0}}
<div class="icon-grid">
{{range .Links}}
<div>
<a href="{{.Url}}">
<div class="icon">
<header>
2022-12-04 19:03:59 -07:00
<!-- TODO: make this not ghetto -->
2022-12-02 20:53:05 -07:00
<img src="/icons/{{.ID}}"/>
</header>
{{.Name}}
</div>
</a>
</div>
{{end}}
</div>
{{end}}
</div>
</div>
</main>
2022-12-02 20:53:05 -07:00
<footer>
<div>
<details>
<summary>Add Link</summary>
<div class="icon-grid">
<label for="name">
Link Name
<input id="linkname" type="text" name="name" required>
</label>
<label for="url">
URL
<input id="linkurl" type="text" name="url" placeholder="https://..." required>
</label>
<label for="logourl">
Logo URL
<input id="logourl" type="text" name="logourl" placeholder="https://..." required>
</label>
</div>
<button onclick="sendLinkData(); return false;">Add</button>
</details>
<details>
<summary>Add Watch Item</summary>
<div class="icon-grid">
<label for="watchname">
Name to watch for
<input id="watchname" type="text" name="name" required>
</label>
<label for="watchrepo">
Repository
<input id="watchrepo" type="text" name="repo" placeholder="NixOS/nixpkgs" required>
</label>
</div>
<button onclick="sendWatchData(); return false;">Add</button>
</details>
<details>
<summary>Add Pull Request</summary>
<div class="icon-grid">
<label for="number">
Number
<input id="number" type="text" name="number" required>
</label>
<label for="watchrepo">
Repository
<input id="repo" type="text" name="repo" placeholder="NixOS/nixpkgs" required>
</label>
<label for="descr">
Description
<input id="descr" type="text" name="descr" placeholder="..." required>
</label>
</div>
<button onclick="sendPRData(); return false;">Add</button>
</details>
</div>
</footer>
<script src="assets/main.js" type="application/javascript"></script>
2022-11-29 19:55:00 -07:00
</body>
</html>