nuevo home con acceso directo a los módulos

This commit is contained in:
Dani Herrero 2017-05-30 09:06:11 +02:00
parent ba7c7865f5
commit 9ce12b2e53
6 changed files with 78 additions and 11 deletions

View File

@ -1,5 +1,7 @@
{
"module": "client",
"name": "clients",
"icon": "person",
"routes": [
{
"url": "/clients",

View File

@ -1,3 +1,17 @@
<vn-horizontal>
<div class="default" translate>Push on applications menu</div>
</vn-horizontal>
<vn-vertical>
<vn-horizontal>
<h6 vn-one translate="Modules access"></h6>
</vn-horizontal>
<vn-horizontal vn-one>
<vn-module ng-repeat="mod in $ctrl.modules" ui-sref="{{::mod.route.state}}" class="{{::mod.name}} mdl-shadow--4dp">
<vn-vertical>
<vn-one>
<h4 translate="{{::mod.name}}"></h4>
</vn-one>
<vn-one>
<vn-icon icon="{{::mod.icon}}"></vn-icon>
</vn-one>
</vn-vertical>
</vn-module>
</vn-horizontal>
</vn-vertical>

View File

@ -4,11 +4,27 @@ import './style.scss';
export const NAME = 'vnHome';
export default class vnHome {
constructor() {
constructor(aclService) {
this.modules = [];
this.aclService = aclService;
this.init();
}
init() {
for (let file in routes) {
let card = {
name: routes[file].name,
icon: routes[file].icon
};
let fileRoutes = routes[file].routes;
if (fileRoutes.length && this.aclService.routeHasPermission(fileRoutes[0])) {
card.route = fileRoutes[0];
this.modules.push(card);
}
}
}
}
vnHome.$inject = [];
vnHome.$inject = ['aclService'];
export const COMPONENT = {
template: require('./home.html'),

View File

@ -1,7 +1,38 @@
vn-home {
& > .default {
text-align: center;
font-size: 1.3em;
padding: 2em;
padding: 2em;
vn-horizontal{
margin-bottom: 15px;
}
h6{
color: #3C393B;
text-align: center;
}
vn-module{
display: flex;
flex: none;
padding: 2em;
border-radius: 4px;
box-sizing: border-box;
cursor: pointer;
transition: opacity 0.7s ease;
h4{
text-transform: capitalize;
}
vn-one{
text-align: center;
}
i{
font-size: 50px !important;
margin: 0 auto;
}
&.clients{
background-color: #ffa410;
color: #ffffff;
}
&:hover{
opacity: 0.8;
}
}
}

View File

@ -6,5 +6,7 @@
"Profile": "Profile",
"Data saved!": "Data saved!",
"Can't contact with server": "Can't contact with server",
"Push on applications menu": "To open a module push on applications menu"
"Push on applications menu": "To open a module push on applications menu",
"clients": "clients",
"Modules access": "Modules access"
}

View File

@ -6,5 +6,7 @@
"Profile": "Perfil",
"Data saved!": "¡Datos guardados!",
"Can't contact with server": "No se pudo contactar con el servidor",
"Push on applications menu": "Para abrir un módulo pulsa en el menú de aplicaciones"
"Push on applications menu": "Para abrir un módulo pulsa en el menú de aplicaciones",
"clients": "clientes",
"Modules access" : "Acceso a módulos"
}