Commit Graph

5517 Commits

Author SHA1 Message Date
MelissaCole
42f9fa74a6 Fix validator bug for promotions in disabled ad subreddits 2015-02-24 15:23:34 -08:00
adam
5e407807a2 PromoteReport: add totals row to campaign report 2015-02-24 15:16:25 -08:00
Neil Williams
1da41d8063 Don't include pixel tracker URL in response headers if not enabled.
If the tracker URL isn't configured, we shouldn't include the header in
the response.  This uses the same criteria (truthiness of g.tracker_url)
as the templates to determine whether or not to include the URL.
2015-02-24 14:58:19 -08:00
Keith Mitchell
946e721cbe Multi API: Flag for expanding (some) SR info 2015-02-24 14:51:00 -08:00
Florence Yeun
e8b52963e5 Remove duplicate hidden sr input 2015-02-24 12:02:59 -08:00
Florence Yeun
91b2059aa4 Subreddit settings: mobile settings
New subreddit fields for mobile, hidden behind feature flag.
Basic functionality with limited validation.

* community rules - list, no markdown
* related subreddits - list, no markdown
* key color - hex color

These fields are optional for `/api/site_admin`.
2015-02-24 12:02:46 -08:00
Florence Yeun
ff76c8fc0e Subreddit settings: mobile icon and banner
Upload and delete endpoints for new mobile subreddit icon and banner.

* icon - square, exactly 240x240px
* banner - 16:9 aspect ratio, min 640x360px, max 1280x720px
2015-02-24 11:58:02 -08:00
MelissaCole
a45218804b Remove check for lounge contributors
This is no longer necessary when /r/lounge is a gold_only subreddit
2015-02-24 11:53:57 -08:00
MelissaCole
c24a01497a Gold only subreddits
Users that have gold (or gold charter status) will be able to create and access
gold_only subreddits. Mods will be able to access gold_only status regardless of
their gold status. Approved submitters will not be able to access these subreddits.

