Skip to content

Commit

Permalink
✨ : add module description page
Browse files Browse the repository at this point in the history
  • Loading branch information
cdubuisson committed Aug 1, 2019
1 parent 52065e0 commit 58735ee
Show file tree
Hide file tree
Showing 4 changed files with 195 additions and 0 deletions.
58 changes: 58 additions & 0 deletions src/main/resources/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
26. Error
27. Map
28. Custom style for stack logs
29. Custom style for wizard
30. Custom style for module description
-------------------------------------------------------------------*/

Expand Down Expand Up @@ -3633,4 +3635,60 @@ span.round-tab:hover {

ul.messenger.messenger-fixed.messenger-on-top.custom-messenger-on-top {
top: 75px;
}

/*------------------------------------------------------------------
30. Custom style for module description
-------------------------------------------------------------------*/

.module_description h1 {
display: flex;
justify-content: space-between;
align-items: center;
}

.module_description img {
height: auto;
max-width: 100%;
}

.module_description .provider {
text-transform: uppercase;
color: #555;
margin-bottom: 20px;
}

.module_description .desc {
font-size: 16px
}

.module_description .metadata p {
font-size: 12px;
color: #8d8d8d;
margin-bottom: 5px;
}
.module_description .metadata p a {
color: #3273dc;
text-decoration: none;
}

.module_description .navbar {
background-color: #f3f3f3;
padding: 0 1rem;
}
.module_description .navbar .nav-item {
font-weight: 700;
font-size: 14px;
line-height: 76px;
position: relative;
padding: .5rem .75rem;
}
.module_description .navbar .nav-item.active:after {
content: "";
position: absolute;
bottom: 0;
left: 0;
height: 2px;
width: 100%;
background-color: #5c4ee5;
}
Binary file added src/main/resources/static/images/aws.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
136 changes: 136 additions & 0 deletions src/main/resources/templates/module_description.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="layout/header :: header(~{::title})">

<title>Gaia - Module description</title>

</head>
<body class="dashboard dashboard_2">
<div class="full_container">
<div class="inner_container">

<div th:replace="~{layout/sidebar}"></div>

<!-- right content -->
<div id="content">

<div th:replace="~{layout/topbar}"></div>

<div class="midde_cont">
<div class="container-fluid">
<div class="row column_title">
<div class="col-md-12">
<div class="page_title">
<h2> Module </h2>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="white_shd full">

<div id="app"></div>

</div>
</div>
</div>
</div>
</div>

</div>
</div>
</div>

<template id="template">
<div class="block module_description">
<section class="block_head row">
<div class="col-md-8">
<div class="row">
<div class="col-md-2">
<img :src="'/images/' + mainProvider + '.png'" :alt="mainProvider"/>
</div>
<div class="col-md-10">
<h1>
<span>{{name}}</span>
<cli-badge :cli-version="cliVersion" :badge-style="'for-the-badge'"></cli-badge>
</h1>
<div th:text="${module.id}" class="provider"></div>
<div class="desc">{{description}}</div>
<hr>
<div class="metadata">
<p>Published <b>{{createdAt | dateTime}}</b> by <a href="#">{{createdBy}}</a></p>
<p>Last modified <b>{{updatedAt | dateTime}}</b> by <a href="#">{{updatedBy}}</a></p>
<p>Module managed by <a href="#">{{owner}}</a></p>
<p>Total stacks: <a href="#">{{nbStacks}}</a></p>
<p>Source: <a :href="gitRepositoryUrl">{{gitRepositoryUrl}}</a></p>
</div>
</div>
</div>
</div>
</section>
<section>
<nav class="navbar navbar-expand">
<div class="navbar-nav">
<a class="nav-item active" href="#"><i class="fab fa-markdown"></i> Readme</a>
</div>
</nav>
</section>
<div class="block_content">
<readme :module-id="id"></readme>
</div>
</div>
</template>

<script src="/webjars/jquery/3.0.0/jquery.min.js"></script>
<script src="/webjars/popper.js/1.14.3/umd/popper.min.js"></script>
<script src="/webjars/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="/webjars/marked/0.6.2/marked.min.js"></script>
<script src="/webjars/momentjs/2.24.0/min/moment.min.js"></script>

<script src="/webjars/vue/2.5.16/vue.js"></script>
<script src="/webjars/bootstrap-vue/2.0.0-rc.26/dist/bootstrap-vue.js"></script>

<div th:replace="vue_templates/cli-badge"></div>
<div th:replace="vue_templates/readme"></div>

<div th:replace="helpers/messenger"></div>

<script th:inline="javascript" type="application/ecmascript">
const moduleId = [[${module.id}]];

$.get(`/api/terraformModules/${moduleId}`)
.then(data => {
data.id = moduleId;
// START FIXME: link with real data once implemented in the model
data.mainProvider = 'aws';
data.createdAt = moment().subtract(10, 'days');
data.createdBy = 'Richard Bullit';
data.updatedAt = moment();
data.updatedBy = 'Douglas Riper';
data.owner = 'Ze Team';
data.nbStacks = 10;
// END FIXME
new Vue({
el: "#app",
data,
template: "#template",
});
});

Vue.filter('dateTime', function (value) {
if (!value || !moment(value).isValid()) return '';
return moment(value).format('LLL');
})
</script>

<script type="application/ecmascript">
$(document).ready(function () {
/*-- sidebar js --*/
$('#sidebarCollapse').on('click', function () {
$('#sidebar').toggleClass('active');
});
});
</script>

</body>
</html>
1 change: 1 addition & 0 deletions src/main/resources/templates/modules.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ <h5 class="card-title" th:text="${module.name}">Card title</h5>
<img sec:authorize="hasRole('ADMIN')" th:attr="src=@{https://img.shields.io/badge/terraform-{version}-blue.svg?style=flat-square(version=${module.cliVersion})},alt=${module.cliVersion},title=${module.cliVersion}" style="margin-bottom: .75rem" />
<p class="card-text" th:text="${module.description}">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#" sec:authorize="hasRole('ADMIN')" th:href="@{/modules/{moduleId}(moduleId=${module.id})}" data-toggle="tooltip" title="Edit this module" class="btn btn-primary"><i class="far fa-edit"></i></a>
<a href="#" th:href="@{/modules/{moduleId}/description(moduleId=${module.id})}" data-toggle="tooltip" title="Detail of this module" class="btn btn-primary"><i class="fas fa-info"></i></a>
<a href="#" th:href="@{/modules/{moduleId}/run(moduleId=${module.id})}" data-toggle="tooltip" title="Run this module" class="btn btn-primary"><i class="fas fa-rocket"></i></a>
</div>
</div>
Expand Down

0 comments on commit 58735ee

Please # to comment.