Commit Graph

5524 Commits

Author SHA1 Message Date
Chad Birch
6812738ebe admin_ratelimit: replace with hook 2015-02-25 18:44:33 -07:00
MelissaCole
1f36ebb562 Fix gilding a user with creddits 2015-02-25 17:39:57 -08:00
umbrae
0850bd3044 Tracker: URL decode session cookie 2015-02-20 23:58:51 -08:00
MelissaCole
6cf527235c Prevent race condition during inline gilding
The gold-button submits the form at the same time that setGildingProperties is
called, so this disables the submit function and manually calls submit for
buttons that have a form parent (creddits and PayPal). This should prevent the
locked payment blob errors.
2015-02-25 13:05:19 -08:00
umbrae
ea5aa9c538 Tracker: add domain prefix to redirect domain 2015-02-20 21:49:46 -08:00
umbrae
76fb41a3f8 Tracker: add session tracking redirector
This adds in two redirects - `event_click` and `event_redirect` - `event_click`
to allow appending in a user ID to an event before redirect, if we require one,
and `event_redirect` to service a local evented redirect, similar to ad clicks.

`event_click` is necessary for tracking clicks from users on embeds, which are
served via redditmedia, and therefore are always anonymous. When a user clicks
through, we want to know who they were and redirect them on their way. Because
of the way we're using nginx to store events as an access log right now, this
means we'll need to use two redirects: one to append the session ID and
another to store the event with the proper session ID.
2015-02-20 21:23:09 -08:00
MelissaCole
1a352bfa20 Show error for creating gold only sr without gold 2015-02-24 16:33:25 -08:00
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