Commit a0958013 authored by gijs's avatar gijs
Browse files

Merge branch 'master' of gitlab.constantvzw.org:osp/tools.gitlabculture

parents cb0a1198 8c4cbc55
public/
node_modules/
patternlab/dependencyGraph.json
......@@ -4,6 +4,8 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Contour</title>
<link rel="stylesheet" href="https://semestriel.framapad.org/p/9f7m-osp-website-css/export/txt" type="text/css" media="all" charset="utf-8">
<style>
.tree:before {
......@@ -208,5 +210,6 @@
</script>
<script type="text/javascript" charset="utf-8" src="pad.js"> </script>
</body>
</html>
var head = document.getElementsByTagName('head')[0];
// GETS CSS FROM FRAMAPAD
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
let css = document.createElement('style');
css.innerHTML = this.responseText;
head.appendChild(css);
}
};
xhttp.open("GET", "https://semestriel.framapad.org/p/9f7m-osp-website-css/export/txt", true);
xhttp.send();
{"version":1,"timestamp":1569336664708,"graph":{"options":{"directed":true,"multigraph":false,"compound":false},"nodes":[{"v":"03-templates/base.twig","value":{"compileState":"clean"}},{"v":"03-templates/repo.twig","value":{"compileState":"clean"}},{"v":"02-organisms/commit-list.twig","value":{"compileState":"clean"}}],"edges":[]}}
{"version":1,"timestamp":1569932110702,"graph":{"options":{"directed":true,"multigraph":false,"compound":false},"nodes":[{"v":"03-templates/base.twig","value":{"compileState":"clean"}},{"v":"03-templates/repo.twig","value":{"compileState":"clean"}},{"v":"02-organisms/commit-list.twig","value":{"compileState":"clean"}},{"v":"02-organisms/tree-list.twig","value":{"compileState":"clean"}}],"edges":[]}}
......@@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width" />
<link rel="stylesheet" href="../../css/style.css?{{ cacheBuster }}" media="all" />
<link rel="stylesheet" href="../../css/reset.css" media="all" />
<link rel="stylesheet" href="../../css/pattern-scaffolding.css?{{ cacheBuster }}" media="all" />
<!-- Begin Pattern Lab (Required for Pattern Lab to run properly) -->
......
<h2>Fonts in use</h2>
<link rel="stylesheet" media="screen" href="https://fontlibrary.org/face/notcouriersans" type="text/css"/>
<link rel="stylesheet" media="screen" href="https://fontlibrary.org/face/belgica-belgika" type="text/css"/>
<style>
.not-courier-sans { font-family: notcouriersans; }
.belgica-belgika { font-family: Belgika8th; }
</style>
<ul class="repo--fonts">
<li><input class="not-courier-sans" type="content-editable" placeholder="Not Courier Sans"</li>
<li><input class="belgica-belgika" type="content-editable" placeholder="Belgica-Belgika"</li>
</ul>
<h2>Read me</h2>
<div class="repo--readme">
<p>
Graphic design identity platform for the Contour Biennale 9: "Coltan as Cotton", that will take place in Mechelen (and beyond) from autumn 2018 until end of 2019.
</p>
</div>
<h2>Tree</h2>
<ul class="repo--tree">
{% for tree in trees %}
<li class="repo--folder--item">
{{ tree.name }}
</li>
{% endfor %}
</ul>
......@@ -15,5 +15,16 @@
"author": "Sarah Magnan",
"msg": "svg file of final versions"
}
},
"trees": {
"1": {
"name": "communication"
},
"2": {
"name": "fonts"
},
"3": {
"name": "iceberg"
}
}
}
......@@ -4,5 +4,10 @@
<h1>{{ title }}</h1>
{% include "@organisms/commit-list.twig" %}
{% include "@organisms/tree-list.twig" %}
{% include "@organisms/readme.twig" %}
{% include "@organisms/fonts.twig" %}
bla
{% endblock content %}
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
\ No newline at end of file
body {
background-color: pink;
background-color: yellow;
}
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>OSP works</title>
<link rel="stylesheet" href="https://semestriel.framapad.org/p/9f7m-osp-website-css/export/txt" type="text/css" media="all" charset="utf-8">
<style>
img {
max-width: 200px;
max-height: 200px;
}
</style>
</head>
<body>
<h1>Works</h1>
<div class="filters">
View through:
<ul>
<li><a href="#" id="filter-commit">Last update</a></li>
<li><a href="works-fonts.html" id="filter-fonts">Fonts</a></li>
<li><a href="#" id="filter-images">Images</a></li>
<li><a href="#" id="filter-readme">Description</a></li>
<li><a href="#" id="filter-tree">Diagram</a></li>
</ul>
</div>
<script type="text/javascript" charset="utf-8">
let body = document.querySelector('body');
var gitlab_url = "http://gitlab.constantvzw.org";
var user_name = "osp";
var repos = [351, 456, 508]
for (i=0; i < repos.length; i++) {
let repo = document.createElement('div'),
title = document.createElement('h2'),
commit = document.createElement('div');
repo.classList.add("repo");
title.classList.add("repo-title");
commit.classList.add('latest-commit');
repo.appendChild(title);
repo.appendChild(commit);
body.appendChild(repo);
getMetadata(i, repos[i], repo);
getLatestCommit(i, repos[i], repo);
}
// METADATA ///////////////////////////////
function getMetadata(i, repoID, repoElt) {
let repo_url = "https://gitlab.constantvzw.org/api/v4/projects/" + repoID;
fetch(repo_url)
.then(function(resp){
//console.log(resp);
//console.log(resp.json());
return resp.json();
})
.then(function(data){
let title = repoElt.querySelector('.repo-title');
name = data.name.split(".").slice(1);
title.innerHTML = name.replace(",", ".");
})
}
// COMMITS ///////////////////////////////
function getLatestCommit(i, repoID, repoElt){
let commits_elt = repoElt.querySelector('.latest-commit');
let commits_url = "https://gitlab.constantvzw.org/api/v4/projects/" + repoID + "/repository/commits?per_page=1";
fetch(commits_url)
.then(function(resp){
return resp.json();
})
.then(function(data){
return data.map(function(commit) {
let li = document.createElement('li'),
time = document.createElement('time'),
msg = document.createElement('p'),
author = document.createElement('p');
msg.classList.add("msg");
author.classList.add("author");
time.innerHTML = commit.created_at;
msg.innerHTML = commit.message;
author.innerHTML = commit.author_name;
li.appendChild(time);
li.appendChild(msg);
li.appendChild(author);
commits_elt.appendChild(li);
let commit_id = commit.id;
let commit_url = "https://gitlab.constantvzw.org/api/v4/projects/" + repoID + "/repository/commits/" + commit_id + "/diff";
fetch(commit_url)
.then(function(resp){
return resp.json();
})
.then(function(data2){
let filesNb = document.createElement('p');
filesNb.classList.add("files-number");
filesNb.innerHTML = data2.length + " changed files";
li.appendChild(filesNb);
})
})
})
//.catch(function(error) {
// console.log(JSON.stringify(error));
//});
}
// END COMMITS
</script>
<script type="text/javascript" charset="utf-8" src="pad.js"> </script>
</body>
</html>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>OSP works</title>
<link rel="stylesheet" href="https://semestriel.framapad.org/p/9f7m-osp-website-css/export/txt" type="text/css" media="all" charset="utf-8">
<style>
img {
max-width: 200px;
max-height: 200px;
}
.repo {
outline: 10px solid pink;
margin: 2em;
padding: 2em;
}
.font-folder {
outline: 10px solid blue;
margin: 2em;
padding: 2em;
}
.font-folder:empty {
display: none;
}
input {
font-size: 2em;
}
</style>
</head>
<body>
<h1>Works</h1>
<div class="filters">
View through:
<ul>
<li><a href="works-commit.html" id="filter-commit">Last update</a></li>
<li><a href="#" id="filter-fonts">Fonts</a></li>
<li><a href="#" id="filter-images">Images</a></li>
<li><a href="#" id="filter-readme">Description</a></li>
<li><a href="#" id="filter-tree">Diagram</a></li>
</ul>
</div>
<script type="text/javascript" charset="utf-8">
let body = document.querySelector('body');
var gitlab_url = "http://gitlab.constantvzw.org";
var user_name = "osp";
//var repos = [455, 456, 508, 536]
var repos = [455, 456, 508]
for (i=0; i < repos.length; i++) {
// CREATING DIV REPO
let repo = document.createElement('div'),
title_elt = document.createElement('h2');
repo.classList.add("repo");
title_elt.classList.add("repo-title");
repo.appendChild(title_elt);
body.appendChild(repo);
getFonts(i, repos[i], repo);
}
// GET ALL FONTS ///////////////////////////////
function getFonts(i, repoID, repoElt){
let repo_url = "https://gitlab.constantvzw.org/api/v4/projects/" + repoID;
let nb_fonts = 0;
fetch(repo_url)
.then(function(resp){
return resp.json();
})
.then(function(data){
// FETCH REPO TITLE
let title = repoElt.querySelector('.repo-title');
name = data.name.split(".").slice(1);
title.innerHTML = name.replace(",", ".");
})
// FETCH FONTS OF THE REPO
let fonts_url = "https://gitlab.constantvzw.org/api/v4/projects/" + repoID + "/repository/tree?path=fonts";
fetch(fonts_url)
.then(function(resp){
return resp.json();
})
.then(function(data){
return data.map(function(font) {
// REPO TITLE
let title = repoElt.querySelector('.repo-title:first-child').innerHTML;
getFontFolder(font, repoElt, title, repoID);
})
nbFonts = repoElt.querySelectorAll(".font");
console.log(nbFonts);
})
//.catch(function(error) {
// console.log(JSON.stringify(error));
//});
}
// END GET ALL FONTS
// GET FONT FOLDER
function getFontFolder(font, repoElt, title, repoID){
//var reg = new RegExp(/^[\w\/].*result\b/);
var reg = new RegExp('^(?!.*(ufo|OSX)$).*$');
if (font.type == "tree" && reg.test(font.name)) {
// CREATE FONT FOLDER ELEMENT
let font_folder_elt = document.createElement('div');
font_folder_elt.classList.add('font-folder');
repoElt.appendChild(font_folder_elt);
// FOLDER NAME
//foldername = document.createElement('h3');
//foldername.classList.add('font-name');
//foldername.innerHTML = font.name;
let fonts_url = "https://gitlab.constantvzw.org/api/v4/projects/" + repoID + "/repository/tree?path="+ font.path;
fetch(fonts_url)
.then(function(resp){
return resp.json();
})
.then(function(data){
return data.map(function(font) {
if (font.type == "tree" && reg.test(font.name)) {
getFontFolder(font, repoElt, title, repoID);
} else if (font.name.endsWith(".ttf") || font.name.endsWith(".otf")) {
font_elt.insertBefore(fontname, font_elt.childNodes[0]);
getFont(font, font_folder_elt, title);
}
})
})
} else if (font.name.endsWith(".ttf") || font.name.endsWith(".otf")) {
getFont(font, repoElt, title);
}
}
// END GET FONT FOLDER
// GET ONE FONT
function getFont(font, repoElt, title){
// CREATE FONT ELEMENT
font_elt = document.createElement('div');
font_elt.classList.add('font');
repoElt.appendChild(font_elt);
// FONT NAME
fontname = document.createElement('h4');
fontname.classList.add('font-name');
fontname.innerHTML = font.name;
font_elt.appendChild(fontname);
// FONT PATH
fontfile = font.path.split("/");
fontfile.shift();
var blob_url = 'http://osp.kitchen/api/osp.work.' + title + '/' + font.id + '/blob-data/' + font.path;
fontInput = document.createElement('input');
fontDl = document.createElement('a');
fontface = document.createElement('style');
fontInput.classList.add('font-input');
fontDl.classList.add('font-dl');
fontface.innerHTML = "@font-face { font-family: '" + font.name + "'; src: url('" + blob_url + "')}";
fontInput.value = font.name;
fontInput.style.fontFamily = '"' + font.name + '"';
fontDl.innerHTML = "Download font";
fontDl.setAttribute("href", blob_url);
font_elt.appendChild(fontface);
font_elt.appendChild(fontInput);
font_elt.appendChild(fontDl);
}
// END GET ONE FONT
</script>
<script type="text/javascript" charset="utf-8" src="pad.js"> </script>
</body>
</html>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>OSP works</title>
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
<style>
img {
max-width: 200px;
max-height: 200px;
float: left;
}
.archived {
background-color: gray;
}
.repo {
display: flex;
}
.iceberg, .processus {
width: 50%;
}
</style>
</head>
<body>
<h1>Works</h1>
<div class="filters">
View through:
<ul>
<li><a href="#" id="filter-commit">Last update</a></li>
<li><a href="works-fonts.html" id="filter-fonts">Fonts</a></li>
<li><a href="#" id="filter-images">Images</a></li>
<li><a href="#" id="filter-readme">Description</a></li>
<li><a href="#" id="filter-tree">Diagram</a></li>
</ul>
</div>
<script type="text/javascript" charset="utf-8">
let body = document.querySelector('body');
var gitlab_url = "http://gitlab.constantvzw.org";
var user_name = "osp";
var repos = [448, 456, 508]
for (i=0; i < repos.length; i++) {
let repo = document.createElement('div'),
title = document.createElement('h2'),
iceberg = document.createElement('div'),
processus = document.createElement('div');
iceberg_h3 = document.createElement('h3'),
processus_h3 = document.createElement('h3');
repo.classList.add("repo");
title.classList.add("repo-title");
iceberg.classList.add('iceberg');
processus.classList.add('processus');
iceberg_h3.innerHTML = "Iceberg";
processus_h3.innerHTML = "Processus";
repo.appendChild(title);
processus.appendChild(processus_h3);
repo.appendChild(processus);
iceberg.appendChild(iceberg_h3);
repo.appendChild(iceberg);
body.appendChild(repo);
getMetadata(i, repos[i], repo);
let processus_url = "https://gitlab.constantvzw.org/api/v4/projects/" + repos[i] + "/repository/tree?path=processus";
let iceberg_url = "https://gitlab.constantvzw.org/api/v4/projects/" + repos[i] + "/repository/tree?path=iceberg";
getImages(i, repos[i], repo, processus_url, processus);
getImages(i, repos[i], repo, iceberg_url, iceberg);
}
// METADATA ///////////////////////////////
function getMetadata(i, repoID, repoElt) {
let repo_url = "https://gitlab.constantvzw.org/api/v4/projects/" + repoID;
fetch(repo_url)
.then(function(resp){
//console.log(resp);
//console.log(resp.json());
return resp.json();
})
.then(function(data){
let title = repoElt.querySelector('.repo-title');
name = data.name.split(".").slice(1);
title.innerHTML = name.replace(",", ".");
if (data.default_branch == "archive"){
repoElt.classList.add("archived");
}
})
}
// COMMITS ///////////////////////////////
function getImages(i, repoID, repoElt, fetchURL, imageElt){
console.log(fetchURL);
fetch(fetchURL)
.then(function(resp){
return resp.json();
})
.then(function(data){
let title = repoElt.querySelector('.repo-title:first-child').innerHTML;
return data.map(function(image) {
let img = document.createElement('img'),
filename = document.createElement('p');
project_path = [gitlab_url, user_name, "work." + title].join('/');