Commit 4ce8816d authored by Ivanq's avatar Ivanq

Add 'Repository Index' page

parent 244a2b2f
......@@ -42,4 +42,7 @@
}
.header-item:hover {
color: #DDD;
}
.header-item-active, .header-item-active:hover {
color: #FFF;
}
\ No newline at end of file
.repo {
display: block;
margin-top: 16px;
padding: 3px 10px 3px 8px;
border: 1px solid #D5D5D5;
border-radius: 4px;
cursor: pointer;
box-shadow: 0 4px 4px #DDD;
background-image: linear-gradient(to bottom, #FCFCFC 0%, #EEE 100%);
background-repeat: no-repeat;
font-size: 16px;
line-height: 24px;
text-decoration: none;
}
.repo-title {
font-size: 24px;
line-height: 32px;
}
.repo-address {
color: #888;
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>Repository Index - Git Center</title>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<base href="" target="_top" id="base">
<script>base.href = document.location.href.replace("/media", "").replace("index.html", "").replace(/[&?]wrapper=False/, "").replace(/[&?]wrapper_nonce=[A-Za-z0-9]+/, "")</script>
<link rel="stylesheet" type="text/css" href="../css/main.css">
<link rel="stylesheet" type="text/css" href="../css/buttons.css">
<link rel="stylesheet" type="text/css" href="../css/header.css">
<link rel="stylesheet" type="text/css" href="../css/content.css">
<link rel="stylesheet" type="text/css" href="css/repo.css">
</head>
<body>
<header class="header">
<a href="..">
<img src="../img/logo-white.svg" class="header-logo">
<div class="header-name">Git Center</div>
</a>
<a href=".">
<div class="header-item header-item-active">Repository Index</div>
</a>
</header>
<main class="content">
<h1>Repository Index</h1>
<div id="repos"></div>
</main>
<script type="text/javascript" src="../js/ZeroFrame.js"></script>
<script type="text/javascript" src="../js/ZeroPage.js"></script>
<script type="text/javascript" src="../js/ZeroFS.js"></script>
<script type="text/javascript" src="../js/ZeroDB.js"></script>
<script type="text/javascript" src="js/main.js"></script>
</body>
</html>
\ No newline at end of file
let zeroFrame = new ZeroFrame();
let zeroPage = new ZeroPage(zeroFrame);
let zeroDB = new ZeroDB(zeroPage);
zeroDB.query("SELECT repo_index.*, json.cert_user_id FROM repo_index, json WHERE repo_index.json_id = json.json_id")
.then(index => {
index.forEach(repo => {
let node = document.createElement("div");
node.className = "repo";
let title = document.createElement("div");
title.className = "repo-title";
title.textContent = repo.address;
node.appendChild(title);
let address = document.createElement("div");
address.className = "repo-address";
address.textContent = repo.address;
node.appendChild(address);
document.getElementById("repos").appendChild(node);
});
});
/*
<div class="repo">
<div class="repo-title">Git Center Source</div>
<div class="repo-address">1RepoXU8bQE9m7ssNwL4nnxBnZVejHCc6</div>
</div>
*/
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment