Added searchbar for all pages
This commit is contained in:
parent
91349e2c2c
commit
e2b9d2a798
|
@ -67,7 +67,6 @@ Searchbar = ( function() {
|
||||||
contentType: 'application/json',
|
contentType: 'application/json',
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if(is_ok(data)) {
|
if(is_ok(data)) {
|
||||||
console.log(data.members);
|
|
||||||
$.each(data.members, function(index, value){
|
$.each(data.members, function(index, value){
|
||||||
$(".search-result-overlay-list").append("<a href=\"/portal/mm/profile?action=view&id="+value.entity_id+"\"><li class='list-group-item'><span class=\"badge badge-secondary\">Mitglied</span> "+value.firstname+" "+value.lastname+"</li></a>")
|
$(".search-result-overlay-list").append("<a href=\"/portal/mm/profile?action=view&id="+value.entity_id+"\"><li class='list-group-item'><span class=\"badge badge-secondary\">Mitglied</span> "+value.firstname+" "+value.lastname+"</li></a>")
|
||||||
});
|
});
|
||||||
|
@ -80,8 +79,26 @@ Searchbar = ( function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
console.log("Unknown search entity type: "+type);
|
$.ajax({
|
||||||
return;
|
url: '/api/members/',
|
||||||
|
type: 'GET',
|
||||||
|
data: {
|
||||||
|
"name": $("#searchbar").val()
|
||||||
|
},
|
||||||
|
contentType: 'application/json',
|
||||||
|
success: function(data) {
|
||||||
|
if(is_ok(data)) {
|
||||||
|
$.each(data.members, function(index, value){
|
||||||
|
$(".search-result-overlay-list").append("<a href=\"/portal/mm/profile?action=view&id="+value.entity_id+"\"><li class='list-group-item'><span class=\"badge badge-secondary\">Mitglied</span> "+value.firstname+" "+value.lastname+"</li></a>")
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
timeout: 3000,
|
||||||
|
error: function() {
|
||||||
|
alert("Verbindung zum Server unterbrochen!");
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
{{> sidebar }}
|
{{> sidebar }}
|
||||||
<div id="content">
|
<div id="content">
|
||||||
|
{{> searchbar}}
|
||||||
|
<hr>
|
||||||
<h1>Willkommen beim ERMS!</h1>
|
<h1>Willkommen beim ERMS!</h1>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
{{> sidebar }}
|
{{> sidebar }}
|
||||||
<div id="content">
|
<div id="content">
|
||||||
|
{{> searchbar}}
|
||||||
|
<hr>
|
||||||
<h1>Member List</h1>
|
<h1>Member List</h1>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="filter">
|
<div class="filter">
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control" id="searchbar" data-active-entity="{{active_entity}}" data-entity-type="{{entity_type}}">
|
<input type="text" class="form-control" id="searchbar" data-active-entity="{{active_entity}}" data-entity-type="{{entity_type}}">
|
||||||
<span class="input-group-append">
|
<span class="input-group-append">
|
||||||
<button class="btn btn-outline-secondary" type="button">
|
<span class="btn btn-outline-secondary" type="button">
|
||||||
<svg width="16" height="16" fill="currentColor">
|
<svg width="16" height="16" fill="currentColor">
|
||||||
<use xlink:href="/img/bootstrap-icons.svg#search"/>
|
<use xlink:href="/img/bootstrap-icons.svg#search"/>
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="search-result-overlay" style="display: none">
|
<div class="search-result-overlay" style="display: none">
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
<li><a href="/portal/mm">Mitgliederliste</a></li>
|
<li><a href="/portal/mm">Mitgliederliste</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="/portal/mm/core-data">Profil</a></li>
|
<li><a href="/portal/mm/profile">Profil</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="/portal/mm/groups">Gruppen</a></li>
|
<li><a href="/portal/mm/groups">Gruppen</a></li>
|
||||||
|
|
Loading…
Reference in New Issue