summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorRafael Marçalo <rafael.marcalo@cast.pt>2022-10-21 02:00:10 +0100
committerRafael Marçalo <rafael.marcalo@cast.pt>2022-10-21 02:00:10 +0100
commitdad891f9d7f060c5d2f4c9f47c410730aa48d5df (patch)
tree8d9bca113b426bb2dd6d5b9884a3ed6e84202f79 /views
Added initially developed files
Diffstat (limited to 'views')
-rw-r--r--views/index.ejs7
-rw-r--r--views/info.ejs5
-rw-r--r--views/partials/footer.ejs4
-rw-r--r--views/partials/header.ejs14
-rw-r--r--views/partials/top/head.ejs8
-rw-r--r--views/partials/top/navbar.ejs27
-rw-r--r--views/result.ejs42
-rw-r--r--views/settings.ejs5
8 files changed, 112 insertions, 0 deletions
diff --git a/views/index.ejs b/views/index.ejs
new file mode 100644
index 0000000..957395c
--- /dev/null
+++ b/views/index.ejs
@@ -0,0 +1,7 @@
+<%- include('partials/header'); %>
+
+<h1>Welcome to SneedBay</h1>
+
+<p>Making torrenting great again</p>
+
+<%- include('partials/footer'); %> \ No newline at end of file
diff --git a/views/info.ejs b/views/info.ejs
new file mode 100644
index 0000000..56a5649
--- /dev/null
+++ b/views/info.ejs
@@ -0,0 +1,5 @@
+<%- include('partials/header'); %>
+
+<h1>About</h1>
+
+<%- include('partials/footer'); %> \ No newline at end of file
diff --git a/views/partials/footer.ejs b/views/partials/footer.ejs
new file mode 100644
index 0000000..152328f
--- /dev/null
+++ b/views/partials/footer.ejs
@@ -0,0 +1,4 @@
+</main>
+
+</body>
+</html> \ No newline at end of file
diff --git a/views/partials/header.ejs b/views/partials/header.ejs
new file mode 100644
index 0000000..2df5cf3
--- /dev/null
+++ b/views/partials/header.ejs
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <%- include('top/head'); %>
+</head>
+
+<body>
+
+<navbar>
+ <%- include('top/navbar'); %>
+</navbar>
+
+<main class="container mt-4"> \ No newline at end of file
diff --git a/views/partials/top/head.ejs b/views/partials/top/head.ejs
new file mode 100644
index 0000000..beae843
--- /dev/null
+++ b/views/partials/top/head.ejs
@@ -0,0 +1,8 @@
+<meta charset="UTF-8">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<meta http-equiv="X-UA-Compatible" content="ie=edge">
+<meta name="description" content="sneedBay, piratebay indexer">
+<link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
+<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
+<script src="js/bootstrap.bundle.js"></script>
+<title>SNEEDBAY</title> \ No newline at end of file
diff --git a/views/partials/top/navbar.ejs b/views/partials/top/navbar.ejs
new file mode 100644
index 0000000..f5887ad
--- /dev/null
+++ b/views/partials/top/navbar.ejs
@@ -0,0 +1,27 @@
+<nav class="navbar bg-light">
+ <div class="container-fluid">
+ <a class="navbar-brand" href="/">
+ <img src="static/images/sneed.webp" alt="Logo" width="30" height="30" class="d-inline-block align-text-top">
+ SNEEDBAY
+ </a>
+ <div class="align-items-center d-flex justify-content-between gap-3">
+ <a href="/info" class="link-dark">
+ <svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" fill="currentColor" viewBox="0 0 16 16">
+ <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z" />
+ <path d="m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z" />
+ </svg>
+ </a>
+
+ <a href="/settings" class="link-dark">
+ <svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" fill="currentColor" viewBox="0 0 16 16">
+ <path d="M7.068.727c.243-.97 1.62-.97 1.864 0l.071.286a.96.96 0 0 0 1.622.434l.205-.211c.695-.719 1.888-.03 1.613.931l-.08.284a.96.96 0 0 0 1.187 1.187l.283-.081c.96-.275 1.65.918.931 1.613l-.211.205a.96.96 0 0 0 .434 1.622l.286.071c.97.243.97 1.62 0 1.864l-.286.071a.96.96 0 0 0-.434 1.622l.211.205c.719.695.03 1.888-.931 1.613l-.284-.08a.96.96 0 0 0-1.187 1.187l.081.283c.275.96-.918 1.65-1.613.931l-.205-.211a.96.96 0 0 0-1.622.434l-.071.286c-.243.97-1.62.97-1.864 0l-.071-.286a.96.96 0 0 0-1.622-.434l-.205.211c-.695.719-1.888.03-1.613-.931l.08-.284a.96.96 0 0 0-1.186-1.187l-.284.081c-.96.275-1.65-.918-.931-1.613l.211-.205a.96.96 0 0 0-.434-1.622l-.286-.071c-.97-.243-.97-1.62 0-1.864l.286-.071a.96.96 0 0 0 .434-1.622l-.211-.205c-.719-.695-.03-1.888.931-1.613l.284.08a.96.96 0 0 0 1.187-1.186l-.081-.284c-.275-.96.918-1.65 1.613-.931l.205.211a.96.96 0 0 0 1.622-.434l.071-.286zM12.973 8.5H8.25l-2.834 3.779A4.998 4.998 0 0 0 12.973 8.5zm0-1a4.998 4.998 0 0 0-7.557-3.779l2.834 3.78h4.723zM5.048 3.967c-.03.021-.058.043-.087.065l.087-.065zm-.431.355A4.984 4.984 0 0 0 3.002 8c0 1.455.622 2.765 1.615 3.678L7.375 8 4.617 4.322zm.344 7.646.087.065-.087-.065z" />
+ </svg>
+ </a>
+
+ <form class="d-flex" action="search" method="POST">
+ <input class="form-control me-2" id="search" name="search" placeholder="Search Torrent" aria-label="Search Torrent">
+ <button class="btn btn-outline-success" type="submit">Search</button>
+ </form>
+ </div>
+ </div>
+</nav> \ No newline at end of file
diff --git a/views/result.ejs b/views/result.ejs
new file mode 100644
index 0000000..7732521
--- /dev/null
+++ b/views/result.ejs
@@ -0,0 +1,42 @@
+<%- include('partials/header'); %>
+
+<h1>Results for: <%= query %></h1>
+
+ <% if (results) { %>
+ <table class="table table-striped table-hover table-responsive text-center">
+ <thead>
+ <tr>
+ <th scope="col">Name</th>
+ <th scope="col">Category</th>
+ <th scope="col">Magnet Link</th>
+ <th scope="col">Files</th>
+ <th scope="col">Size</th>
+ <th scope="col">Date</th>
+ <th scope="col">Seeders</th>
+ <th scope="col">Leechers</th>
+ </tr>
+ </thead>
+ <tbody class="table-group-divider">
+ <% results.data.forEach(result => { %>
+ <tr>
+ <td class="text-start"><%= result.name %></td>
+ <td><%= functions.getCategory(parseInt(result.category)) %></td>
+ <td>
+ <a class="link-dark" href=<%= functions.makeMagnet(result.info_hash, result.name) %>>
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-magnet-fill" viewBox="0 0 16 16">
+ <path d="M15 12h-4v3h4v-3ZM5 12H1v3h4v-3ZM0 8a8 8 0 1 1 16 0v8h-6V8a2 2 0 1 0-4 0v8H0V8Z"/>
+ </svg>
+ </a>
+ </td>
+ <td><%= result.num_files %></td>
+ <td><%= functions.bytesToSize(result.size) %></td>
+ <td><%= functions.getDate(result.added) %></td>
+ <td><%= result.seeders %></td>
+ <td><%= result.leechers %></td>
+ </tr>
+ <% }); %>
+ </tbody>
+ </table>
+ <% } %>
+
+<%- include('partials/footer'); %> \ No newline at end of file
diff --git a/views/settings.ejs b/views/settings.ejs
new file mode 100644
index 0000000..1a79db9
--- /dev/null
+++ b/views/settings.ejs
@@ -0,0 +1,5 @@
+<%- include('partials/header'); %>
+
+<h1>Settings</h1>
+
+<%- include('partials/footer'); %> \ No newline at end of file