Promote_Graph: Add predicted impressions

The admin view of Promote_Graph will now show the
predicted impressions. This also stubs out the
scheduled impressions.
This commit is contained in:
Keith Mitchell
2013-01-09 15:40:47 -08:00
parent 7c9d7930bb
commit 8545a7bf26
2 changed files with 25 additions and 1 deletions

View File

@@ -3590,6 +3590,16 @@ class Promote_Graph(Templated):
self.promo_traffic = dict(self.promo_traffic)
if self.admin_view:
predicted = inventory.get_predicted_by_date(None, start_date,
end_date)
self.impression_inventory = predicted
# TODO: Real data
self.scheduled_impressions = dict.fromkeys(predicted, 0)
else:
self.scheduled_impressions = None
self.impression_inventory = None
self.cpc = {}
self.cpm = {}
self.delivered = {}

View File

@@ -64,6 +64,18 @@ ${load_timeseries_js()}
</td>
%endfor
</tr>
%if thing.scheduled_impressions:
<tr>
<th>${_("SCHEDULED IMPRESSIONS")}<br/>
${_("INVENTORY")}</th>
%for date in thing.dates:
<td class="${"today" if date == thing.today else ""}">
${thing.scheduled_impressions.get(date, "---")}<br/>
${thing.impression_inventory.get(date, "---")}
</td>
%endfor
</tr>
%endif
<tr>
<th>
%if thing.admin_view:
@@ -73,7 +85,9 @@ ${load_timeseries_js()}
</th>
%for date in thing.dates:
<td class="${"today" if date == thing.today else ""}">
${thing.delivered[date]}<br/>
%if thing.admin_view:
${thing.delivered[date]}<br/>
%endif
${thing.cpm[date]}
</td>
%endfor