summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThuan Pham Quoc <thuanpq.io@gmail.com>2017-11-07 14:01:27 +0700
committerThuan Pham Quoc <thuanpq.io@gmail.com>2017-11-07 14:01:27 +0700
commit29d54f46aa79a5f3fe067717fa418092e150eb47 (patch)
treed925f590fddaa50bbf87398a55f51088e44f04e9
parent2d12a4f40473bd152755e4ab1dadb943cb233c90 (diff)
downloadwekan-29d54f46aa79a5f3fe067717fa418092e150eb47.tar.gz
wekan-29d54f46aa79a5f3fe067717fa418092e150eb47.tar.bz2
wekan-29d54f46aa79a5f3fe067717fa418092e150eb47.zip
Added people list in admin panel , just raw data right now, will add more features soon
-rw-r--r--client/components/settings/peopleBody.jade36
-rw-r--r--client/components/settings/peopleBody.js26
-rw-r--r--client/components/settings/peopleBody.styl12
-rw-r--r--client/components/settings/settingHeader.jade9
-rw-r--r--config/router.js20
-rw-r--r--server/publications/people.js3
6 files changed, 102 insertions, 4 deletions
diff --git a/client/components/settings/peopleBody.jade b/client/components/settings/peopleBody.jade
new file mode 100644
index 00000000..726cc5ed
--- /dev/null
+++ b/client/components/settings/peopleBody.jade
@@ -0,0 +1,36 @@
+template(name="people")
+ .setting-content
+ unless currentUser.isAdmin
+ | {{_ 'error-notAuthorized'}}
+ else
+ .content-title
+ span {{_ 'people'}}
+ .content-body
+ .side-menu
+ ul
+ li.active
+ a.js-setting-menu(data-id="people-setting") {{_ 'people'}}
+ .main-body
+ if loading.get
+ +spinner
+ else if people.get
+ +peopleGeneral
+
+template(name="peopleGeneral")
+ table
+ tbody
+ each user in peopleList
+ tr
+ th {{_ 'username'}}
+ th {{_ 'fullname'}}
+ th {{_ 'isAdmin'}}
+ th {{_ 'email'}}
+ th {{_ 'verified'}}
+ th {{_ 'createdAt'}}
+ tr
+ td {{ user.username }}
+ td {{ user.profile.fullname }}
+ td {{ user.isAdmin }}
+ td {{ user.emails.[0].address }}
+ td {{ user.emails.[0].verified }}
+ td {{ user.createdAt }}
diff --git a/client/components/settings/peopleBody.js b/client/components/settings/peopleBody.js
new file mode 100644
index 00000000..058cb8d5
--- /dev/null
+++ b/client/components/settings/peopleBody.js
@@ -0,0 +1,26 @@
+Meteor.subscribe('people');
+
+BlazeComponent.extendComponent({
+ onCreated() {
+ this.error = new ReactiveVar('');
+ this.loading = new ReactiveVar(false);
+ this.people = new ReactiveVar(true);
+ },
+
+ setError(error) {
+ this.error.set(error);
+ },
+
+ setLoading(w) {
+ this.loading.set(w);
+ },
+
+ peopleList() {
+ this.users = Users.find({});
+
+ this.users.forEach((user) => {
+ console.log(JSON.stringify(user));
+ });
+ return this.users;
+ },
+}).register('people');
diff --git a/client/components/settings/peopleBody.styl b/client/components/settings/peopleBody.styl
new file mode 100644
index 00000000..dc3210ad
--- /dev/null
+++ b/client/components/settings/peopleBody.styl
@@ -0,0 +1,12 @@
+table
+ font-family: arial, sans-serif;
+ border-collapse: collapse;
+ width: 100%;
+
+ td, th
+ border: 1px solid #d2d0d0;
+ text-align: left;
+ padding: 8px;
+
+ tr:nth-child(even)
+ background-color: #dddddd;
diff --git a/client/components/settings/settingHeader.jade b/client/components/settings/settingHeader.jade
index c22cf5c6..e9ea218a 100644
--- a/client/components/settings/settingHeader.jade
+++ b/client/components/settings/settingHeader.jade
@@ -9,13 +9,14 @@ template(name="settingHeaderBar")
a.setting-header-btn.settings(href="{{pathFor 'setting'}}")
i.fa(class="fa-cog")
span {{_ 'settings'}}
+
a.setting-header-btn.informations(href="{{pathFor 'information'}}")
i.fa(class="fa-info-circle")
span {{_ 'info'}}
-//TODO
-// a.setting-header-btn.people
-// i.fa(class="fa-users")
-// span {{_ 'people'}}
+
+ a.setting-header-btn.people(href="{{pathFor 'people'}}")
+ i.fa(class="fa-users")
+ span {{_ 'people'}}
else
a.setting-header-btn.js-log-in(
diff --git a/config/router.js b/config/router.js
index 7f657820..c86a92ac 100644
--- a/config/router.js
+++ b/config/router.js
@@ -140,6 +140,26 @@ FlowRouter.route('/information', {
},
});
+FlowRouter.route('/people', {
+ name: 'people',
+ triggersEnter: [
+ AccountsTemplates.ensureSignedIn,
+ () => {
+ Session.set('currentBoard', null);
+ Session.set('currentCard', null);
+
+ Filter.reset();
+ EscapeActions.executeAll();
+ },
+ ],
+ action() {
+ BlazeLayout.render('defaultLayout', {
+ headerBar: 'settingHeaderBar',
+ content: 'people',
+ });
+ },
+});
+
FlowRouter.notFound = {
action() {
BlazeLayout.render('defaultLayout', { content: 'notFound' });
diff --git a/server/publications/people.js b/server/publications/people.js
new file mode 100644
index 00000000..3beeec6a
--- /dev/null
+++ b/server/publications/people.js
@@ -0,0 +1,3 @@
+Meteor.publish('people', function () {
+ return Meteor.users.find({}, {fields:{}});
+});