mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-05 03:00:15 -04:00
Separate live and complete on promotelinkform.
This commit is contained in:
committed by
Brian Simpson
parent
c72e43c03c
commit
7423c17b39
@@ -203,19 +203,22 @@ class RenderableCampaign():
|
||||
spent = "%.2f" % get_spent_amount(camp)
|
||||
cpm = getattr(camp, 'cpm', g.cpm_selfserve.pennies)
|
||||
sr = camp.sr_name
|
||||
live = camp._id in live_campaigns
|
||||
complete = (transaction and (transaction.is_charged() or
|
||||
transaction.is_refund()) and
|
||||
not live)
|
||||
|
||||
status = {'paid': bool(transaction),
|
||||
'complete': False,
|
||||
'complete': complete,
|
||||
'free': camp.is_freebie(),
|
||||
'pay_url': pay_url(link, camp),
|
||||
'view_live_url': view_live_url(link, sr),
|
||||
'sponsor': user_is_sponsor,
|
||||
'live': camp._id in live_campaigns}
|
||||
if transaction:
|
||||
if transaction.is_void():
|
||||
status['paid'] = False
|
||||
status['free'] = False
|
||||
elif transaction.is_charged() or transaction.is_refund():
|
||||
status['complete'] = True
|
||||
'live': live}
|
||||
|
||||
if transaction and transaction.is_void():
|
||||
status['paid'] = False
|
||||
status['free'] = False
|
||||
|
||||
rc = cls(campaign_id36, start_date, end_date, duration, bid, spent,
|
||||
cpm, sr, status)
|
||||
|
||||
@@ -349,7 +349,7 @@ $.set_up_campaigns = function() {
|
||||
.click(function() { view_campaign(tr) }));
|
||||
}
|
||||
/* once paid, we shouldn't muck around with the campaign */
|
||||
if(!tr.hasClass("complete")) {
|
||||
if(!tr.hasClass("complete") && !tr.hasClass("live")) {
|
||||
if (tr.hasClass("sponsor") && !tr.hasClass("free")) {
|
||||
$(bid_td).append($(free).addClass("free")
|
||||
.click(function() { free_campaign(tr) }))
|
||||
@@ -370,9 +370,10 @@ $.set_up_campaigns = function() {
|
||||
var d = $(del).addClass("d fancybutton")
|
||||
.click(function() { del_campaign(tr); });
|
||||
$(td).append(e).append(d);
|
||||
}
|
||||
else {
|
||||
$(td).append("<span class='info'>complete/live</span>");
|
||||
} else {
|
||||
if (tr.hasClass("complete")) {
|
||||
$(td).append("<span class='info'>complete</span>");
|
||||
}
|
||||
$(bid_td).addClass("paid")
|
||||
/* sponsors can always edit */
|
||||
if (tr.hasClass("sponsor")) {
|
||||
|
||||
Reference in New Issue
Block a user