search function for users and groups

This commit is contained in:
bodo 2016-05-28 13:10:13 +02:00
Родитель f72d2a80f7
Коммит 7dda6be38a
7 изменённых файлов: 50 добавлений и 6 удалений

Просмотреть файл

@ -242,6 +242,36 @@ $(document).ready(function () {
}
});
$('.live-search-list-user li').each(function(){
$(this).attr('data-search-term', $(this).text().toLowerCase());
});
$('.live-search-box-user').on('keyup', function(){
var searchTerm = $(this).val().toLowerCase();
$('.live-search-list-user li').each(function(){
if ($(this).filter('[data-search-term *= ' + searchTerm + ']').length > 0 || searchTerm.length < 1) {
$(this).show();
} else {
$(this).hide();
}
});
});
$('.live-search-list-group li').each(function(){
$(this).attr('data-search-term', $(this).text().toLowerCase());
});
$('.live-search-box-group').on('keyup', function(){
var searchTerm = $(this).val().toLowerCase();
$('.live-search-list-group li').each(function(){
if ($(this).filter('[data-search-term *= ' + searchTerm + ']').length > 0 || searchTerm.length < 1) {
$(this).show();
} else {
$(this).hide();
}
});
});
var form = document.finish_poll;
var submit_finish_poll = document.getElementById('submit_finish_poll');
if (submit_finish_poll != null) {

Просмотреть файл

@ -22,6 +22,8 @@
"delete" : "löschen",
"Next" : "Weiter",
"Cancel" : "Abbrechen",
"User search" : "Benutzer suchen",
"Group search" : "Gruppe suchen",
"Options" : "Optionen",
"Edit poll" : "Umfrage bearbeiten",
"Click on days to add or remove" : "Klicke auf die Tage um sie hinzuzufügen oder zu löschen",

Просмотреть файл

@ -23,6 +23,8 @@ $TRANSLATIONS = array(
"delete" => "löschen",
"Next" => "Weiter",
"Cancel" => "Abbrechen",
"User search" : "Benutzer suchen",
"Group search" : "Gruppe suchen",
"Options" => "Optionen",
"Edit poll" => "Umfrage bearbeiten",
"Click on days to add or remove" => "Klicke auf die Tage um sie hinzuzufügen oder zu löschen",

Просмотреть файл

@ -22,6 +22,8 @@
"delete" : "löschen",
"Next" : "Weiter",
"Cancel" : "Abbrechen",
"User search" : "Benutzer suchen",
"Group search" : "Gruppe suchen",
"Options" : "Optionen",
"Edit poll" : "Umfrage bearbeiten",
"Click on days to add or remove" : "Klicken Sie auf die Tage um sie hinzuzufügen oder zu löschen",

Просмотреть файл

@ -22,6 +22,8 @@
"delete" : "delete",
"Next" : "Next",
"Cancel" : "Cancel",
"User search" : "User search",
"Group search" : "Group search",
"Options" : "Options",
"Edit poll" : "Edit poll",
"Click on days to add or remove" : "Click on days to add or remove",

Просмотреть файл

@ -23,6 +23,8 @@ $TRANSLATIONS = array(
"delete" => "delete",
"Next" => "Next",
"Cancel" => "Cancel",
"User search" : "User search",
"Group search" : "Group search",
"Options" => "Options",
"Edit poll" => "Edit poll",
"Click on days to add or remove" => "Click on days to add or remove",

Просмотреть файл

@ -79,10 +79,13 @@
<div id="access_rights" class="row">
<div class="col-50">
<h3><?php p($l->t('Groups')); ?></h3>
<ul>
<?php $groups = OC_Group::getUserGroups($userId); ?>
<?php foreach($groups as $gid) : ?>
<!--<h3><?php p($l->t('Groups')); ?></h3> -->
<input type="text" class="live-search-box-group" placeholder="<?php p($l->t('Group search')); ?>" />
<ul class="live-search-list-group">
<?php
$groups = OC_Group::getUserGroups($userId);
sort($groups, SORT_NATURAL | SORT_FLAG_CASE );
foreach($groups as $gid) : ?>
<li class="cl_group_item cl_access_item" id="group_<?php p($gid); ?>">
<?php p($gid); ?>
</li>
@ -90,8 +93,9 @@
</ul>
</div>
<div class="col-50">
<h3><?php p($l->t('Users')); ?></h3>
<ul>
<!--<h3><?php p($l->t('Users')); ?></h3> -->
<input type="text" class="live-search-box-user" placeholder="<?php p($l->t('User search')); ?>" />
<ul class="live-search-list-user">
<?php
$all_groups = OC_Group::getGroups();
$users = OC_User::getUsers();