mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 16:28:01 -05:00
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:
@@ -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 = {}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user