diff options
author | Koren Lev <korenlev@gmail.com> | 2017-07-27 16:42:15 +0300 |
---|---|---|
committer | Koren Lev <korenlev@gmail.com> | 2017-07-27 16:42:15 +0300 |
commit | b88c78e3cf2bef22aa2f1c4d0bf305e303bc15f0 (patch) | |
tree | ffa30a6e1511d72562d8772b8700cda52b2752a1 /ui/imports/ui/components/user-list | |
parent | b70483739d1f6f4f0d31987ed2e4d1e30d71d579 (diff) |
adding calipso ui
Change-Id: Ifa6f63daebb07f45580f747341960e898fdb00c4
Signed-off-by: Koren Lev <korenlev@gmail.com>
Diffstat (limited to 'ui/imports/ui/components/user-list')
-rw-r--r-- | ui/imports/ui/components/user-list/user-list.html | 53 | ||||
-rw-r--r-- | ui/imports/ui/components/user-list/user-list.js | 74 | ||||
-rw-r--r-- | ui/imports/ui/components/user-list/user-list.styl | 22 |
3 files changed, 149 insertions, 0 deletions
diff --git a/ui/imports/ui/components/user-list/user-list.html b/ui/imports/ui/components/user-list/user-list.html new file mode 100644 index 0000000..0f8c082 --- /dev/null +++ b/ui/imports/ui/components/user-list/user-list.html @@ -0,0 +1,53 @@ +<!-- +######################################################################################## +# Copyright (c) 2017 Koren Lev (Cisco Systems), Yaron Yogev (Cisco Systems) and others # +# # +# All rights reserved. This program and the accompanying materials # +# are made available under the terms of the Apache License, Version 2.0 # +# which accompanies this distribution, and is available at # +# http://www.apache.org/licenses/LICENSE-2.0 # +######################################################################################## + --> +<template name="UserList"> +<div class="os-user-list cards white"> + <h3>User List</h3> + <a class="sm-add-new-link" + href="{{pathFor route='user' query=(asHash action='insert') }}"> + <i class="cl-action-icon fa fa-plus" area-hidden="true"></i> Create new user + </a> + <table class="sm-user-list-table table"> + <thead> + <tr> + <th>User Name</th> + <th>Emails</th> + <th>Profile</th> + <th>Roles</th> + </tr> </thead> + <tbody> + {{#each user in userList }} + <tr> + <td>{{ user.username }}</td> + <td>{{ toString user.emails }}</td> + <td>{{ toString user.profile }}</td> + <td>{{ toString user.roles }}</td> + <td> + <div class="sm-action-bar"> + <a href="{{pathFor route='user' + query=(asHash id=(idToStr user._id) action='view') }}" + ><i class="cl-action-icon fa fa-eye" area-hidden="true"></i></a> + + <a href="{{pathFor route='user' + query=(asHash id=(idToStr user._id) action='update') }}" + ><i class="cl-action-icon fa fa-pencil" area-hidden="true"></i></a> + + <a href="{{pathFor route='user' + query=(asHash id=(idToStr user._id) action='remove') }}" + ><i class="cl-action-icon fa fa-trash-o" area-hidden="true"></i></a> + </div> + </td> + </tr> + {{/each }} + </tbody> + </table> +</div> +</template> diff --git a/ui/imports/ui/components/user-list/user-list.js b/ui/imports/ui/components/user-list/user-list.js new file mode 100644 index 0000000..8deb24d --- /dev/null +++ b/ui/imports/ui/components/user-list/user-list.js @@ -0,0 +1,74 @@ +///////////////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2017 Koren Lev (Cisco Systems), Yaron Yogev (Cisco Systems) and others / +// / +// All rights reserved. This program and the accompanying materials / +// are made available under the terms of the Apache License, Version 2.0 / +// which accompanies this distribution, and is available at / +// http://www.apache.org/licenses/LICENSE-2.0 / +///////////////////////////////////////////////////////////////////////////////////////// +/* + * Template Component: UserList + */ + +//import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; +import { ReactiveDict } from 'meteor/reactive-dict'; +//import { SimpleSchema } from 'meteor/aldeed:simple-schema'; +import * as R from 'ramda'; + +import './user-list.html'; + +/* + * Lifecycles + */ + +Template.UserList.onCreated(function() { + var instance = this; + + instance.state = new ReactiveDict(); + instance.state.setDefault({ + }); + + instance.autorun(function () { + //let data = Template.currentData(); + + /* + var controller = Iron.controller(); + var params = controller.getParams(); + var query = params.query; + + new SimpleSchema({ + }).validate(query); + */ + + instance.subscribe('users'); + }); +}); + +/* +Template.UserList.rendered = function() { +}; +*/ + +/* + * Events + */ + +Template.UserList.events({ +}); + +/* + * Helpers + */ + +Template.UserList.helpers({ + userList: function () { + return Meteor.users.find({}); + }, + + toString: function (val) { + return R.toString(val); + } +}); + + diff --git a/ui/imports/ui/components/user-list/user-list.styl b/ui/imports/ui/components/user-list/user-list.styl new file mode 100644 index 0000000..5bb3d41 --- /dev/null +++ b/ui/imports/ui/components/user-list/user-list.styl @@ -0,0 +1,22 @@ +.os-user-list + margin: 20px; + + .cl-action-icon, + .card.fa.cl-action-icon + font-size: 16px !important; + + .sm-user-list-table + th + color: spark-blue + + .sm-action-bar + display: flex; + + a + margin: 0px 5px; + + .cl-action-icon + color: gray + + .sm-add-new-link + color: spark-blue |