diff --git a/r2/r2/templates/promotelinkform.html b/r2/r2/templates/promotelinkform.html index cc1a8406a..2c95d2fff 100644 --- a/r2/r2/templates/promotelinkform.html +++ b/r2/r2/templates/promotelinkform.html @@ -31,6 +31,7 @@ from r2.lib import js import simplejson %> + <%namespace file="utils.html" import="error_field, checkbox, image_upload" /> <%namespace name="utils" file="utils.html"/> @@ -38,9 +39,9 @@ ${unsafe(js.use('sponsored'))} <%def name="javascript_setup()"> - + ${self.javascript_setup()} @@ -65,426 +66,465 @@ ${self.javascript_setup()}
- -<% - title = _("create a promotion") if not thing.link else _("edit promotion") - %> -

${title}

- -%if thing.link: - ${thing.listing} -%endif - -
- -%if thing.link: -
- <%utils:line_field title="${_('campaign dashboard')}" id="campaign-field" css_class="rounded"> - -
-
-

This dashboard allows you to easily place ads on reddit. - You can target a specific community or simply run on the main - page. -

-
-
-
- - - - <% - start_title = "Date when your sponsored link will start running. We start new campaigns at midnight UTC+5" - end_title = "Date when your sponsored link will end (at midnight UTC+5)" - targeting_title = "name of the community that you are targeting. A blank entry here means that the ad is untargeted and will run site-wide " - newcamp_title = "click to create a new campaign. To edit an existing campaing in the table below, click the 'edit' button." - %> - - - - - - - - - - - - - -
duration - <% - mindate = thing.startdate - if c.user_is_sponsor: - mindate = thing.promote_date_today.strftime('%m/%d/%Y') - %> - - <%self:datepicker name="startdate", value="${thing.startdate}" - minDateSrc="date-min" initfuncname="init_startdate"> - function(elem) { - check_enddate(elem, $("#enddate")); - update_bid(elem); - } - - - - <%self:datepicker name="enddate", value="${thing.enddate}" - minDateSrc="startdate" initfuncname="init_enddate" min_date_offset="86400000"> - function(elem) { update_bid(elem); } - - - ${error_field("BAD_DATE", "startdate", "div")} - ${error_field("BAD_FUTURE_DATE", "startdate", "div")} - ${error_field("BAD_DATE", "enddate", "div")} - ${error_field("BAD_FUTURE_DATE", "enddate", "div")} - ${error_field("BAD_DATE_RANGE", "enddate", "div")} -
total bid - ${error_field("BAD_BID", "bid", "div")} - ${error_field("BID_LIVE", "bid", "div")} - $ - -
- targeting - - - -

minimum $20 / day

- - -

minimum $30 / day

- -
- - -
- - - - - -
-
-
- -
- - - - - - - - - -
startenddurationbidtargeting - -
- -

- You don't have any campaigns for this link yet. You should add one. -

-
- -
-%endif - -
+

${_("create a promotion") if not thing.link else _("edit promotion")}

%if thing.link: - + ${thing.listing} %endif -<% - trusted = c.user_is_sponsor or c.user.trusted_sponsor - %> -<%utils:line_field title="${_('title')}" id="title-field" css_class="rounded"> - - ${error_field("NO_TEXT", "title", "div")} - ${error_field("TOO_LONG", "title", "div")} -
-

A good title is important to the success of your campaign. reddit users are an intelligent, thoughtful group, and reward those who engage them

-
- -<%utils:line_field title="${_('url')}" id="url-field" css_class="rounded"> - - - ${error_field("NO_URL", "url", "div")} - ${error_field("BAD_URL", "url", "div")} - ${error_field("DOMAIN_BANNED", "url", "div")} - ${error_field("ALREADY_SUB", "url", "div")} -
-

Provide the URL of your ad. No redirects please!

-
- %if c.user_is_sponsor: - - -
-

