aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/layout.eta2
-rw-r--r--views/pulls.eta15
2 files changed, 17 insertions, 0 deletions
diff --git a/views/layout.eta b/views/layout.eta
index f31c6e0..85f431c 100644
--- a/views/layout.eta
+++ b/views/layout.eta
@@ -14,6 +14,7 @@ git clone git@github.com:<%= it.repo.owner %>/<%= it.repo.name %>.git</code></pr
<nav>
<a href="/<%= it.repo.owner %>/<%= it.repo.name %>">Code</a>
<a href="/<%= it.repo.owner %>/<%= it.repo.name %>/issues">Issues</a>
+ <a href="/<%= it.repo.owner %>/<%= it.repo.name %>/pulls">Pull requests</a>
<a href="/<%= it.repo.owner %>/<%= it.repo.name %>/releases">Releases</a>
<% if (it.branch) { %>
<a href="/<%= it.repo.owner %>/<%= it.repo.name %>/commits/<%= it.branch %><%= it.path && it.path !== '/' ? '/' + it.path : '' %>">Commits</a>
@@ -23,6 +24,7 @@ git clone git@github.com:<%= it.repo.owner %>/<%= it.repo.name %>.git</code></pr
<input type="text" name="q" placeholder="Search…" value="<%= it.q ?? "" %>">
<select name="type">
<option value="issues" <%= it.searchType === "issues" ? "selected" : "" %>>Issues</option>
+ <option value="pullrequests" <%= it.searchType === "pullrequests" ? "selected" : "" %>>Pull requests</option>
<option value="code" <%= it.searchType === "code" || it.searchType == null ? "selected" : "" %>>Code</option>
</select>
<button type="submit">Search</button>
diff --git a/views/pulls.eta b/views/pulls.eta
new file mode 100644
index 0000000..9ec5ca1
--- /dev/null
+++ b/views/pulls.eta
@@ -0,0 +1,15 @@
+<% layout("./layout"); it.searchType = "pullrequests" %>
+
+<table>
+ <% for (const pull of it.pulls) { %>
+ <tr>
+ <td>#<%= pull.number %></td>
+ <td>
+ <a href="/<%= it.repo.owner %>/<%= it.repo.name %>/pull/<%= pull.number %>">
+ <%= pull.title %>
+ </a>
+ </td>
+ <td class="timestamp"><time title="<%= pull.createdAt %>"><%= pull.createdAt.split("T")[0] %></time></td>
+ </tr>
+ <% } %>
+</table>