From 55b149827adafe0de4139026676ab5d01c538dfa Mon Sep 17 00:00:00 2001 From: Jonathan Kolyer Date: Wed, 23 Apr 2014 07:43:35 +0000 Subject: [PATCH] VRFS-1576 report layout --- web/app/assets/javascripts/affiliate_report.js | 17 +++++++++++++---- .../views/clients/_affiliate_report.html.erb | 9 +++++++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/web/app/assets/javascripts/affiliate_report.js b/web/app/assets/javascripts/affiliate_report.js index d20d208ed..662611131 100644 --- a/web/app/assets/javascripts/affiliate_report.js +++ b/web/app/assets/javascripts/affiliate_report.js @@ -17,15 +17,24 @@ function populateAffiliateReport(report) { console.log(report); - /*var template = context.JK.fillTemplate($('#template-account-affiliate').html(), { - email: userDetail.email - });*/ + var by_date = ''; + var ii=0, dates_len = report['by_date'].length; + for (var ii=0; ii < dates_len; ii += 1) { + var dd = report['by_date'][ii]; + by_date += '
'+dd[0]+'
'; + by_date += '
'+dd[1].toString()+'
'; + by_date += '
'; + } + var template = context.JK.fillTemplate($('#template-account-affiliate').html(), { + total_count: report['total_count'], + by_date: by_date + }); + $('#account-affiliate-content-scroller').html(template); } /****************** MAIN PORTION OF SCREEN *****************/ // events for main screen function events() { - //$('#account-identity-content-scroller').on('click', '#account-edit-email-cancel', function(evt) { evt.stopPropagation(); navToAccount(); return false; } ); } function renderAffiliateReport() { diff --git a/web/app/views/clients/_affiliate_report.html.erb b/web/app/views/clients/_affiliate_report.html.erb index 5386d9e31..46d04308a 100644 --- a/web/app/views/clients/_affiliate_report.html.erb +++ b/web/app/views/clients/_affiliate_report.html.erb @@ -15,7 +15,6 @@
- AFFILIATE
@@ -26,7 +25,13 @@