Choose a different domain name to display on the site (the small grey text next to a link

-
- %endif - +
+ %if thing.link: +
+ <%utils:line_field title="${_('campaign dashboard')}" id="campaign-field" css_class="rounded"> -%if thing.link and (trusted or not promote.is_promoted(thing.link)): - <%utils:line_field title="${_('look and feel')}" - description="images will be resized if larger than 70 x 70 pixels" css_class="rounded"> -
- <%utils:image_upload post_target="/api/link_thumb" - current_image="${thumb}" - label="${_('upload header image:')}" - ask_type="True"> - - ## overwrite the completed image function - - -
-
- - <%utils:line_field title="${_('options')}" id="commenting-field" css_class="rounded"> -
- <% - clicks = views = 0 - disable_comments = False - if thing.link: - disable_comments = getattr(thing.link, "disable_comments", - False) - clicks = getattr(thing.link, "maximum_clicks", 0) or 0 - views = getattr(thing.link, "maximum_views", 0) or 0 - %> - ${checkbox("disable_comments", - _("disable comments"), disable_comments)}
- %if c.user_is_sponsor: - ${checkbox("set_maximum_clicks", - unsafe("maximum clicks: " + - "" % clicks), - clicks)}
- ${checkbox("set_maximum_views", - unsafe("maximum views: " + - "" % views), - views)}
- %endif +
+
+

+ This dashboard allows you to easily place ads on reddit. + You can target a specific community or simply run on the main + page. +

+
+
+
+ +
+ + + + <% + start_title = "Date when your sponsored link will start running. We start new campaigns at midnight UTC+5" + end_title = "Date when your sponsored link will end (at midnight UTC+5)" + targeting_title = "name of the community that you are targeting. A blank entry here means that the ad is untargeted and will run site-wide " + newcamp_title = "click to create a new campaign. To edit an existing campaing in the table below, click the 'edit' button." + %> + + + + + + + + + + + + + + + + +
duration + <% + mindate = thing.startdate + if c.user_is_sponsor: + mindate = thing.promote_date_today.strftime('%m/%d/%Y') + %> + + <%self:datepicker name="startdate", value="${thing.startdate}" + minDateSrc="date-min" initfuncname="init_startdate"> + function(elem) { + check_enddate(elem, $("#enddate")); + update_bid(elem); + } + + - + <%self:datepicker name="enddate", value="${thing.enddate}" + minDateSrc="startdate" initfuncname="init_enddate" + min_date_offset="86400000"> + function(elem) { update_bid(elem); } + + + ${error_field("BAD_DATE", "startdate", "div")} + ${error_field("BAD_FUTURE_DATE", "startdate", "div")} + ${error_field("BAD_DATE", "enddate", "div")} + ${error_field("BAD_FUTURE_DATE", "enddate", "div")} + ${error_field("BAD_DATE_RANGE", "enddate", "div")} +
total bid + ${error_field("BAD_BID", "bid", "div")} + ${error_field("BID_LIVE", "bid", "div")} + $ + +
targeting + + +

minimum $20 / day

+ + +

minimum $30 / day

+ + + +
+ + + + + +
+ + + + + + + +
+ +
+
+ + + +
+ + + + + + + + + +
startenddurationbidtargeting + +
+ + + +

+ You don't have any campaigns for this link yet. You should add one. +

+
+
-
-

Comments are a great way to get feedback from customers, and the reddit community is known for being vocal in comment threads.

-
- - %if c.user_is_sponsor or c.user.trusted_sponsor: - <%utils:line_field title="${_('media')}" id="commenting-field" css_class="rounded"> -
- - - x -

- - -

- ${checkbox("media-override", "media override (adds an onclick to the link to generate a drop-down rather than a link out)", getattr(thing.link, "media_override", False) or False)}
-
- %endif -%else: -
- By clicking "next" you agree to the Self Serve Advertising Rules. -
-%endif +
+ %if thing.link: + + %endif -
- <% - if thing.link: - name = "save" - text = _("save options") - else: - name = "create" - text = _("next") - %> - ${error_field("RATELIMIT", "ratelimit")} - - - ${error_field("RATELIMIT", "ratelimit")} - + <% + trusted = c.user_is_sponsor or c.user.trusted_sponsor + %> -
-
+ <%utils:line_field title="${_('title')}" id="title-field" css_class="rounded"> + + ${error_field("NO_TEXT", "title", "div")} + ${error_field("TOO_LONG", "title", "div")} +
+

A good title is important to the success of your campaign. reddit users are an intelligent, thoughtful group, and reward those who engage them

+
+ + + <%utils:line_field title="${_('url')}" id="url-field" css_class="rounded"> + + + ${error_field("NO_URL", "url", "div")} + ${error_field("BAD_URL", "url", "div")} + ${error_field("DOMAIN_BANNED", "url", "div")} + ${error_field("ALREADY_SUB", "url", "div")} +
+

Provide the URL of your ad. No redirects please!

+
+ + %if c.user_is_sponsor: + + + +
+

Choose a different domain name to display on the site (the small grey text next to a link

+
+ %endif + + + %if thing.link and (trusted or not promote.is_promoted(thing.link)): + <%utils:line_field title="${_('look and feel')}" + description="images will be resized if larger than 70 x 70 pixels" + css_class="rounded"> +
+ <%utils:image_upload post_target="/api/link_thumb" + current_image="${thumb}" + label="${_('upload header image:')}" + ask_type="True"> + + + ## overwrite the completed image function + + + +
+
+ + + <%utils:line_field title="${_('options')}" id="commenting-field" + css_class="rounded"> +
+ + <% + clicks = views = 0 + disable_comments = False + if thing.link: + disable_comments = getattr(thing.link, "disable_comments", False) + clicks = getattr(thing.link, "maximum_clicks", 0) or 0 + views = getattr(thing.link, "maximum_views", 0) or 0 + %> + + ${checkbox("disable_comments", _("disable comments"), disable_comments)} +
+ + %if c.user_is_sponsor: + ${checkbox("set_maximum_clicks", + unsafe("maximum clicks: " + + "" % clicks), + clicks)} +
+ + ${checkbox("set_maximum_views", + unsafe("maximum views: " + + "" % views), + views)} +
+ + %endif +
+ +
+

Comments are a great way to get feedback from customers, and the reddit community is known for being vocal in comment threads.

+
+ + + %if c.user_is_sponsor or c.user.trusted_sponsor: + <%utils:line_field title="${_('media')}" id="commenting-field" css_class="rounded"> +
+ + + x + +

+ + +

+ ${checkbox("media-override", + "media override (adds an onclick to the link to generate a drop-down rather than a link out)", + getattr(thing.link, "media_override", False) or False)} +
+ +
+ + %endif + + %else: +
+ By clicking "next" you agree to the Self Serve Advertising Rules. +
+ %endif + +
+ <% + if thing.link: + name = "save" + text = _("save options") + else: + name = "create" + text = _("next") + %> + + ${error_field("RATELIMIT", "ratelimit")} + + + ${error_field("RATELIMIT", "ratelimit")} + +
+ +
+
+ ${self.right_panel()}
<%def name="right_panel()"> - + %if thing.link and c.user_is_sponsor: +
+ %if thing.bids: + <%utils:line_field title="${_('bidding history')}" css_class="rounded"> -${self.right_panel()} + <% + from r2.models import Account, bidding + accounts = Account._byID(set(x.account_id for x in thing.bids), True) + %> -%if thing.link and c.user_is_sponsor: -
- %if thing.bids: - <%utils:line_field title="${_('bidding history')}" css_class="rounded"> - <% - from r2.models import Account, bidding - accounts = Account._byID(set(x.account_id for x in thing.bids), True) - %> - - - - - - - - - - - %for bid in thing.bids: - <% - status = bidding.Bid.STATUS.name[bid.status].lower() - %> - - - - - - - - - - %endfor -
dateusertransaction idcampaign idpay idamountstatus
${bid.date}${accounts[bid.account_id].name}${bid.transaction}${bid.campaign}${bid.pay_id}$${"%.2f" % bid.bid}${status}
- + + + + + + + + + + + %for bid in thing.bids: + <% + status = bidding.Bid.STATUS.name[bid.status].lower() + %> + + + + + + + + + + %endfor +
dateusertransaction idcampaign idpay idamountstatus
${bid.date}${accounts[bid.account_id].name}${bid.transaction}${bid.campaign}${bid.pay_id}$${"%.2f" % bid.bid}${status}
+ + %endif + +
+ <%utils:line_field title="${_('promotion history')}" css_class="rounded"> +
+ For correspondence, the email address of this author is + ${thing.author.email}. +
+ +
+ To check with authorize.net, + use CustomerID ${thing.author._fullname} when searching by batch. +
+ + + + + +
+ %for line in thing.promotion_log: +

${line}

+ %endfor +
+ +
+
%endif - -
- <%utils:line_field title="${_('promotion history')}" css_class="rounded"> -
- For correspondence, the email address of this author is - ${thing.author.email}. -
-
- To check with - authorize.net, use CustomerID - ${thing.author._fullname} when searching by batch. -
- - - - -
- %for line in thing.promotion_log: -

${line}

- %endfor -
- -
- -
-%endif -
+