VRFS-3248 : Band profile - history

* Allow context.JK.Feed to be attached to band, passing through to jam
rest as necessary.  Hook up from band profile JS.
* Markup and styling for feed on band profile history tab.
This commit is contained in:
Steven Miers 2015-06-15 18:10:17 -05:00
parent 9b24e0c05b
commit e72980a32e
4 changed files with 55 additions and 10 deletions

View File

@ -12,11 +12,23 @@
var band = {};
var instrument_logo_map = context.JK.getInstrumentIconMap24();
var profileUtils = context.JK.ProfileUtils;
var feed = new context.JK.Feed(app)
var $root = $("#band-profile")
var $history = $root.find("#band-profile-history")
function beforeShow(data) {
bandId = data.id;
feed.setBand(bandId);
}
function beforeHide(data) {
feed.setBand(null);
}
function afterShow(data) {
// hide until we know if 'isMember'
$("#btn-follow-band").hide();
@ -356,7 +368,7 @@
}
function bindHistory() {
feed.refresh();
}
function buildGenreList(genres) {
@ -591,6 +603,17 @@
'afterShow': afterShow
};
app.bindScreen('bandProfile', screenBindings);
var $feedScroller = $history.find(".content-body-scroller")
var $feedContent = $feedScroller.find(".feed-content")
var $noMoreFeeds = $feedScroller.find('.end-of-list')
var $refresh = $history.find('.btn-refresh-entries');
var $sortFeedBy = $history.find('#feed_order_by');
var $includeDate = $history.find('#feed_date');
var $includeType = $history.find('#feed_show');
feed.initialize($history, $feedScroller, $feedContent, $noMoreFeeds, $refresh, $sortFeedBy, $includeDate, $includeType, {time_range: 'all'})
}

View File

@ -11,6 +11,7 @@
var ui = new context.JK.UIHelper(JK.app);
var recordingUtils = context.JK.RecordingUtils;
var userId = null;
var bandId = null;
var currentFeedPage = 0;
var feedBatchSize = 10;
var $screen = null;
@ -35,6 +36,10 @@
query.user = userId;
}
if(bandId) {
query.band = bandId;
}
return query;
}
@ -83,6 +88,10 @@
userId = _userId;
}
function setBand(_bandId) {
bandId = _bandId;
}
function refresh() {
clearResults();
populate();
@ -99,9 +108,9 @@
function populate() {
if (isLoading || didLoadAllFeeds) return;
setLoading(true);
rest.getFeeds(buildQuery())
.done(function(response) {
handleFeedResponse(response);
@ -566,7 +575,6 @@
var winheight = $(scrollerID).height();
var docheight = $('#'+screenID()+'-feed-entry-list').height();
var scrollTrigger = 0.90;
//console.log("feed scroll: wintop="+wintop+" docheight="+docheight+" winheight="+winheight+" ratio="+(wintop / (docheight - winheight)));
if ((wintop / (docheight - winheight)) > scrollTrigger) {
populate();
}
@ -606,6 +614,7 @@
this.initialize = initialize;
this.refresh = refresh;
this.setUser = setUser;
this.setBand = setBand;
return this;
}

View File

@ -355,14 +355,14 @@
display:none;
}
#history-content {
#history-content, #band-profile-history {
padding:0 10px 0 20px;
width:100%;
position:relative;
height:100%;
@include border_box_sizing;
#user-feed-controls {
#user-feed-controls, #band-feed-controls {
width:100%;
@include border_box_sizing;
position:relative;

View File

@ -137,11 +137,24 @@
</div>
</div>
<div id="band-profile-history" class="band-profile-wrapper">
<div class="content-body-scroller">
<br clear="all" />
</div>
<div id="band-profile-history" class="profile-body-content band-profile-wrapper">
<div class="band-profile-history-feed">
<%= form_tag('', {:id => 'band-feed-form', :class => 'inner-content'}) do %>
<%= render(:partial => "web_filter", :locals => {:search_type => Search::PARAM_FEED, :id => 'band-feed-controls'}) %>
<div class="filter-body">
<div class="content-body-scroller" id="band-profile-feed-scroller">
<div class="profile-wrapper">
<div class="feed-content" id="band-profile-feed-entry-list"></div>
<div id="band-profile-end-of-feeds-list" class="end-of-list">No more feed entries</div>
<div id="band-profile-loading-feeds" class="infinite-scroll-loader" style="padding:5px">Loading ...</div>
</div>
</div>
</div>
<% end %>
</div>
</div>
<div id="band-profile-members" class="band-profile-wrapper profile-body-content f11">
<br clear="all" />
</div>