refactor: move static sites into static, Remove unused PageController and update main.js for page navigation
This commit is contained in:
64
src/main/resources/static/add.html
Normal file
64
src/main/resources/static/add.html
Normal file
@@ -0,0 +1,64 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>DataDash – Add dataset/API</title>
|
||||
<link rel="stylesheet" href="add.css">
|
||||
<script type="module" src="add.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<header>
|
||||
<h1>Add new DataDash content</h1>
|
||||
</header>
|
||||
|
||||
<section>
|
||||
<p>
|
||||
Please add the following information about your dataset/API to
|
||||
help users better find it and understand what it is about and
|
||||
how to use it.
|
||||
</p>
|
||||
|
||||
<form>
|
||||
<span>
|
||||
<label for="title">Title</label>
|
||||
<input type="text" name="title" id="title" minlength="1" maxlength="50" required>
|
||||
</span>
|
||||
|
||||
<span id="author-box">
|
||||
<label for="author">Author</label>
|
||||
<input type="text" name="author" id="author" required>
|
||||
</span>
|
||||
|
||||
<label>
|
||||
Dataset
|
||||
<input type="checkbox" name="is-dataset" id="is-dataset">
|
||||
<span id="is-dataset-toggle"></span>
|
||||
API
|
||||
</label>
|
||||
|
||||
<span>
|
||||
<label for="short-description">Short description</label>
|
||||
<input type="text" name="short-description" id="short-description" maxlength="100" required spellcheck="true">
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<label for="url">URL</label>
|
||||
<input type="url" name="url" id="url" required>
|
||||
</span>
|
||||
|
||||
<span id="full-description-box">
|
||||
<label for="full-description">Full description</label>
|
||||
<textarea name="full-description" id="full-description" spellcheck="true"></textarea>
|
||||
</span>
|
||||
|
||||
<span id="btn-bar">
|
||||
<input type="submit" value="Add" id="btn-add" class="btn suggested" disabled>
|
||||
<input type="reset" value="Cancel" id="btn-cancel" class="btn">
|
||||
</span>
|
||||
</form>
|
||||
</section>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
156
src/main/resources/static/index.html
Normal file
156
src/main/resources/static/index.html
Normal file
@@ -0,0 +1,156 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>DataDash</title>
|
||||
<link rel="stylesheet" href="main.css">
|
||||
<script type="module" src="main.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="add-btn" title="Add a new API entry"></div>
|
||||
<main>
|
||||
<header>
|
||||
<h1>Welcome to DataDash</h1>
|
||||
<p>The place to launch and discover datasets and API endpoints.</p>
|
||||
</header>
|
||||
|
||||
<template id="dataset-template">
|
||||
<li class="dataset" data-id="id">
|
||||
<div class="dataset-info">
|
||||
<div class="details">
|
||||
<h3>title</h3>
|
||||
<p>Simply daily accountability phone call, powered by AI</p>
|
||||
</div>
|
||||
</div>
|
||||
<aside class="upvote">
|
||||
<button class="upvote-btn btn flat">Upvote</button>
|
||||
<span class="upvote-count">0</span>
|
||||
<button class="downvote-btn btn flat">Downvote</button>
|
||||
</aside>
|
||||
</li>
|
||||
</template>
|
||||
|
||||
<section id="tool-bar">
|
||||
<select id="sort-btn" class="btn flat" title="Sort entries">Sort by
|
||||
<option>Date newest-oldest</option>
|
||||
<option>Date oldest-newest</option>
|
||||
<option>Author A-Z</option>
|
||||
<option>Author Z-A</option>
|
||||
<option>Title A-Z</option>
|
||||
<option>Title Z-A</option>
|
||||
<option>Stars ↑</option>
|
||||
<option>Stars ↓</option>
|
||||
<option>Votes ↑</option>
|
||||
<option>Votes ↓</option>
|
||||
</select>
|
||||
<div class="divider"></div>
|
||||
<select class="btn flat" id="filter-btn" title="Filter entries">Filter
|
||||
<optgroup label="Standard categories">
|
||||
<option>Dataset</option>
|
||||
<option>API</option>
|
||||
</optgroup>
|
||||
<optgroup label="Other categories">
|
||||
<option>a category</option>
|
||||
</optgroup>
|
||||
</select>
|
||||
<input type="search" name="query" id="search-entry" placeholder="Search">
|
||||
<button class="btn flat" id="search-btn" title="Search entries">Search</button>
|
||||
</section>
|
||||
|
||||
<section id="recents">
|
||||
<h2>Recently added:</h2>
|
||||
<ul class="datasets">
|
||||
|
||||
<!-- Preliminary content to be replaced by data from our server: -->
|
||||
|
||||
<li class="dataset">
|
||||
<div class="dataset-info">
|
||||
<div class="icon tori"></div>
|
||||
<div class="details">
|
||||
<h3>Tori</h3>
|
||||
<p>The simple mobile crypto wallet even your grandparents can use</p>
|
||||
</div>
|
||||
</div>
|
||||
<aside class="upvote">
|
||||
<button class="upvote-btn btn flat">Upvote</button>
|
||||
<span class="upvote-count">0</span>
|
||||
<button class="downvote-btn btn flat">Downvote</button>
|
||||
</aside>
|
||||
</li>
|
||||
<li class="dataset">
|
||||
<div class="dataset-info">
|
||||
<div class="icon tyms"></div>
|
||||
<div class="details">
|
||||
<h3>Tyms</h3>
|
||||
<p>Modern accounting ERP for ambitious businesses</p>
|
||||
</div>
|
||||
</div>
|
||||
<aside class="upvote">
|
||||
<button class="upvote-btn btn flat">Upvote</button>
|
||||
<span class="upvote-count">0</span>
|
||||
<button class="downvote-btn btn flat">Downvote</button>
|
||||
</aside>
|
||||
</li>
|
||||
<li class="dataset">
|
||||
<div class="dataset-info">
|
||||
<div class="icon zapcardz"></div>
|
||||
<div class="details">
|
||||
<h3>ZapCardz</h3>
|
||||
<p>Remember what you learn forever with AI powered flashcards</p>
|
||||
</div>
|
||||
</div>
|
||||
<aside class="upvote">
|
||||
<button class="upvote-btn btn flat">Upvote</button>
|
||||
<span class="upvote-count">0</span>
|
||||
<button class="downvote-btn btn flat">Downvote</button>
|
||||
</aside>
|
||||
</li>
|
||||
<li class="dataset">
|
||||
<div class="dataset-info">
|
||||
<div class="icon peek"></div>
|
||||
<div class="details">
|
||||
<h3>Peek</h3>
|
||||
<p>AI organizer and workspace for your browser tabs</p>
|
||||
</div>
|
||||
</div>
|
||||
<aside class="upvote">
|
||||
<button class="upvote-btn btn flat">Upvote</button>
|
||||
<span class="upvote-count">0</span>
|
||||
<button class="downvote-btn btn flat">Downvote</button>
|
||||
</aside>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section id="top">
|
||||
<h2>Most Liked:</h2>
|
||||
<ul class="datasets">
|
||||
<li class="dataset">
|
||||
<div class="dataset-info">
|
||||
<div class="icon standup"></div>
|
||||
<div class="details">
|
||||
<h3>Standup</h3>
|
||||
<p>Simply daily accountability phone call, powered by AI</p>
|
||||
</div>
|
||||
</div>
|
||||
<aside class="upvote">
|
||||
<button class="upvote-btn btn flat">Upvote</button>
|
||||
<span class="upvote-count">0</span>
|
||||
<button class="downvote-btn btn flat">Downvote</button>
|
||||
</aside>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section id="search" class="hidden">
|
||||
<h2>Search results:</h2>
|
||||
<div id="nothing-found">
|
||||
<div id="nothing-found-bg"></div>
|
||||
<h3 id="nothing-found-text">Nothing found</h3>
|
||||
</div>
|
||||
<ul class="datasets">
|
||||
</ul>
|
||||
</section>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
@@ -81,8 +81,7 @@ for (const downvoteButton of downvoteButtons) {
|
||||
|
||||
// functions of the main page
|
||||
function navigateToAdd() {
|
||||
//TODO: url to add page not yet implemented, add here
|
||||
window.location.href = "/add";
|
||||
window.location.href = "/add.html";
|
||||
}
|
||||
|
||||
function filter(filterString) {
|
||||
|
||||
Reference in New Issue
Block a user