mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-05 03:00:15 -04:00
promotelinkform: clean up usage of id36 and fullname.
This commit is contained in:
@@ -380,14 +380,14 @@ class PromoteController(ListingController):
|
||||
else:
|
||||
form.set_html('.status', _('refund not needed'))
|
||||
|
||||
@validatedForm(VSponsor('link_id'),
|
||||
@validatedForm(VSponsor('link_id36'),
|
||||
VModhash(),
|
||||
VRatelimit(rate_user=True,
|
||||
rate_ip=True,
|
||||
prefix='create_promo_'),
|
||||
VShamedDomain('url'),
|
||||
username=VLength('username', 100, empty_error=None),
|
||||
l=VLink('link_id'),
|
||||
l=VLink('link_id36'),
|
||||
title=VTitle('title'),
|
||||
url=VUrl('url', allow_self=False, lookup=False),
|
||||
selftext=VSelfText('text'),
|
||||
@@ -542,7 +542,7 @@ class PromoteController(ListingController):
|
||||
PromotedLinkRoadblock.remove(sr, sd, ed)
|
||||
jquery.refresh()
|
||||
|
||||
@validatedForm(VSponsor('link_id'),
|
||||
@validatedForm(VSponsor('link_id36'),
|
||||
VModhash(),
|
||||
dates=VDateRange(['startdate', 'enddate'],
|
||||
earliest=timedelta(days=1),
|
||||
@@ -550,7 +550,7 @@ class PromoteController(ListingController):
|
||||
reference_date=promote.promo_datetime_now,
|
||||
business_days=True,
|
||||
sponsor_override=True),
|
||||
link=VLink('link_id'),
|
||||
link=VLink('link_id36'),
|
||||
bid=VBid('bid', min=0, max=g.max_promote_bid,
|
||||
coerce=False, error=errors.BAD_BID),
|
||||
sr=VSubmitSR('sr', promotion=True),
|
||||
@@ -661,9 +661,9 @@ class PromoteController(ListingController):
|
||||
rc = RenderableCampaign.from_campaigns(link, campaign)
|
||||
jquery.update_campaign(campaign._fullname, rc.render_html())
|
||||
|
||||
@validatedForm(VSponsor('link_id'),
|
||||
@validatedForm(VSponsor('link_id36'),
|
||||
VModhash(),
|
||||
l=VLink('link_id'),
|
||||
l=VLink('link_id36'),
|
||||
campaign=VPromoCampaign("campaign_id36"))
|
||||
def POST_delete_campaign(self, form, jquery, l, campaign):
|
||||
if l and campaign:
|
||||
@@ -786,8 +786,8 @@ class PromoteController(ListingController):
|
||||
"""
|
||||
return "nothing to see here."
|
||||
|
||||
@validate(VSponsor("link_id"),
|
||||
link=VByName('link_id'),
|
||||
@validate(VSponsor("link_name"),
|
||||
link=VByName('link_name'),
|
||||
file=VUploadLength('file', 500*1024),
|
||||
img_type=VImageType('img_type'))
|
||||
def POST_link_thumb(self, link=None, file=None, img_type='jpg'):
|
||||
|
||||
@@ -444,10 +444,10 @@ function cancel_edit(callback) {
|
||||
}
|
||||
|
||||
function del_campaign($campaign_row) {
|
||||
var link_id = $("#campaign").find('*[name="link_id"]').val(),
|
||||
var link_id36 = $("#campaign").find('*[name="link_id36"]').val(),
|
||||
campaign_id36 = $campaign_row.data('campaign_id36')
|
||||
$.request("delete_campaign", {"campaign_id36": campaign_id36,
|
||||
"link_id": link_id},
|
||||
"link_id36": link_id36},
|
||||
null, true, "json", false);
|
||||
$campaign_row.children(":first").delete_table_row(check_number_of_campaigns);
|
||||
}
|
||||
@@ -548,9 +548,9 @@ function create_campaign() {
|
||||
}
|
||||
|
||||
function free_campaign($campaign_row) {
|
||||
var link_id = $("#campaign").find('*[name="link_id"]').val(),
|
||||
var link_id36 = $("#campaign").find('*[name="link_id36"]').val(),
|
||||
campaign_id36 = $campaign_row.data('campaign_id36')
|
||||
$.request("freebie", {"campaign_id36": campaign_id36, "link_id": link_id},
|
||||
$.request("freebie", {"campaign_id36": campaign_id36, "link_id36": link_id36},
|
||||
null, true, "json", false);
|
||||
$campaign_row.find(".free").fadeOut();
|
||||
return false;
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
###############################################################################
|
||||
|
||||
<%!
|
||||
from r2.lib.utils import to36
|
||||
from r2.lib.media import thumbnail_url
|
||||
from r2.lib.template_helpers import static
|
||||
from r2.lib import promote
|
||||
@@ -82,7 +81,7 @@ ${unsafe(js.use('sponsored'))}
|
||||
${campaign_dashboard()}
|
||||
|
||||
<div class="pretty-form" id="promo-form">
|
||||
<input type="hidden" name="link_id" value="${to36(thing.link._id)}"/>
|
||||
<input type="hidden" name="link_id36" value="${thing.link._id36}">
|
||||
|
||||
<%
|
||||
trusted = c.user_is_sponsor or c.user.trusted_sponsor
|
||||
@@ -202,7 +201,7 @@ ${self.javascript_setup()}
|
||||
current_image="${getattr(link, 'thumbnail_url', '')}"
|
||||
label="${_('upload header image:')}"
|
||||
ask_type="True">
|
||||
<input type="hidden" name="link_id" value="${link._fullname}" />
|
||||
<input type="hidden" name="link_name" value="${link._fullname}" />
|
||||
|
||||
## overwrite the completed image function
|
||||
<script type="text/javascript">
|
||||
@@ -294,7 +293,7 @@ ${self.javascript_setup()}
|
||||
class="campaign infotext rounded"
|
||||
method="post" action="/api/add_campaign">
|
||||
|
||||
<input type="hidden" name="link_id" value="${to36(thing.link._id)}"/>
|
||||
<input type="hidden" name="link_id36" value="${thing.link._id36}">
|
||||
|
||||
<%
|
||||
start_title = _("Date when your sponsored link will start running. We start new campaigns at midnight UTC+5")
|
||||
|
||||
Reference in New Issue
Block a user