Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
osp
tools.gitlabculture
Commits
8665b6ae
Commit
8665b6ae
authored
Mar 06, 2020
by
svilayphiou
Browse files
iceberg is working yay
parent
afe41217
Changes
1
Show whitespace changes
Inline
Side-by-side
generator/templates/project.html
View file @
8665b6ae
...
...
@@ -31,7 +31,7 @@
</section>
<section
id=
"iceberg"
class=
"repo-views"
>
<h3>
Iceberg
</h3>
<div
v-for=
"image in
repo.
iceberg"
>
<div
v-for=
"image in iceberg"
>
<img
v-bind:src=
"image.src"
>
</div>
</section>
...
...
@@ -63,38 +63,19 @@
<script
type=
"text/javascript"
charset=
"utf-8"
>
var
gitlab_url
=
"
http://gitlab.constantvzw.org
"
;
var
user_name
=
"
osp
"
;
var
repoID
=
{{
project
.
id
}}
var
repo
=
{}
var
repoID
=
{{
project
.
id
}}
;
var
iceberg
=
[];
getMetadata
(
repoID
);
getIceberg
(
repoID
);
var
repos
App
=
new
Vue
({
el
:
'
#
repo
'
,
var
iceberg
App
=
new
Vue
({
el
:
'
#
iceberg
'
,
data
:
{
repo
iceberg
}
})
// METADATA ///////////////////////////////
function
getMetadata
(
repoID
)
{
let
repo_url
=
"
https://gitlab.constantvzw.org/api/v4/projects/
"
+
repoID
;
fetch
(
repo_url
).
then
(
function
(
resp
){
return
resp
.
json
();
})
.
then
(
function
(
data
){
name
=
data
.
name
.
split
(
"
.
"
).
slice
(
1
);
repo
.
id
=
repoID
;
repo
.
repo
=
data
.
name
;
repo
.
name
=
name
.
replace
(
"
,
"
,
"
"
);
repo
.
iceberg
=
[];
if
(
data
.
default_branch
==
"
archive
"
){
repo
.
archived
=
"
archived
"
;
}
})
}
function
getIceberg
(
repoID
){
let
icebergURL
=
"
https://gitlab.constantvzw.org/api/v4/projects/
"
+
repoID
+
"
/repository/tree?path=iceberg
"
;
...
...
@@ -103,10 +84,9 @@
return
data
.
map
(
function
(
image
)
{
item
=
{};
item
.
name
=
image
.
name
;
project_path
=
[
gitlab_url
,
user_name
,
repo
.
repo
].
join
(
'
/
'
);
if
(
repo
.
archived
){
branch
=
"
archive
"
;}
else
{
branch
=
"
master
"
}
item
.
src
=
project_path
+
"
/raw/
"
+
branch
+
"
/
"
+
image
.
path
;
repo
.
iceberg
.
push
(
item
);
project_path
=
[
gitlab_url
,
user_name
,
"
{{ project.name }}
"
].
join
(
'
/
'
);
item
.
src
=
project_path
+
"
/raw/{{ project.default_branch }}/
"
+
image
.
path
;
iceberg
.
push
(
item
);
})
});
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment