* jamtrack UI fixes: VRFS-3041 (ordering fixed), VRFS-3004 - loading/no more jamtrack notice fixes, and VRFS-3005 - filter by band works

This commit is contained in:
Seth Call 2015-04-16 15:44:38 -05:00
parent 4cf4e21552
commit fefd5a3fda
9 changed files with 28 additions and 16 deletions

View File

@ -168,17 +168,15 @@ module JamRuby
if options[:group_artist]
query = query.select("original_artist, array_agg(jam_tracks.id) AS id, MIN(name) AS name, MIN(description) AS description, MIN(recording_type) AS recording_type, MIN(original_artist) AS original_artist, MIN(songwriter) AS songwriter, MIN(publisher) AS publisher, MIN(sales_region) AS sales_region, MIN(price) AS price, MIN(version) AS version, MIN(genre_id) AS genre_id")
query = query.group("original_artist")
query = query.order('jam_tracks.original_artist')
else
query = query.group("jam_tracks.id")
query = query.order('jam_tracks.name')
query = query.group("jam_tracks.id")
end
query = query.where("jam_tracks.status = ?", 'Production') unless user.admin
query = query.where("jam_tracks.genre_id = '#{options[:genre]}'") unless options[:genre].blank?
query = query.where("jam_track_tracks.instrument_id = '#{options[:instrument]}'") unless options[:instrument].blank?
query = query.where("jam_tracks.sales_region = '#{options[:availability]}'") unless options[:availability].blank?
query = query.where("jam_tracks.sales_region = '#{options[:availability]}'") unless options[:availability].blank?
query = query.order('jam_tracks.original_artist, jam_tracks.name')
if query.length == 0
[query, nil]

View File

@ -45,8 +45,8 @@ describe JamTrack do
end
it "sorts by name" do
jam_track1 = FactoryGirl.create(:jam_track_with_tracks, name: 'a')
jam_track2 = FactoryGirl.create(:jam_track_with_tracks, name: 'b')
jam_track1 = FactoryGirl.create(:jam_track_with_tracks, original_artist: 'artist', name: 'a')
jam_track2 = FactoryGirl.create(:jam_track_with_tracks, original_artist: 'artist', name: 'b')
query, pager = JamTrack.index({}, user)
query.size.should == 2

View File

@ -64,10 +64,10 @@ context.JK.JamTrackScreen=class JamTrackScreen
params
refresh:() =>
this.clearResults()
@currentQuery = this.buildQuery()
that = this
rest.getJamTracks(@currentQuery).done((response) =>
that.clearResults()
that.handleJamtrackResponse(response)
).fail (jqXHR) =>
that.clearResults()
@ -117,7 +117,7 @@ context.JK.JamTrackScreen=class JamTrackScreen
# if we less results than asked for, end searching
@scroller.infinitescroll 'pause'
if @currentPage == 0 and response.jamtracks.length == 0
@content.append '<div class=\'no-jamtracks-msg\'>No JamTracks found.</div>'
@content.append '<td colspan="3" class="no-jamtracks-msg">No JamTracks found.</td>'
if @currentPage > 0
@noMoreJamtracks.show()
# there are bugs with infinitescroll not removing the 'loading'.

View File

@ -154,10 +154,15 @@ input[type="button"] {
}
.curtain {
background-color: $ColorScreenBackground;
position:absolute;
top:0px;
left:0px;
&.minimal {
display:none
}
background-color: $ColorScreenBackground;
position:absolute;
top:0px;
left:0px;
}
.curtain .splash {
position:absolute;

View File

@ -111,7 +111,8 @@
}
.no-jamtracks-msg {
margin-top: 10px;
margin: 10px 0;
text-align:center;
}
.jamtrack-record {
@ -218,6 +219,10 @@
width: 60%;
}
}
.end-of-jamtrack-list {
margin-top:20px;
}
}
#jamtrack-license-dialog {

View File

@ -16,6 +16,7 @@ class ClientsController < ApplicationController
return
end
@minimal_curtain = Rails.application.config.minimal_curtain
gon.recurly_tax_estimate_jam_track_plan = Rails.application.config.recurly_tax_estimate_jam_track_plan
render :layout => 'client'
end

View File

@ -1,4 +1,4 @@
<div class="curtain" style="width:100%; height:100%; z-index:9999;">
<div class="curtain <%= @minimal_curtain ? 'minimal' : ''%>" style="width:100%; height:100%; z-index:9999;">
<div class="splash">
<img src="/assets/header/logo.png"/>
<p>Connecting...</p>

View File

@ -324,5 +324,7 @@ if defined?(Bundler)
config.nominated_jam_track = 'jamtrack-pearljam-alive'
config.recurly_tax_estimate_jam_track_plan = 'jamtrack-acdc-backinblack'
config.minimal_curtain = false
end
end

View File

@ -90,4 +90,5 @@ SampleApp::Application.configure do
config.youtube_developer_key = "AI39si5bPqiNc5GQHscWJh9Wl1WTAr9aZqr_YncUvaR7Kz0rgPdBVWVubHZ94xZ3KLIBqtE9mu3VZe-UpMU80QxXoC66kBNp7A"
config.youtube_app_name = "JamKazamDev"
config.jam_tracks_available=true
config.minimal_curtain = true
end