Commit 42605541 authored by svilayphiou's avatar svilayphiou
Browse files

added folder browsing

parent f96b035a
......@@ -3,7 +3,7 @@
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Commits</title>
<title>Contour</title>
<style>
.tree:before {
......@@ -57,8 +57,14 @@
// BEGIN TREE
var this_url = new URL(window.location.href);
var path = this_url.searchParams.get("path");
const tree_elt = document.querySelector('#tree');
const tree_url = "https://gitlab.constantvzw.org/api/v4/projects/456/repository/tree";
if(path == null) {
var tree_url = "https://gitlab.constantvzw.org/api/v4/projects/456/repository/tree";
} else {
var tree_url = "https://gitlab.constantvzw.org/api/v4/projects/456/repository/tree?path=" + path;
}
var README = "";
fetch(tree_url)
......@@ -67,7 +73,7 @@
return data.map(function(file) {
let li = document.createElement('li');
li.classList.add(file.type);
li.innerHTML = file.name;
li.innerHTML = "<a href='?path=" + file.path + "' >" + file.name + "</a>";
tree_elt.appendChild(li);
// README
......@@ -103,7 +109,7 @@
console.log(JSON.stringify(error));
});
// END TREE
//
// BEGIN COMMITS
let commits_url = "https://gitlab.constantvzw.org/api/v4/projects/456/repository/commits?per_page=100";
let page = 1;
......
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