我对流星有疑问,我用滑块显示一些组。当您单击一个组时,我会显示一些用户。
我只想显示属于组管理员的用户,在组管理员中,并且只显示组管理器上的用户管理器等...
HTML:
<template name="manage">
{{> header}}
<div class="menu">
<div class="accordion">
<div class="accordion-group">
{{#each roles}}
<div class="accordion-heading country">
<!-- <img src="http://placehold.it/100x30" alt="country flag" style="float:left; margin: 3px 10px 0 3px; text-align:center;"/> -->
<p style="border: 1px solid grey; border-radius: 5px; font-weight: bold; width: 100px; height :30px; float:left; margin: 3px 10px 0 3px; text-align:center;">{{name}}</p>
<a class="accordion-toggle" data-toggle="collapse" href="#country{{_id}}">{{pays}} - {{lieu}} - {{increment}}</a>
</div>
<div id="country{{_id}}" class="accordion-body collapse">
<div class="accordion-inner">
<table class="table table-striped table-condensed">
<thead>
<tr>
<th>Utilisateurs</th>
<th>Nom</th>
<th>Prenom</th>
<th>Statut</th>
<th>ID</th>
</tr>
</thead>
<tbody>
{{#each users "1"}}
<!-- {{#if roles "lol"}} -->
<tr>
{{#each emails}}
<td>{{address}}</td>
{{/each}}
<td>{{profile.name}}</td>
<td>{{profile.name}}</td>
<td>OK</td>
<td>{{increment}}</td>
</tr>
<!-- {{/if}} -->
{{/each}}
</tbody>
</table>
</div>
</div>
{{/each}}
</div>
</div>
JS:
Template.manage.roles = function () {
return Meteor.roles.find();
};
Template.manage.users = function (inc) {
return Meteor.users.find({increment : inc});
};
所以,我正在尝试比较 DB 中的两个字段,但您有更好的解决方案吗?对不起,我是新来的流星 :)