To have a gold only subreddit, it must be created as gold only by a gold user or
have admin mode to convert it to gold only (requested via modmail to /r/reddit.com.
There is a default style (gold-only) applied to each gold_only subreddit.

Mods can choose to hide the sidebar adbox for gold-only subreddits. A "reddit gold"
('/subreddits/gold') tab is in '/subreddits' so that gold users can see all of the
gold only subreddits.

Being added as an approved submitter in gold_only and employee_only subreddits
don't allow you to see the subreddit. This will remove the link and ability to
edit the approved submitters so as to not confuse the mods.
2015-02-24 11:53:20 -08:00
powerlanguage
b1761f1cb4 Add gold only subreddit style. 2015-02-24 11:51:02 -08:00
powerlanguage
a5f1d2c1db Optimize subreddit interstitial pngs. 2015-02-24 11:50:56 -08:00
powerlanguage
61f701c3e1 Add gold only subreddit interstitial image. 2015-02-24 11:50:50 -08:00
Robert Ditthardt
80b55f6940 Multis: Make path for multireddit include user 2015-02-24 11:43:40 -08:00
Keith Mitchell
ab93da58da Update web interface for modifying multis
* Set description using the base model endpoint
* Add feature-flagged interface for setting:
  - key_color
  - icon
  - visibility == 'hidden'
2015-02-24 09:49:38 -08:00
Keith Mitchell
8b7903c080 Hidden multis: Move from sidebar to user page
Multis set to "hidden" will no longer be shown on the
user's sidebar. Instead, they'll be shown in a box
on their user page (only visible to that user).
2015-02-24 09:49:29 -08:00
Keith Mitchell
14087b336f Named Multireddit API updates
Named multireddit objects now show additional fields:
* description_md
* description_html (read only)
* display_name
* key_color
* icon_url (read only)
* weighting_scheme
* copied_from (read only, requires owner)

The "visibility" field can now also be set to "hidden" via the API. Hidden
multireddits will not be shown on a user's sidebar on reddit.com, but will
still be visible to API consumers.

The "copied_from" field shows the multi's owner which multireddit
they copied from.

A "weighting_scheme" of "fresh" will favor newer content, rather than
forcing there to be at least 1 post from each subreddit. "classic"
weighting will use the old format. Note: "fresh" weighting will be enabled
in a future commit.

"key_color" must be an RGB color of the form #AABBCC. API consumers can
choose to set and make use of the key_color field for style purposes.

"icon_url" may contain a URL to an icon for this multireddit. API
consumers can choose to make use of this icon for style purposes.

"display_name" is a human-friendly name for this multireddit. API
consumers can choose to make use of this field to set/display friendlier
names for this multireddit.

Description fields are now included in the base multireddit object, and
"description_md" can be updated directly on the multireddit object.
The separate description endpoint is still available.

All of the above fields can be modified via the existing endpoint,
PUT /api/multi/<multipath>, except for fields marked read only.

Due to the number of new fields and the absence of an existing PATCH
endpoint for /api/multi/<multipath>, the existing PUT endpoint
has been updated to NOT clobber fields that aren't included in the
multi JSON, and to accept "partial" multireddit objects. This is to
prevent fields from getting clobbered by clients that haven't been
updated to send all the new data.
2015-02-24 09:49:19 -08:00
Florence Yeun
6a0d5e31fb Hex color validator
To be used for upcoming new subreddit and multireddit configurations.
2015-02-24 09:49:00 -08:00
MelissaCole
abf40b7fed Allow creation of employee only subreddits
This will pull the people able to view/contribute from the employee list in
liveconfig. Mods are not automatically removed when removed from the liveconfig
and neither are approved submitters that are manually added. When a user is
removed from the employees_only list, they won't be able to see what they've
contributed in their history.

This also create an employees ('/subreddits/employees') tab in '/subreddits' so
that employees can view all of the employees only subreddits.

Only employees can create a subreddit that's employees_only. To change a subreddit
type from employees_only to something else, admin mode is required.
2015-02-23 21:44:57 -08:00
David Wick
dd82ca82bc Comment embeds: track embed views without PII
Use the anonymous event tracker on embed views to prevent sending
any personally identifiable information.
2015-02-23 18:09:57 -08:00
David Wick
3cef415158 Comment embeds: remove tracking logged in status
There is no way to do this that respects user's privacy.  HAProxy
logs could be merged to get user_ids and we don't want to expose
that.
2015-02-23 18:09:57 -08:00
David Wick
6fde06101d Comment embeds: add missing import 2015-02-23 18:09:57 -08:00
David Wick
9752b4dc47 Comment embeds: fix early closing body tag 2015-02-23 18:09:57 -08:00
David Wick
a400524cb5 Comment embeds: Add event pixel tracking 2015-02-23 18:09:57 -08:00
David Wick
ef1d38f4f7 Comment embeds: change footer bg color 2015-02-23 18:09:57 -08:00
David Wick
82090d9ce9 Comment embeds: fix reflow flicker in firefox
Firefox was returning a height of 0 when an iframe was hidden.
This was causing unnecessary reflows when toggling between the
options for comment embeds. There doesn't seem to be a good
reason to broadcast a 0 height up to the parent window, so
i've added a guard for that.
2015-02-23 18:09:57 -08:00
David Wick
400abd9435 Comment embeds: improve frame styles
This moves the margin, border-radius, and box-shadow to the iframe
itself so things don't have to be awkwardly inset.
2015-02-23 18:09:57 -08:00
umbrae
56774c2ea4 Split embed preparation into two stages to allow framing on 304s
Safari respects `X-Frame-Options` on 304s, causing embeds to break
if `c.allow_framing` is not set before we return a 304. This splits
embed prepping into two stages so that we can set `c.allow_framing`
before we check modified headers.
2015-02-23 18:09:57 -08:00
David Wick
3859ce58b6 Comment embeds: increased vertical padding of footer 2015-02-23 18:09:57 -08:00
David Wick
a78d6238d5 Comment embeds: remove dead/erroneous code 2015-02-23 18:09:57 -08:00
David Wick
d70b844093 Fix media_domain being treated as a 3rd party cname
When constucting urls to 3rd party cnames, for example,
"thecutelist.com" -> /r/aww, this forces the removal of the
`sr_path`.  This was unintentionally affecting pages served by
the `media_domain`, eg. comment & live embeds.
2015-02-23 18:09:57 -08:00
David Wick
491fa288a3 Comment embeds: fix deleted comment rendering
Comments with no replies should still show the message: "This
comment was deleted."
2015-02-23 18:09:56 -08:00
David Wick
9e0e078687 Comment embeds: Fix relative links
Relative links to reddit (username autolinks for example) should
go to reddit.com not the static domain.
2015-02-23 18:09:56 -08:00
David Wick
2bac44bd56 Comment embeds: remove tracking 2015-02-23 18:09:56 -08:00
David Wick
5eac2ba9ed Comment embeds: fix display when a user account has been deleted 2015-02-23 18:09:56 -08:00
David Wick
4898d11c77 Comment embeds: add missing translations 2015-02-23 18:09:56 -08:00
David Wick
773b4a1d19 Comment embeds: add/improve link instrumentation 2015-02-23 18:09:56 -08:00
David Wick
01b4d727e5 Comment embeds: comment links should include sr path 2015-02-23 18:09:56 -08:00
umbrae
c88c818b26 Add underline to links in embeds 2015-02-23 18:09:56 -08:00
David Wick
ef9609c9c1 Comment embeds: fix user link being in a sr context
This was causing custom style sheets to be applied to user pages
which has a tendency to break things.
2015-02-23 18:09:56 -08:00
David Wick
1a1fac7517 Comment embeds: visual improvements 2015-02-23 18:09:56 -08:00
David Wick
844c9154ff Add can_embed to wrapped Comment for rendercache
Similar to `can_save`, `can_embed` controls the visibility of the
embed button.  This needs to be apart of the `Comment` or else
the rendercache will use the wrong version on heavily cached
comments.
2015-02-23 18:09:56 -08:00
David Wick
de43277cec Add a link to reddit in the footer 2015-02-23 18:09:56 -08:00
David Wick
eace788771 Fix edit control
When a data attribute is missing it should be `false` not `null`.
2015-02-23 18:09:56 -08:00
David Wick
112c26dcdd Comment embeds: instrument w/hivemind 2015-02-23 18:09:56 -08:00
David Wick
df5b1e5e47 post-message.js: fix method overload 2015-02-23 18:09:55 -08:00
David Wick
26524c5e51 post-message.js: fix origin checking file: protocol 2015-02-23 18:09:55 -08:00
David Wick
dad6caa30c Comment embeds: add togglable help for edit control 2015-02-23 18:09:55 -08:00
David Wick
d667ffef24 Comment embeds: reduce reflow 2015-02-23 18:09:55 -08:00
xiongchiamiov
e29e727791 Comment embeds: add per-comment token
While in the process of rolling out comment embeds, we'd like to have restrict
our beta a bit - because by their nature, once embeds are out, we lose control
over them, making it extremely difficult to make changes.  So we're restricting
the embed generation modal to a certain subset of users (for now), but a savvy
user could simply modify an existing public embed to plug in another comment
id, which would defeat the point of restricting it.  Enter hmac.

We know generate a unique token for each comment, and only by using the
appropriate token will your embed work.  This will be transparent to users, as
its just another piece of the html that they copy and paste onto their website.

Performance-wise, we're generating tokens for every comment that can be
embedded.  However, for now that's a limited set, and the operation is pretty
fast (roughly 5ms for 1000 tokens on my dev VM); if that becomes a problem, we
can easily take this code out after we no longer need the restriction.
2015-02-23 18:09:55 -08:00
xiongchiamiov
e454857b31 add_sr: allow alternate domains for https pages
`add_sr()` has had, since reddit/reddit@b57dff70, a special-case when the
requested page was on https, where it would ignore whatever domain it would
normally set and use the current one instead.  As best as we can tell, this was
to prevent issues with a lack of https support on all reddit domains, eg links
on `https://pay.reddit.com` pointing to `https://www.reddit.com`.  This should
no longer be an issue.

Additionally, it has caused problems with the comment embeds, which are served
from `redditmedia.com` but need to have links pointing to `www.reddit.com`.

Now that this special-case doesn't exist, the function should act more
intuitively.  And hopefully that doesn't break anything too badly. :p

The request from the comment embed javascript to get the actual embed has been
going through `g.media_domain`.  This in turn meant that sometimes (namely,
when the embed was placed on an https page) the link to the comment was also
heading through the media domain.  While this works, we'd rather have users go
through the standard `www.reddit.com` domain for brand, caching, and probably
other infrastructure reasons.
2015-02-23 18:09:55 -08:00