diff --git a/r2/r2/templates/promotelinkform.html b/r2/r2/templates/promotelinkform.html index 9cb16c0bb..eaffd70b5 100644 --- a/r2/r2/templates/promotelinkform.html +++ b/r2/r2/templates/promotelinkform.html @@ -74,202 +74,7 @@ ${self.javascript_setup()}
%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. -

-
- -
+ ${campaign_dashboard()} %endif
@@ -279,127 +84,19 @@ ${self.javascript_setup()} <% trusted = c.user_is_sponsor or c.user.trusted_sponsor + editable = trusted or not promote.is_promoted(thing.link) %> - <%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

-
- + ${title_field(thing.link, editable=editable)} + ${url_field(thing.link, editable=editable, enable_override=c.user_is_sponsor)} - <%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 thing.link and editable: + ${image_field(thing.link)} + ${commenting_field(thing.link)} - %if c.user_is_sponsor: - - - -
-

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

-
+ %if trusted: + ${media_field(thing.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="${getattr(thing.link, 'thumbnail_url', '')}" - label="${_('upload header image:')}" - ask_type="True"> - - - ## overwrite the completed image function - - - -
-
- - - <%utils:line_field title="${_('options')}" id="commenting-field" - css_class="rounded"> -
- ${checkbox("disable_comments", _("disable comments"), getattr(thing.link, 'disable_comments', False))} -
-
- -
-

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. @@ -431,6 +128,331 @@ ${self.javascript_setup()} ${self.right_panel()}
+<%def name="title_field(link, editable=False)"> + <%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

+
+ + + +<%def name="url_field(link, editable=False, enable_override=False)"> + <%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 enable_override: + + + +
+

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

+
+ %endif + + + +<%def name="image_field(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="${getattr(link, 'thumbnail_url', '')}" + label="${_('upload header image:')}" + ask_type="True"> + + + ## overwrite the completed image function + + + +
+
+ + + +<%def name="commenting_field(link)"> + <%utils:line_field title="${_('options')}" id="commenting-field" + css_class="rounded"> +
+ ${checkbox("disable_comments", _("disable comments"), link.disable_comments)} +
+
+ +
+

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

+
+ + + +<%def name="media_field(link)"> + <%utils:line_field title="${_('media')}" id="media-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(link, "media_override", False) or False)} +
+ +
+ + + +<%def name="campaign_dashboard()"> +
+ <%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. +

+
+ +
+ + <%def name="right_panel()"> %if thing.link and c.user_is_sponsor: