Commit dd12125a authored by svilayphiou's avatar svilayphiou
Browse files

Added processus images.

See balsamine.2018-2019 as an example.
parent a69021b6
......@@ -21,10 +21,19 @@
{{ project.readme }}
</section>
{% endif %}
<section id="iceberg" class="repo-views">
<h3>Iceberg</h3>
<div v-for="image in iceberg">
<img v-bind:src="image.src">
<section id="images" class="repo-views">
<div id="iceberg">
<h3>Iceberg</h3>
<div v-for="image in icebergList">
<img v-bind:src="image.src">
</div>
</div>
<div id="processus">
<h3>processus</h3>
<div v-for="image in processusList">
<img v-bind:src="image.src">
</div>
</div>
</section>
<section id="tree" class="repo-views">
......@@ -63,29 +72,39 @@
var gitlab_url = "http://gitlab.constantvzw.org";
var user_name = "osp";
var repoID = {{ project.id }};
var iceberg = [];
var icebergList = [];
var processusList = [];
let icebergURL = "https://gitlab.constantvzw.org/api/v4/projects/" + repoID + "/repository/tree?path=iceberg";
let processusURL = "https://gitlab.constantvzw.org/api/v4/projects/" + repoID + "/repository/tree?path=processus";
getIceberg(repoID);
getImages(repoID, icebergURL, icebergList);
getImages(repoID, processusURL, processusList);
var icebergApp = new Vue({
el: '#iceberg',
data: {
iceberg
icebergList
}
})
var processusApp = new Vue({
el: '#processus',
data: {
processusList
}
})
})
function getIceberg(repoID){
let icebergURL = "https://gitlab.constantvzw.org/api/v4/projects/" + repoID + "/repository/tree?path=iceberg";
fetch(icebergURL).then(function(resp){ return resp.json(); })
function getImages(repoID, apiURL, imageList){
fetch(apiURL).then(function(resp){ return resp.json(); })
.then(function(data){
return data.map(function(image) {
item = {};
item.name = image.name;
project_path = [gitlab_url, user_name, "{{ project.name }}"].join('/');
item.src = project_path + "/raw/{{ project.default_branch }}/" + image.path;
iceberg.push(item);
imageList.push(item);
})
});
}
......
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