From f0c9b2beca347706033af8bfaa2fea493dfdf5b0 Mon Sep 17 00:00:00 2001 From: Daniel Herrero Date: Tue, 19 Dec 2017 11:05:07 +0100 Subject: [PATCH] new module articles, structure --- client/articles/index.js | 1 + client/articles/routes.json | 21 ++++++++++ client/articles/src/articles.js | 3 ++ client/articles/src/index/index.html | 0 client/articles/src/index/index.js | 15 ++++++++ client/articles/src/locale/es.json | 3 ++ client/articles/src/module.js | 5 +++ client/modules.json | 3 +- client/salix/src/spliting.js | 11 ++++++ .../nginx/static/images/icon_articles.svg | 38 +++++++++++++++++++ 10 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 client/articles/index.js create mode 100644 client/articles/routes.json create mode 100644 client/articles/src/articles.js create mode 100644 client/articles/src/index/index.html create mode 100644 client/articles/src/index/index.js create mode 100644 client/articles/src/locale/es.json create mode 100644 client/articles/src/module.js create mode 100644 services/nginx/static/images/icon_articles.svg diff --git a/client/articles/index.js b/client/articles/index.js new file mode 100644 index 000000000..5e4d1e64b --- /dev/null +++ b/client/articles/index.js @@ -0,0 +1 @@ +export * from './src/articles'; diff --git a/client/articles/routes.json b/client/articles/routes.json new file mode 100644 index 000000000..af8c49149 --- /dev/null +++ b/client/articles/routes.json @@ -0,0 +1,21 @@ +{ + "module": "articles", + "name": "Articles", + "icon": "/static/images/icon_articles.svg", + "routes": [ + { + "state": "articles", + "abstract": true, + "acl": ["employee"] + }, + { + "url": "/articles", + "state": "articles.index", + "component": "vn-articles-index" + }, { + "url": "/create", + "state": "articles.create", + "component": "vn-client-create" + } + ] +} \ No newline at end of file diff --git a/client/articles/src/articles.js b/client/articles/src/articles.js new file mode 100644 index 000000000..ad5e0bb9d --- /dev/null +++ b/client/articles/src/articles.js @@ -0,0 +1,3 @@ +export * from './module'; + +import './index/index'; diff --git a/client/articles/src/index/index.html b/client/articles/src/index/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/client/articles/src/index/index.js b/client/articles/src/index/index.js new file mode 100644 index 000000000..d20d6b005 --- /dev/null +++ b/client/articles/src/index/index.js @@ -0,0 +1,15 @@ +import ngModule from '../module'; + +export default class Controller { + constructor() { + this.model = {}; + } + search(index) { + index.accept(); + } +} + +ngModule.component('vnArticlesIndex', { + template: require('./index.html'), + controller: Controller +}); diff --git a/client/articles/src/locale/es.json b/client/articles/src/locale/es.json new file mode 100644 index 000000000..947465dcc --- /dev/null +++ b/client/articles/src/locale/es.json @@ -0,0 +1,3 @@ +{ + "Articles": "Artículos" +} \ No newline at end of file diff --git a/client/articles/src/module.js b/client/articles/src/module.js new file mode 100644 index 000000000..be4d80d9c --- /dev/null +++ b/client/articles/src/module.js @@ -0,0 +1,5 @@ +import {ng} from 'vendor'; +import 'core'; + +const ngModule = ng.module('articles', ['vnCore']); +export default ngModule; diff --git a/client/modules.json b/client/modules.json index 62c5e11a1..02af7e678 100644 --- a/client/modules.json +++ b/client/modules.json @@ -5,5 +5,6 @@ "client": [], "production": [], "route": [], - "locator": [] + "locator": [], + "articles": [] } diff --git a/client/salix/src/spliting.js b/client/salix/src/spliting.js index 697bcef98..b62c3d1d6 100644 --- a/client/salix/src/spliting.js +++ b/client/salix/src/spliting.js @@ -43,3 +43,14 @@ export const locator = () => { }; core.splitingRegister.register('locator', locator); + +export const articles = () => { + return new Promise(resolve => { + require.ensure([], () => { + require('articles'); + resolve('articles'); + }, 'articles'); + }); +}; + +core.splitingRegister.register('articles', articles); diff --git a/services/nginx/static/images/icon_articles.svg b/services/nginx/static/images/icon_articles.svg new file mode 100644 index 000000000..cfd090f11 --- /dev/null +++ b/services/nginx/static/images/icon_articles.svg @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +