added keyword search to find session
This commit is contained in:
parent
9375c036f5
commit
8ce893c8b3
|
|
@ -57,7 +57,15 @@
|
|||
queryString += "genres=" + genres.join(',');
|
||||
}
|
||||
|
||||
// TODO: keyword filter
|
||||
// keyword filter
|
||||
var keyword = $('#session-keyword-srch').val();
|
||||
if (keyword != null && keyword.length > 0) {
|
||||
if (queryString.length > 0) {
|
||||
queryString += "&";
|
||||
}
|
||||
|
||||
queryString += "keyword=" + $('#session-keyword-srch').val();
|
||||
}
|
||||
|
||||
if (queryString.length > 0) {
|
||||
$.ajax({
|
||||
|
|
@ -219,6 +227,15 @@
|
|||
//$('#findSession-tableBody').on("click", '[action="delete"]', deleteSession);
|
||||
$('#musician-list-header').on("click", toggleMusicianBox);
|
||||
$('#musician-list-arrow').on("click", toggleMusicianBox);
|
||||
|
||||
$('#session-keyword-srch').focus(function() {
|
||||
$(this).val('');
|
||||
});
|
||||
|
||||
// $('#session-keyword-srch').blur(function() {
|
||||
// $(this).val('Search by Keyword');
|
||||
// });
|
||||
|
||||
$('#btn-refresh').on("click", search);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
MUSICIANS_ONLY:"Musicians Only"
|
||||
};
|
||||
|
||||
var instrument_logos = { "accordion": '',
|
||||
var instrument_logo_map = { "accordion": '',
|
||||
"acoustic guitar": '',
|
||||
"banjo": '',
|
||||
"bass guitar": '',
|
||||
|
|
@ -86,7 +86,7 @@
|
|||
// loop through the tracks to get the instruments
|
||||
for (j=0; j < participant.tracks.length; j++) {
|
||||
var track = participant.tracks[j];
|
||||
instrumentLogoHtml += '<img src="' + instrument_logos[track.instrument_id] + '" width="24" height="24" /> ';
|
||||
instrumentLogoHtml += '<img src="' + instrument_logo_map[track.instrument_id] + '" width="24" height="24" /> ';
|
||||
}
|
||||
|
||||
var id = participant.user.id;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class ApiMusicSessionsController < ApiController
|
|||
# params[:friends_only] does the obvious.
|
||||
# params[:my_bands_only] also does the obvious.
|
||||
# Importantly, friends and my_bands are ORed not ANDed. So, if you specify both as true, you'll get more results, not fewer.
|
||||
@music_sessions = MusicSession.index(current_user, params[:participants], params[:genres], params[:friends_only], params[:my_bands_only])
|
||||
@music_sessions = MusicSession.index(current_user, params[:participants], params[:genres], params[:friends_only], params[:my_bands_only], params[:keyword])
|
||||
end
|
||||
|
||||
def create
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
<!-- keyword filter -->
|
||||
<div class="search-box">
|
||||
<input id="search-session-input" type="text" name="search" value="Search by Keyword" onfocus="enterText(this.id,'')" onblur="enterText(this.id,'Search by Keyword')" />
|
||||
<input id="session-keyword-srch" type="text" name="search" value="Search by Keyword" />
|
||||
</div>
|
||||
<div class="right mr10">
|
||||
<a id="btn-refresh" href="#" style="text-decoration:none;" class="button-grey">REFRESH</a>
|
||||
|
|
|
|||
Loading…
Reference in New Issue