Commit Graph

2728 Commits

Author SHA1 Message Date
Peter Bhat Harkins d806f7a60d enable page caching 2023-10-06 22:28:16 -05:00
Peter Bhat Harkins d316c3bcf5
Fix search failing test #1213 2023-10-06 19:16:58 -05:00
Peter Bhat Harkins bcf47356ca
re-fix search pagination #1217 2023-10-06 19:15:30 -05:00
Juan Vasquez 3ad1c3eedc Fix current page pagination
The page wasn't updated with the current page value, it allways was one.

```ruby
@search.to_param
=> { page: 1, what: "comments", ...}
```

Fixes https://github.com/lobsters/lobsters/issues/1208
2023-10-06 16:07:14 -06:00
Peter Bhat Harkins 230bc08f9d
Update git clone URL #1216 2023-10-06 11:01:31 -05:00
Nick Hammond 2cb2628293
Fix git clone URL
Update git clone url to the preferred github, git user style.
2023-10-05 16:02:19 -05:00
Juan Vasquez c060132eaa Fix search failing test
This PR is just for fixing the latest merge that introduces a failing
test.

When initializing a new Search model it has some default values,
specially the results_count one.
5338e5a4b3/app/models/search.rb (L42)

When doing Search.new({}, nil) in the ignore_searx method
5338e5a4b3/app/controllers/search_controller.rb (L30)

It takes the -1 value by default which in this if/else statement

5338e5a4b3/app/views/search/index.html.erb (L40)

is rendering this else block

5338e5a4b3/app/views/search/index.html.erb (L157-L167)

and that doesn't render the 0 results but it renders the Search hints:

if that is the decired behaviour then this PR is solving it.
2023-10-04 18:59:24 -06:00
Peter Bhat Harkins 9b6060041f placeholder for lobsters.dev 2023-10-04 12:20:00 -05:00
Peter Bhat Harkins 233d0c8b42 fix 2023-10-04 11:06:23 -05:00
Peter Bhat Harkins 099efa2274 configure hsts for preload 2023-10-04 10:57:25 -05:00
Peter Bhat Harkins 7acaf2d508 /about: break out examples of codebase use 2023-10-04 10:07:44 -05:00
Peter Bhat Harkins 2037b82d7e cache no longer needed since f489c8ae3 2023-10-04 08:37:02 -05:00
Peter Bhat Harkins 8f65acd2dd add super_diff for better test output 2023-10-04 08:31:39 -05:00
Peter Bhat Harkins 5338e5a4b3 ignore garbage searches from searx 2023-10-02 09:05:22 -05:00
Peter Bhat Harkins 4184d1e053 search: prevent potential sql injection 2023-10-01 17:56:39 -05:00
Peter Bhat Harkins 26f5a84cb4 sort deleted comments to bottom 2023-09-27 11:08:37 -05:00
Peter Bhat Harkins ea4edf3a26 RIP twitter 2023-09-27 07:42:41 -05:00
Peter Bhat Harkins 734476b73d bare searching for username; missing commenter explanation 2023-09-26 21:29:04 -05:00
Peter Bhat Harkins 078e454e37 give bad/malicious bots an error page instead of me a 500 email
I could change action_on_unpermitted_parameters to :log, but if someone is
doing weird things I'd rather be a little paranoid and drop the whole request
instead of ignore bits that aren't clear and try to proceed.
2023-09-26 10:33:55 -05:00
Peter Bhat Harkins 7d2dd9d347 search by commenter 2023-09-25 10:02:07 -05:00
Peter Bhat Harkins 9104efa999 explain why some searches are invalid 2023-09-25 09:49:28 -05:00
Peter Bhat Harkins c46ec5b84c search by story submitter 2023-09-25 09:10:16 -05:00
Peter Bhat Harkins 3c85bdca04
search: Use the page in pagination links
Fix #1208
2023-09-25 09:09:46 -05:00
sin-ack 6c7daa1fe2
search: Use the page in pagination links
Without this, all of the pagination buttons link to the current page.
2023-09-25 15:23:02 +03:00
Peter Bhat Harkins 81a36c837d search: operator for title searching 2023-09-23 15:42:09 -05:00
Peter Bhat Harkins 60837ba071 search: fix searching domains with numbers 2023-09-23 13:51:28 -05:00
Peter Bhat Harkins 62f1796a46 Markdowner outputs html 2023-09-21 10:44:11 -05:00
Peter Bhat Harkins e934c8f043 use raw less 2023-09-21 10:41:14 -05:00
Peter Bhat Harkins 740d989115 hat requests: make it easy to make things easier for me 2023-09-21 10:30:08 -05:00
Peter Bhat Harkins e3a51083d3 long dead code 2023-09-18 16:06:06 -05:00
Peter Bhat Harkins b767d9d6a9 add sidekiq 2023-09-18 16:00:53 -05:00
Peter Bhat Harkins 5647897a76 search urls 2023-09-16 09:25:22 -05:00
Peter Bhat Harkins 1f32209b58 fix short hyphenated terms in prod searches
We truncated to have leading or trailing punctuation, confusing mariadb's parser
about operator usage. 'foo-bar' is ok, but 'foo-' and '-bar' are not. After
testing, mariadb splits terms at '-' anywways.

Dropped the explicit allowal of '_' because it's included in \p{Word}.
2023-09-16 08:03:08 -05:00
Peter Bhat Harkins 2e1bed2f58 search: be helpful about ignored short terms, which includes language names 2023-09-15 22:31:22 -05:00
Peter Bhat Harkins d6c981f8d3 update sprockets for the Annual Asset Pipeline Breaks Prod festival 2023-09-15 21:20:58 -05:00
Peter Bhat Harkins 085f3be400 bump deps by removing old cve bump limitations 2023-09-15 13:13:55 -05:00
Peter Bhat Harkins dd4dfbc79d fix anchors on user tree 2023-09-15 12:49:12 -05:00
Peter Bhat Harkins 3590571f51 no idea why sleep_for_index isn't closing over the variable 2023-09-14 16:47:35 -05:00
Peter Bhat Harkins c3fe39e9bb everything is strings 2023-09-14 16:40:35 -05:00
Peter Bhat Harkins e60cfe6acc don't let late workers timeout at boot 2023-09-14 16:38:02 -05:00
Peter Bhat Harkins 25b5fbd51d fix puma dogpile at start/hot restart 2023-09-14 16:25:52 -05:00
Peter Bhat Harkins 4c27e12b54 don't return everything on empty input 2023-09-14 15:58:28 -05:00
Peter Bhat Harkins 3d30f48993 search: handle empty input 2023-09-14 15:47:19 -05:00
thiagofportella d23e8d799f
feat: display unsave link for previously saved stories 2023-09-14 15:15:52 -03:00
Peter Bhat Harkins f467d5e943 fix for searches with two apostrophes 2023-09-14 09:38:08 -05:00
Peter Bhat Harkins 46c343a956 standardrb: add standard-performance 2023-09-14 08:45:21 -05:00
Peter Bhat Harkins 237e219116 standardrb: add standard-sorbet 2023-09-14 08:45:21 -05:00
Peter Bhat Harkins df0e0f309b whoops, that's .inputrc - see lobsters-ansible repo 2023-09-14 08:45:21 -05:00
Peter Bhat Harkins b3d6903f05 standardrb: standard-rails 2023-09-14 08:45:21 -05:00
Peter Bhat Harkins c2935af068 remove last vestiges of rubocop 2023-09-14 08:45:21 -05:00