Gold goal: allow employees to see actual goals

This commit is contained in:
Chad Birch
2013-11-07 16:56:53 -07:00
committed by Neil Williams
parent c4e3c9fa35
commit e97767715d
2 changed files with 13 additions and 2 deletions

View File

@@ -4294,6 +4294,9 @@ class Goldvertisement(Templated):
revenue_goal_yesterday) * 100)
self.hours_paid = ServerSecondsBar.current_value_of_month()
self.time_left_today = timeuntil(end_time, precision=60)
if c.user.employee:
self.goal_today = revenue_goal / 100.0
self.goal_yesterday = revenue_goal_yesterday / 100.0
Templated.__init__(self)
class LinkCommentsSettings(Templated):

View File

@@ -26,7 +26,11 @@
<div class="goldvertisement">
<div class="inner">
<h2>${_("daily reddit gold goal")}</h2>
<h2
% if hasattr(thing, "goal_today"):
title="Goal = $${'%0.2f' % thing.goal_today}"
% endif
>${_("daily reddit gold goal")}</h2>
<div class="progress">
<p>${format_percent(thing.percent_filled / 100.0, locale=c.locale)}</p>
@@ -57,7 +61,11 @@
(${thing.time_left_today} from now).</p>
<div class="history">
<p>${_("Yesterday's reddit gold goal")}</p>
<p
% if hasattr(thing, "goal_yesterday"):
title="Goal = $${'%0.2f' % thing.goal_yesterday}"
% endif
>${_("Yesterday's reddit gold goal")}</p>
<div class="progress">
<p>${format_percent(thing.percent_filled_yesterday / 100.0, locale=c.locale)}</p>