Commit graph

609 commits

Author SHA1 Message Date
SomewhatDamaged
24b9863699 Featured image API route (#18)
* Add route

`/api/v1/json/features`

Shows current featured image

* Add route

`/api/v1/json/features`

Shows current featured image.

* Removed binding

* Moving this file to a more appropriate name.

* Correctly named and placed

Correctly named and placed to match its module name

* Updated per review

* Changed as per review

Renamed to `PhilomenaWeb.Api.Json.FeaturedController`
Moved to `lib/philomena_web/controllers/api/json/featured_controller.ex`

* Updated route

Route `/api/v1/json/images/featured` now uses `PhilomenaWeb.Api.Json.FeaturedController`

* like this

Co-authored-by: liamwhite <liamwhite@users.noreply.github.com>
2020-01-05 20:09:45 -05:00
byte[]
a98e268195 use iolist 2020-01-05 13:12:01 -05:00
byte[]
816e54fa12 use the range appropriately 2020-01-05 13:05:39 -05:00
byte[]
af97bd1717 fix graph height calculation 2020-01-05 13:03:43 -05:00
byte[]
75b15a59b7 add upload graph to stats page 2020-01-05 12:55:10 -05:00
byte[]
11e908ef14 batch tagger should resolve aliases and implications 2020-01-03 10:43:41 -05:00
SomewhatDamaged
8e39c06940 Fix for distance (#16)
* Fix for distance

Fixes the `distance` to search not being passed through to `ImageReverse.images()`

`set_scraper_cache` passes the `distance` through into `params`
`create` normalizes and inserts the result into the params passed to `ImageReverse.images()`
`normalize_dist` checks if there is a `distance` set, adds a leading 0 to it (to account for values like `.5`, which would crash `Float.parse()`), and turns it back into a well-formatted string for `ImageReverse.images()`

* Fixed space
2020-01-03 10:37:20 -05:00
byte[]
7ee6bf379f apparently that was necessary 2020-01-02 19:00:47 -05:00
SomewhatDamaged
ae5bfe14e4 Add /forums API Endpoints (#14)
* Adding routes for /forums

Adding routes for new /forums endpoints

* New API Routes

`/forum`
`/forum/:forum_id`

* Add New API Routes

`/forums/:forum_id/topics/:topic_id/`
`/forums/:forum_id/topics/:topic_id/:post_id`

* Adds New API Routes

`/forums/:forum_id/topics`
`/forums/:forum_id/topics/:topic_id`

* Forum JSON formatter

* Updated

Correctly filters out things that should not be shown.

* Added topic JSON filter

* Added correct pagination

* Spacing and neatened

* Cleaned up

Consolidated queries and neatened up spacing.
Fixed name

* Removed unneeded aliases

* Cleaned up

Consolidated queries
Fixed spacing
Removed unneeded aliases

* Cleaned up

Spacing

* Cleaned up

spacing

* Depluralized

* Cleaned up

Removed space

* Removed extra spaces

* Removed extra spaces

* Removed extra spaces

* Removed preloads

* Cleaned up

Grouped clauses

* Consolodated further

* Cleaned up preloads

* Cleaned up

Preloads
consolidated clauses
grouped clauses

* Cleaned up

removed `id`
`locked`

* Removed topic_id

Not useful since the API client should already know it.

* More consolodation of terms

* Add total post count

* Removed unneeded variable

* Last cleanup, I swear.
2020-01-02 17:47:12 -05:00
Jeremy Tan Jie Rui
c4e6a988d4 Don't put UTF-8 in search URL (#15)
Also fix TeX-style quoting
2020-01-01 22:09:53 -05:00
byte[]
2e7937cbc3 ensure commission items are sorted by price 2020-01-01 21:36:06 -05:00
Luna D
0f4a231357
and also reposition "rankings" button 2020-01-01 17:52:06 -05:00
byte[]
574ff7d1d3 missing link to add listing item 2020-01-01 13:56:09 -05:00
byte[]
0da19674d1 reenable async commenting 2020-01-01 12:27:20 -05:00
byte[]
fb33238f72 fix error in search parser when using 0 for day/month, fix link to search syntax page on search form 2019-12-31 23:44:28 -05:00
byte[]
7000be9865 add parameter recoder to api tag controller 2019-12-31 23:22:35 -05:00
byte[]
b9ad5643dc stop generating enormous gif thumbnails for videos 2019-12-31 23:11:23 -05:00
Nebbie Zebbie
d783417608 Apply search param remembering for pagination fix to ban search too 2020-01-01 00:59:14 +00:00
byte[]
7473b92309 fix channel creation errors 2019-12-31 19:54:19 -05:00
SomewhatDamaged
9b22d2719a Adding /api/v1/json/comment/:id endpoint (#13)
* Add `/api/v1/json/comment/:id` endpoint

* Add controller for `/api/v1/json/comment/:id`

Add controller for `/api/v1/json/comment/:id` endpoint

* Fixes permissions

Now will show `403 forbidden` if a comment on a deleted image is requested.

* Fixed endpoint schema

Now conforms to endpoint schema

* Permission adjustment

Will prevent `user_id` and `author` from leaking in the event the image is `hidden_from_users`

* Permission lockout

Lockout of all data if destroyed.

* Lockout on destroyed_content

Return 404 when `comment.destroyed_content`

* Refactored for neatness
2019-12-31 18:25:11 -05:00
byte[]
f8f34c8245 update sort fields list 2019-12-31 17:21:06 -05:00
byte[]
4c82c90cea discard old parser 2019-12-31 14:56:38 -05:00
SomewhatDamaged
6ccb3f645a Corrects failure and redirect to main page (#12)
This stops a bug I noticed when a slug that doesn't match is given. This will correctly 404 rather than redirecting to front page.
2019-12-31 09:01:14 -05:00
byte[]
f5bd8e7614 add deletion/duplicate handling to api 2019-12-31 00:10:50 -05:00
byte[]
1c6387e847 further fixes to the dnp template 2019-12-30 23:03:44 -05:00
Nebbie Zebbie
5ee81ea85e Fix tag search so that it's preserved across pages 2019-12-31 01:23:04 +00:00
byte[]
45048d5015 validate that emails look like emails 2019-12-30 19:07:02 -05:00
byte[]
a5966ae287 allow admins to create dnp entries on arbitrary tags 2019-12-30 19:04:19 -05:00
byte[]
7503e48591 show hidden links on tag page, hidden status on profile page 2019-12-30 18:56:29 -05:00
byte[]
210aff26ab show image id in duplicate report cells 2019-12-30 18:39:02 -05:00
byte[]
982adb9ba5 reindex image after replacement 2019-12-30 18:33:20 -05:00
byte[]
0c7f13932b add deleted toggle to main search form 2019-12-30 18:32:24 -05:00
byte[]
dd5d553c0d include intensity data in image api response 2019-12-30 09:18:38 -05:00
byte[]
330e4ffb26 award overflow 2019-12-30 09:05:17 -05:00
byte[]
9be71b512d load comment replies when the comment is hidden and when the image is merged 2019-12-30 08:58:56 -05:00
byte[]
bf5158b60e poll votes admin 2019-12-30 08:32:41 -05:00
byte[]
2427d8d87c suppress diff table if reports list is empty 2019-12-30 07:55:59 -05:00
byte[]
4342978483 hides, vote tampering 2019-12-30 07:50:02 -05:00
byte[]
38c4e35bb7 bans view changes 2019-12-30 07:30:39 -05:00
byte[]
1225aced41 load tags before body is processed 2019-12-26 18:58:52 -05:00
byte[]
f443aa5386 fix a bunch of navigation weirdness 2019-12-26 17:43:32 -05:00
byte[]
689ce5cd5a change rules for bracketed links 2019-12-26 00:39:57 -05:00
byte[]
81b37e42ff add faster textile parser backend 2019-12-26 00:03:27 -05:00
byte[]
37836b2c30 more admin permissions 2019-12-25 16:10:56 -05:00
byte[]
567459bf48 avatars 2019-12-25 13:32:24 -05:00
byte[]
0981a1ba0b dynamic config 2019-12-25 11:56:19 -05:00
byte[]
860de7615f more info should be expanded by default 2019-12-25 09:21:50 -05:00
byte[]
1990e384da fix random endpoint and ensure search_records/4 is the only search_records exported 2019-12-24 18:09:35 -05:00
byte[]
620f316db8 break compile time dependencies for elasticsearch index usage 2019-12-24 16:14:42 -05:00
byte[]
18798d2e99 ensure the authenticated user is never persisted as a further safeguard against API CSRF 2019-12-24 12:15:30 -05:00