VFFS-2830 : Jam tracks account overview
This commit is contained in:
parent
07b74cc3e7
commit
abb31c4e40
|
|
@ -361,6 +361,10 @@ module JamRuby
|
|||
MusicSession.scheduled_rsvp(self, true).length
|
||||
end
|
||||
|
||||
def purchased_jamtracks_count
|
||||
self.purchased_jam_tracks.count
|
||||
end
|
||||
|
||||
def joined_score
|
||||
return nil unless has_attribute?(:score)
|
||||
a = read_attribute(:score)
|
||||
|
|
|
|||
|
|
@ -33,6 +33,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
function licenseDetail(userDetail) {
|
||||
return (userDetail.purchased_jamtracks_count==0) ? "You don't currently own any JamTracks" : 'You currently own a license to use ' + userDetail.purchased_jamtracks_count + " JamTracks"
|
||||
}
|
||||
|
||||
function populateAccount(userDetail) {
|
||||
|
||||
var validProfiles = prettyPrintAudioProfiles(context.JK.getGoodConfigMap());
|
||||
|
|
@ -42,8 +46,10 @@
|
|||
var $template = $(context._.template($('#template-account-main').html(), {
|
||||
email: userDetail.email,
|
||||
name: userDetail.name,
|
||||
licenseDetail: licenseDetail(userDetail),
|
||||
location : userDetail.location,
|
||||
session : sessionSummary,
|
||||
paymentMethod: "mastercard",
|
||||
instruments : prettyPrintInstruments(userDetail.instruments),
|
||||
photoUrl : context.JK.resolveAvatarUrl(userDetail.photo_url),
|
||||
validProfiles : validProfiles,
|
||||
|
|
@ -126,7 +132,7 @@
|
|||
}
|
||||
|
||||
function navToEditSubscriptions() {
|
||||
|
||||
window.location = '/client#/account/profile'
|
||||
}
|
||||
|
||||
function navToEditPayments() {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class ApiUsersController < ApiController
|
|||
@user = User.includes([{musician_instruments: :instrument},
|
||||
{band_musicians: :user},
|
||||
{genre_players: :genre},
|
||||
:bands, :instruments, :genres])
|
||||
:bands, :instruments, :genres, :jam_track_rights])
|
||||
.find(params[:id])
|
||||
|
||||
respond_with @user, responder: ApiResponder, :status => 200
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
object @user
|
||||
|
||||
attributes :id, :first_name, :last_name, :name, :city, :state, :country, :location, :online, :photo_url, :musician, :gender, :birth_date, :internet_service_provider, :friend_count, :liker_count, :like_count, :follower_count, :following_count, :recording_count, :session_count, :biography, :favorite_count, :audio_latency, :upcoming_session_count
|
||||
attributes :id, :first_name, :last_name, :name, :city, :state, :country, :location, :online, :photo_url, :musician, :gender, :birth_date, :internet_service_provider, :friend_count, :liker_count, :like_count, :follower_count, :following_count, :recording_count, :session_count, :biography, :favorite_count, :audio_latency, :upcoming_session_count, :purchased_jamtracks_count
|
||||
|
||||
if @user.musician?
|
||||
node :location do @user.location end
|
||||
|
|
|
|||
|
|
@ -94,18 +94,19 @@
|
|||
<hr />
|
||||
|
||||
<div class="account-left">
|
||||
<h2>subscriptions:</h2>
|
||||
<h2>jamtracks:</h2>
|
||||
</div>
|
||||
|
||||
<div class="account-mid subscriptions">
|
||||
<!--<strong>Studio:</strong> Gold ($49.99/year)<br />
|
||||
<strong>NaaS:</strong> Yes ($29.99/year)-->
|
||||
<strong>N/A</strong><br />
|
||||
<strong>This feature not yet implemented</strong>
|
||||
<strong class="jamtrack-license-detail">
|
||||
{{data.licenseDetail}}
|
||||
</strong>
|
||||
<br clear="all" />
|
||||
<a href="#" class="view-license">JamTracks License</a>
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<!--<a id="account-edit-subscriptions-link" href="#" class="button-orange">UPDATE</a>-->
|
||||
<a id="account-edit-subscriptions-link" href="#" class="button-orange">UPDATE</a>
|
||||
</div>
|
||||
<br clear="all" />
|
||||
|
||||
|
|
@ -117,14 +118,15 @@
|
|||
</div>
|
||||
|
||||
<div class="account-mid payments">
|
||||
<!--<strong>Method:</strong> MasterCard •••• •••• •••• 1234<br />
|
||||
<a href="#">View Payment History</a> <a href="#">Cancel Subscription</a> -->
|
||||
<strong>N/A</strong></br />
|
||||
<strong>This feature not yet implemented</strong>
|
||||
<strong>Method:</strong>
|
||||
<div class="payment-method-text">
|
||||
{{data.payment_method}}
|
||||
</div>
|
||||
<a href="#">View Payment History</a> <a href="#">Update Payment Method</a>
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<!--<a id="account-edit-payments-link" href="#" class="button-orange">UPDATE</a>-->
|
||||
<a id="account-edit-payments-link" href="#" class="button-orange">UPDATE</a>
|
||||
</div>
|
||||
<br clear="all" />
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue