Commit Graph

6142 Commits

Author SHA1 Message Date
Florence Yeun
6897766c59 CombinedSearch: Format numbers with commas
Add commas to subscriber counts, link scores, and comment counts using
`format_number()`.
2015-06-08 19:39:38 -07:00
Florence Yeun
c927f13dca CombinedSearch: Format numbers
Format subscriber counts, link scores, and comment counts using
`ungettext()`.

Conflicts:
	r2/r2/templates/searchresultsubreddit.html
2015-06-08 19:39:36 -07:00
Florence Yeun
f3e0619341 CombinedSearch: Hide subscriber count for private subreddits
Conflicts:
	r2/r2/templates/searchresultsubreddit.html
2015-06-08 19:38:56 -07:00
Matt Lee
3755cbbd4b CombinedSearch: Respect 'open in new window' preference. 2015-06-08 19:36:38 -07:00
Matt Lee
9a22fdf3d0 Fix NSFW and report stamp styles. 2015-06-08 19:36:38 -07:00
Matt Lee
306306b9c1 CombinedSearch: Always show header.
Since the search filter and sort menus have moved into the header, hiding it
after the first page means that users can only change the sort/filtering options
on page 1.
2015-06-08 19:36:37 -07:00
Matt Lee
f52c753ac4 CombinedSearch: Fix sort filter menus.
The js that controls the showing/hiding of the menus expect each dropdown
element to be the only instance amongst its siblings.  In other words, each
dropdown button and list must be wrapped in a container element for it to work
correctly.

Additionally, this moves the filter menus to the right side of the header for
better visibility.
2015-06-08 19:36:37 -07:00
Matt Lee
5d50fd2386 CombinedSearch: Fix for logged-out users. 2015-06-08 19:36:37 -07:00
Matt Lee
dcf464fc0d CombinedSearch: Don't show subscribe button if user can't subscribe. 2015-06-08 19:36:37 -07:00
Matt Lee
f5056b2391 CombinedSearch: Add private, restricted, and archived indicators to subreddits.
Conflicts:
	r2/r2/models/subreddit.py
2015-06-08 19:36:37 -07:00
Matt Lee
487ad93874 CombinedSearch: Show link flair. 2015-06-08 19:36:37 -07:00
Matt Lee
ab583f3931 CombinedSearch: Add clarifying text to search-in-subreddit link. 2015-06-08 19:36:11 -07:00
Matt Lee
670c742d69 CombinedSearch: Make search button use icon instead of text label. 2015-06-08 19:36:00 -07:00
Matt Lee
1f311f0402 CombinedSearch: Move post search filters into listing header.
Conflicts:
	r2/r2/controllers/front.py
2015-06-08 19:35:41 -07:00
Matt Lee
202c3c560c CombinedSearch: Don't inject subreddit path into external links. 2015-06-08 19:34:20 -07:00
Matt Lee
4521b235ec CombinedSearch: Add ref tags to search result links.
Conflicts:
	r2/r2/models/link.py

Conflicts:
	r2/r2/models/subreddit.py
2015-06-08 19:34:05 -07:00
Matt Lee
9fe1411fa9 Search: Add ref tag to search facet links. 2015-06-08 19:32:32 -07:00
Matt Lee
b523fa5867 Search: Add ref tag to links on search page. 2015-06-08 19:32:32 -07:00
Florence Yeun
2d9198f379 Search: Naive highlighting
An extra-simple version of client-side highlighting for new search.

Not supported:
- stemming
- multiple words
- phrases
- etc
2015-06-08 19:32:15 -07:00
Florence Yeun
09244ef11a Search: Restore subreddit results in search api 2015-06-08 19:32:02 -07:00
Matt Lee
f8dacf2c56 SubredditSearch: Implement new search design.
Adds new render classes for link and subreddit search results, a new stylesheet for
search, and new mako templates for the search result classes and the search listing.

Conflicts:
	r2/r2/controllers/front.py

Conflicts:
	r2/r2/controllers/front.py
	r2/r2/models/listing.py
	r2/r2/public/static/css/reddit.less
2015-06-08 19:31:40 -07:00
Matt Lee
9b056f8337 Wrap SubscribeButton template in a function.
So I can more easily render it with a different css class.
2015-06-08 17:10:40 -07:00
Matt Lee
bccbb38b1a SubredditSearch: Separate facets from SearchBar.
Conflicts:
	r2/r2/lib/pages/pages.py

Conflicts:
	r2/r2/lib/pages/pages.py
2015-06-08 17:10:28 -07:00
Jordan Milne
8c706a6b32 Use fuzzed score to determine submission visibility 2015-06-08 16:31:11 -07:00
Matt Lee
c9ad346e4a Expando: Move into separate module. 2015-06-08 15:32:33 -07:00
Matt Lee
f2f6878924 Cleanup: Remove unused 'authorize_embed' route. 2015-06-08 15:32:33 -07:00
Matt Lee
f775888fee ReadNext: Add ref tag to subreddit link in header. 2015-06-08 15:31:29 -07:00
Matt Lee
f3cb393c7d Markdown: Let really long links break to multiple lines. 2015-06-08 15:31:29 -07:00
Matt Lee
fe9fc1d2e0 Put facebook_app_id in live_config. 2015-06-08 15:31:29 -07:00
Matt Lee
467fa42139 Sharing: Don't use the short domain for sharing. 2015-06-08 15:31:29 -07:00
Matt Lee
a195d0b7ba Sharing: Add ref tag to share link. 2015-06-08 15:31:28 -07:00
Matt Lee
989b6ee653 Sharing: Don't change the share link's text when opening. 2015-06-08 15:31:28 -07:00
Matt Lee
b8d4681236 Add facebook_app_id to example.ini 2015-06-08 15:31:28 -07:00
Matt Lee
c20aef70ca Sharing: Force links to include the feature flag in the cache key. 2015-06-08 15:31:28 -07:00
Matt Lee
20bdb3bbd1 Sharing: Move feature check to view model. 2015-06-08 15:31:28 -07:00
Matt Lee
a1faad17b3 Sharing: Add the improved sharing UI.
Conflicts:
	r2/r2/public/static/css/reddit.less
2015-06-08 15:31:25 -07:00
Matt Lee
2776b306a7 ReadNext: Don't show score if score should be hidden. 2015-06-08 15:30:25 -07:00
MelissaCole
31b9c8c9c0 Fix gold infobar when not viewing self and gold expired
When pref_show_gold_expiration=True and the user doesn't have gold, the gold expiration
bar shows but is empty.
2015-06-08 11:42:51 -07:00
xiongchiamiov
457e9645db Share dialog: revamp throttling
Our throttling on the share dialog has been a bit odd.  We didn't allow you to
share more than once every `RL_RESET_MINUTES`, **unless** you have at least
`MIN_RATE_LIMIT_KARMA` in the subreddit you're sharing from.  Why was this tied
to the subreddit?  Who knows!

Rather than having a draconian limit and exempting some users from it, the rate
limits on sharing should now be at a reasonable level for everyone (and
configurable as we go with `RL_SHARE_AVG_PER_SEC`).  In addition, we're now
using the fairly new ratelimit library, which allows for burstable usage, so a
user who wants to share several things in a row but then goes back to normal
browsing is much less likely to get throttled.
2015-06-05 11:21:01 -07:00
xiongchiamiov
d945164b5d POST_share: refactor a little bit
Rather than have most of the body of the function inside an `else` block, let's
return on errors and make it a little bit flatter.
2015-06-05 11:19:03 -07:00
xiongchiamiov
98a92c975c Image previews: update censoring for nsfw variant
As we tried this out a bit, we found that the amount of pixellation we were
using wasn't really enough.  This should be better.
2015-06-04 10:58:07 -07:00
Chad Birch
869a3d2ee5 Improve the message sent for subreddit bans
This commit contains a number of improvements for the message sent to
users when they are banned from a subreddit:

* Message is different for temporary bans, and includes duration
* Includes information about being able to reply to the message, and the
  fact that circumventing a ban is considered a site rules violation
* Nicer formatting by blockquoting the note from the moderators
* Fixes the "phantom modmail notification" when someone is banned
* Refactored into separate function, which cleans up notify_user_added
2015-06-04 11:53:39 -06:00
Brian Simpson
5f38ad9079 CommentJsonTemplate: use new rendering technique.
This also changes MoreCommentJsonTemplate which was inherting from
CommentJsonTemplate.
2015-06-03 18:50:12 -04:00
Brian Simpson
e233058f07 Add new ThingTemplate base class.
This will be used to convert templates that inherit from
ThingJsonTemplate to do explicit (non looping) rendering that is
much faster.
2015-06-03 18:50:07 -04:00
Chad Birch
0236f5fd18 extract_user_mentions: return unique mentions only
This change was intended primarily to address an issue related to
duplicate username mentions - each individual mention was being counted
towards the per-comment limit, instead of it only counting mentions of
different users. So mentioning the same user 4 times in a comment would
cause butler to bail out instead of sending a mention to that user.

So this makes it so that extract_user_mentions now returns the
mentioned usernames as a set instead of a list, and also removes the
support inside the function itself for only returning up to a maximum
number of mentions. It is now up to the caller to worry about handling
the number of mentions returned (which actually simplifies things almost
everywhere this is currently being used).
2015-06-03 11:01:15 -06:00
zeantsoi
6c1b7c2093 Add query param for v on defenestration request 2015-06-02 12:12:59 -07:00
Chad Birch
909496cff3 AutoMod: don't approve things removed by mods
This was mostly already covered by the check in should_check_item that
makes AutoMod skip over items that have been removed by moderators, but
it didn't cover rules that triggered on a comment and used that to
approve the parent submission. Rules using that sort of check/action
would cause parent submissions that had previously been removed by
moderators to be re-approved, which isn't desirable.
2015-06-01 16:27:14 -06:00
Chad Birch
085ebb7f38 AutoMod: fix bug with "skipped" search checks
The variable that holds the result of attempting to match the search
check was not being reset for each individual check, so if a check was
skipped due to its fields being discarded, it would keep the same value
it had from a previous check.

In practice, this means that a check like this will not match on a link
submission to baddomain.com:

    url+body: "baddomain.com"
    ~body: "I'm an exception"

The match from the url check would still be present after the ~body
check was skipped, so this would end up causing the rule to be
considered unsatisfied, since the ~body check would seem to have matched
successfully.
2015-06-01 16:27:08 -06:00
Chris Stephens
e9d33b0d7e api: Allow multiple things to be passed to hide/unhide 2015-06-01 14:42:39 -07:00
MelissaCole
8e5a90741e Stripe: Add customer.source.updated event type
No further processing is needed for this type of event
2015-06-01 13:38:27 -07:00