Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0
Graphe des révisions

164 commits

Auteur SHA1 Message Date
akuma06
49d8ca0c01 Fix RSS Link (#1495)
Fix #1486
2017-09-04 08:11:16 +10:00
Eliot Whalan
dbb1d0e9c6 actually fix apidocs this time 2017-09-03 21:53:01 +10:00
Eliot Whalan
a64d342386 fix apidocs 2017-09-03 21:39:25 +10:00
akuma06
50a6e844db Fix adding tag form (nojs) + miscalleneous (#1468)
* Fix search Status
Should fix #1428 ?s=2 and others. Reason: the sql query wasn't correct when filtering (status >= ? = ?)

* Fix adding tag form (nojs) + miscalleneous
* Fix #1423 by checking http method before finding the tags.
* Form is now like other tags form
* New Middleware LoggedInMiddleware to protect routes to logged user only
* Display of Non-Accepted tags in torrent view improved by translating tagtype values

* Update tag.jet.html
2017-09-03 10:30:30 +10:00
kilo
5a184bfb50 "Alternating Colors" option in settings (#1440)
* Non-bold torrent name when using alternating background colors

* Add alternating colors for g.css

* Add alternating colors for classic.css

* Add alternating colors for tomorreuw

* Update classic.css

* Add alternating colors to settings page

* Add alt-colors class to tbody if enabled

* Add GetAltColorsFromRequest() function to get AltColors cookie value

* Create AltColors variable for usage in listing

* Make settings handle altColors input

* Add AltColors in user struct

* Returned the wrong variable here

* Turn function return value into bool

* Condition checks variable like a bool

* ditto

* better color for g.css

* even better color

* better

* Last change for g.css

* Improvement for tomorrow

* Update classic.css

* add alt-colors class to upload preview

* Add alt-colors to user profile

* more vivid color for g

* Fix typo

* Remove browser outline for refine when clicked on

* remove browser outline

* Fix rules that didn't apply and category icon being way too small on user profile thanks to usage of percentage

* Remove show-xs class for search inputs

* Turn refine button back into position: absolute to pin at very bottom of refine

* Alternating colors for g's trusted, remake & aplus

* Update tomorrow.css

* attempt at fixing travis

* test (will have to rollback that change)

* rollback

* will have to rollback

* will have to rollback

* will have to rollback

* will have to rollback

* add AltColors variable to template test

* rollback

* rollback

* rollback

* rollback
2017-08-30 15:21:45 +10:00
kilo
7c3b30035c Fix Markdown icons & fonts (#1442) 2017-08-29 21:00:51 +10:00
ewhal
489c3196c4 Fix pubdate hopefully (#1410) 2017-08-27 14:35:59 +10:00
ewhal
991b4635d0 fix base64 encoded imgs (#1407) 2017-08-27 13:53:06 +10:00
kilo
46d974b6c6 fix inline CSS not working (#1404)
* fix inline CSS not working

* fix inline JS not executing
2017-08-27 00:05:15 +10:00
akuma06
9f2f978660 Added Content-Security-Policy (#1400)
As per suggested in #1104 , I added a middleware that adds the http header.
2017-08-26 12:41:27 +10:00
akuma06
b3e3ec6083 Fix Navigation Admin Panel (#1398)
* Fix Navigation Admin Panel

* Fix broken html on reassign page

* fix user link in comment list

* Fix Unknown bytes

* Fix switch file upload/magnet

* fix modtools background white + width

* fix /mod/ redirection url

* Fix last torrents on modpanel

* empty torrent file input

* Add hidden class to h3
2017-08-26 12:15:28 +10:00
akuma06
eea581bae9 Removing SearchType and SearchOrder + Move to new date search behaviour (#1395)
* Update search.go

* Update helpers.go

* Update search.jet.html

* Update search.jet.html

* Removing SortOrder and SortType from template's Search struct. Since we already have them in main torrentParam search struct and we don't need to overwrite them.

* Replaced old date search filter behaviour
2017-08-26 11:24:25 +10:00
kilo
36b3920ef4 Fix theme toggle not working for logged-in users (#1390)
* Update user theme too in themeToggle.go

* Forgot a "
2017-08-23 08:25:40 +10:00
akuma06
c6168be8b1 Tag Search + Tests + Search slight refactor [DONE] (#1342)
* Tag Search + Tests + Search slight refactor

First commit improving search. Different struct have their own file with their tests. This way of separating struct by files is inspired by the go packages I've seen so far.

Added new behaviour as discussed in #1334

* fix fallback to ES

* Added some comments to explain PG fallback + log err moved

* Refactored search

Nearly fully covered
WhereParams struct has disappeared for Query struct instead
In DB model, we use an interface implementing Query struct methods

* 1rst Refactor of Tags (WTF already?!)

Prepare Tags for the refactored system. Now there will be descriptive tags for a particular release (ecchi, BDSM, ....) and typed tags.
Typed tags are tags relevant to all torrents and can be limited to some input value. For example, video quality is a typed tag limited to some values (hd, full hd, sd, ...). In the same way, anidbid is also a typed tag but doesn't have default values.

Furthermore, the location storage of tags have changed, now accepted descriptive tags are stored in the torrents table in the column "tags" and they are separated by commas.
In the opposite, accepted typed tags can have have their own column in the torrents table. For example, anidbid, vndbid will populate the column DbID when accepted. On the other hand, videoquality will populate the same way as descriptive tags.

This behaviour depends on the callbackOnType function in tag/helpers.go

* fix for modtools :')

* Added anidb, vndb, dlsite & vmdb id fields in torrent model.
Tags don't have an accepted field anymore.
Accepted Tags are in torrent.AcceptedTags and non-accepted ones in torrrent.Tags.

New Helper + New Changelog for translation string.

* New upload/edit form for torrent tags.
Now the inputs are dynamically generated by the helper tag_form.
No more modal window in those form, only inputs.
Support of tags in API
New translation string for the  link to the modal on torrent view.
More comments in the functions for tags

* Improving how config for tags work. Adding a test on them with understandable messages.
Config for tags have now a Field attribute which is linked to the Torrent model. For example anidbid tag type has now a AnidbID field in config which is the name of the field in torrent model (AnidbID). Every new tag type need to have a field attribute with its counterpart in torrent Model.
Fixing some errors

* Fix compile error + Tests Errors

* Improve performance by caching the list of tags with an index
Adding/removing tags works/tested
New translation strings

TODO: test/fix adding tag on upload/edit

* Mini fix to display video quality
+ tags works/tested on modo edit

* Fix editing tags on modpanel

* Edit tags works

* Add translation string

* Add search backend for tags.
?tags=xxx,eee,ddd
?anidb=21
?vndb=23
?vgmdb=24
?vq=full_hd

* Fix Ajax tag Removal&Add

* Added form for descriptive tags

* Forgot to add the link between database and form for descriptive tags.

* Adding the increase/decrease pantsu for descriptive tags

* Fix #1370

* When you actually forgot to commit files after having forgotten commits
2017-08-22 11:48:10 +10:00
akuma06
6247646492 How-To Controller (#1386) 2017-08-22 11:02:22 +10:00
kilo
1a0f8e6604 Add failsafe to prevent theme1 & theme2 being dentical at time (#1385)
* Add failsafe for theme toggle

* remove unneeded /
2017-08-22 10:49:43 +10:00
kilo
bda181ee54 Add toggle dark theme for non-JS users (#1381)
* Add themeToggle handler to router.go

* Create themeToggle/router.go & ThemeToggle.go

* Add link to /dark in footer, remove display = none on toggle dark mode

* Remove JS that ordered toggle dark mode link to show as it is now constantly visible

* Rollback to fix errors

* Add some comments

* Create redirectUrl variable & set it's content then use it to redirect user

* Remove useless log

* Remove usage of fmt

* Add redirect get parameter to toggle link

* Add another url for toggleTheme

* wooo

* Update base.jet.html

* Update base.jet.html
2017-08-21 10:48:17 +10:00
kilo
199d2b3b85 Add "sort by" inputs in refine on low res (#1369)
* Add HTML for sorting by name etc

* Add CSS to hide inputs for sorting in refine

* Set value of SortOrder on true if on true (wew)

* Add SortOrder & SortType variables

* change translation strings

* add translation strings

* forgot a missing { and change ascending value
2017-08-14 15:56:45 +10:00
ewhal
445374242f Merge pull request #1327 from NyaaPantsu/pr/1242
Announcement [done]
2017-08-03 21:23:05 +10:00
PantsuDev
71b033ccb4 Fix incorrect rfc date format 2017-08-03 12:49:06 +10:00
akuma06
8ee746ebde fix redirection after announcement delete 2017-08-03 03:55:44 +02:00
akuma06
a7a670041a Fixing issues on id when create announcement 2017-08-03 03:54:33 +02:00
akuma06
1dbfe1b3b4 Added moderation part + tests 2017-08-03 03:38:07 +02:00
kilo
a6a7f26a42 Keep search content and keep refine open in no_results page (#1319)
* Update search.go

* Improvement

You don't actually need to set a variable type. Golang infers it from the right side of the equal :).
I needed in templates to do that since I need to use it in conditions. But since you removed the condition, it's not necessary
2017-08-02 19:34:17 +02:00
akuma06
d0a647bf8e fix travis error 2017-08-02 18:04:44 +02:00
akuma06
78f8b90129 Added comments on mod route +delete all tags link (#1316) 2017-08-02 15:06:34 +02:00
akuma06
0db143d685 Possibility to add tags from edit panel + upload 2017-08-01 23:38:13 +02:00
akuma06
bd959764f3 fixed counter 2017-08-01 15:38:09 +02:00
akuma06
b16e76d0b6 Fix for ajax query + uniformize api response 2017-08-01 14:47:27 +02:00
akuma06
93a2c5b98e add validator package 2017-07-31 03:23:21 +02:00
akuma06
6e5be0f7f1 Tags no-js works + less sql in Development mode + debug tool 2017-07-31 03:15:37 +02:00
akuma06
fe2c128e44 Added form to add tags on view 2017-07-30 03:29:09 +02:00
akuma06
d2339e9a43 Merge branch 'dev' into tags 2017-07-30 02:16:38 +02:00
akuma06
5c375db112 New network test + fix import 2017-07-30 02:16:14 +02:00
akuma06
7bb008cb19 Fix for userID = 0 was current user 2017-07-29 18:42:02 +02:00
akuma06
51d7fe2ef7 Added html views + fix template test + View & JSON Controller 2017-07-29 14:43:12 +02:00
akuma06
62ea1aaf10 Adding tag post controller 2017-07-29 14:41:56 +02:00
akuma06
590ebbf0d8 Fix filesize bug 2017-07-29 12:48:43 +02:00
akuma06
f62bd4f638 fix trusted status + locked status on upload 2017-07-28 23:54:18 +02:00
akuma06
03ea72595d OAuth API [done] (#1275)
* Initial Commit for OAuth API

This builds and run and return the right error.
Need to test it and then adding all users as possible client

* Added mising dependency

* just compile already...

* Fixing template test

* Imrpovements

Moved db stuff in models
Added some tests
Added form in modpanel to add/update a client
Added controllers for add/update of client

* Added Forms + speed improvements

Controller oauth client listing + html
Controller oauth client delete + messages
Messages on comment delete
New ES config that disable ES if set to false. Improve load speed on local development
Fix a load config bug
Fix index admin & translation string sign_out broken by @ewhal

* Sanitize empty strig in form array + css

Multiple empty array of strings are sanitized for the oauth client create form
Added some css for the form display

* Upload and Create form works

* Fix splitting response types

* Removing required on secret when updating

* fix travis error

* Fix travis template test

* Update dependency

* Moved to jinzhu instead of azhao

* randomizen secret on creation

* Final touch on oath api

improved display name
fix grant form csrf
fix login csrf on oauth

* Fix gorm test

* fix template test

* Fixing deleted dependency issue

* Make travis faster

* Fix typo

* Fix csrf for api calls

* This shouldn't be exempt

* Removing hard coded hash

@ewhal Don't forget to replace the hash in tokens.go with another one

* Added an example on how to use OAuth middleware

* Renamed fosite utils to oauth2 utils
2017-07-28 13:46:40 +10:00
kilo
ef25eddfd6 Editing a torrent now redirects to torrent view page (fix #1282) (#1286)
* fix #1282

* Update edit.go

* Update view.go

* Update view.go
2017-07-26 11:59:46 +10:00
PantsuDev
d9142a73c3 Fix most go lint warnings 2017-07-23 15:50:18 +10:00
akuma06
69123d53a9 Updated APIdoc + New API endpoint for user profile
Now you can access a user __public__ profile by querying the api endpoint /profile?id=USERID
2017-07-22 17:21:14 +02:00
akuma06
b5746d473f Second fix on api
The api waited for a post value instead of a get one
2017-07-22 16:14:38 +02:00
akuma06
df459594d3 Merge branch 'dev' of https://github.com/NyaaPantsu/nyaa into dev 2017-07-22 16:05:42 +02:00
kilo
3807c6937d No results template & image (#1263)
* Create no_results.jet.html

* no_results

* Delete Non Non Biyori Repeat - 10 [BDRip 1920x1080 x264 FLAC].mkv_snapshot_12.37_[2017.07.22_14.16.50].jpg

* Add files via upload

* Delete no_results.png.jpg

* Add files via upload

* Update en-us.all.json

* Update no_results.jet.html

* Update search.go
2017-07-22 16:05:11 +02:00
akuma06
2f1660127b Fix Api login errors not showing 2017-07-22 16:03:41 +02:00
akuma06
b797b7aacf Fix categories on sukebei 2017-07-22 02:41:28 +02:00
akuma06
83f730dbf2 Fix #1251 by implementing the page parameter in the url.
Now /p/xx works but also ?page=xx in api search/index
2017-07-20 23:06:20 +02:00
akuma06
d423468491 Update api to 1.1.0 2017-07-20 20:55:28 +02:00
akuma06
c5b3702fcd Fix #1251
Removed the old search parameter on /api.
Fixed issue with navigatation.
Fixed issue with notifications.
Fixed issue with fake anonymous upload on search with userID.
Fixed issue with number of upload on user page.
Moved api to version 1.1.0 with search displaying same as /api
2017-07-20 20:21:57 +02:00
akuma06
8cb217eb33 Remove unused variable 2017-07-20 13:35:21 +02:00
akuma06
b3a8471ac4 Fix notification issue.
Fix #1246
2017-07-20 13:33:50 +02:00
akuma06
9fdb749e61 Add back limit of torrents in profile to 20 and also fix issue with number of torrent uploaded maxed to 50 2017-07-20 00:38:23 +02:00
akuma06
e98ce1d318 Fix #1199 by converting a model to a map of interface 2017-07-17 21:32:55 +02:00
akuma06
ff35c500dd Renaming static.go to router.go for consistency 2017-07-16 17:19:40 +02:00
akuma06
2c8344faf9 Controllers are now separated
They are in different folders and all loaded in controllers/router.go.
This means that you only have to create a folder with a router.go file and import this folder in main router.go to add a handler.
2017-07-16 17:14:21 +02:00
akuma06
296e5f8e06 Merge branch 'refactor' into template-refactor 2017-07-16 15:38:18 +02:00
akuma06
2f7a6b8c45 Template rafactor
Now templates go files are in /templates in a templates package. Controllers only have controller files
2017-07-16 15:35:24 +02:00
ewhal
8b2b8e83e2 Merge pull request #1205 from Kiloutre/patch-5
fix 500 error in settings & some other things
2017-07-16 21:02:49 +10:00
PantsuDev
79f0213345 Fixes #1206 2017-07-16 20:40:28 +10:00
ewhal
c1acbdb2ff Merge branch 'refactor' into patch-5 2017-07-16 20:21:00 +10:00
PantsuDev
669edce070 Direct to torrent after comment 2017-07-16 10:59:25 +10:00
akuma06
8f7113a3e6 Fixing great bug on vars jetMap 2017-07-16 00:51:13 +02:00
akuma06
8641d8fd61 Fixing template tests 2017-07-16 00:38:07 +02:00
akuma06
3165f279af Fixing test issue 2017-07-16 00:23:11 +02:00
kilo
3ba989706c fix settings 2017-07-15 22:15:12 +02:00
akuma06
c10c1e86ae Fix for hideUser 2017-07-15 01:44:09 +02:00
kilo
6f88ff35ad Update template_functions.go 2017-07-14 19:58:16 +02:00
akuma06
405df46cf0 Use of flaglist in search.jet.html 2017-07-14 18:32:07 +02:00
akuma06
65a2cc2d1c Fix registration form 2017-07-14 16:53:58 +02:00
akuma06
f1a5e6b10d improved further test templates with fake datas 2017-07-13 19:45:09 +02:00
akuma06
8122015a2e Fixing registration + Added a log on request errors 2017-07-13 18:05:53 +02:00
akuma06
bd71ca6d41 Fix Hant css flag 2017-07-13 13:33:37 +02:00
akuma06
fbb578b800 Fixing issues with language name translation 2017-07-12 12:04:20 +10:00
akuma06
21767877b1 Fixing call to flag method 2017-07-12 12:04:20 +10:00
akuma06
e1d6e7df20 Changing to the new behaviour of package languages 2017-07-12 12:04:20 +10:00
akuma06
f8de340265 Added search refine on every pages + fixed kilo.js 2017-07-10 15:24:52 +02:00
akuma06
713ab02450 Added configor as a new library (#1126)
* Added configor as a new library

Now config is a singleton. You only need to do config.Get() instead of doing config.Conf.

* Forgot godep save 🐤

* Fix accidental removal of }
2017-07-10 22:11:05 +10:00
kilo
06442da77f Fix wrong JS variable name & some css stuff (#1151)
* Update main.js

* remove workaround that doesn't work

* Update torrents.jet.html

* Update search_handler.go

* Update search.jet.html

* Update main.js

* Update main.js

* Update search_handler.go

* Update main.js
2017-07-10 17:33:26 +10:00
akuma06
2bf9b26dfd Fix comments 2017-07-09 16:21:34 +02:00
akuma06
105bbbd181 API Documentation (#1131)
* API documentation

Using apiDocjs to generate it.
When updating API, you should back up all old comments of the api in _apidoc.json under the History comment

* Update rss handler

* API documentation done
2017-07-09 22:53:52 +10:00
akuma06
93ec394d0a Hiding refine only on home page 2017-07-07 01:20:00 +02:00
akuma06
4e3221f69e Fixing navigation pages 2017-07-07 00:27:08 +02:00
akuma06
bee64decb7 Fixing cache + fixing /search/search bug 2017-07-06 23:54:21 +02:00
akuma06
11b7ef4581 Added error on maximum pages 2017-07-06 23:28:40 +02:00
akuma06
b980ff8fc8 Reverting changes on nav.Route
Changed error 500 to 404
2017-07-06 23:27:11 +02:00
akuma06
03ded2e027 Changing catSelect Behavior
Return now Categories object instead of map[string]string.
Remove some debug log
2017-07-06 22:19:44 +02:00
akuma06
e54a2e59e2 Fixed alphabetical order for languages and categories
Also improved the name of exported functions for categories
2017-07-06 21:53:13 +02:00
PantsuDev
c2fe8aa99e Fix /search/search bug 2017-07-06 11:56:52 +10:00
akuma06
7a12d0807c Caching of torrent listing and torrent view 2017-07-05 17:06:24 +02:00
akuma06
1a4b1b3303 Added protection on pprof
Use of our own pprof handlers
2017-07-05 15:17:59 +02:00
akuma06
7e22828cb3 Change to our own middleware for pprof 2017-07-05 14:40:05 +02:00
akuma06
c8272b180b Changed search functions name
Removing the search part of it since it is already the package name
2017-07-05 13:33:12 +02:00
akuma06
1e39f7df6b Fixed csrf in mod 2017-07-04 03:09:12 +02:00
akuma06
920e4069a1 Modified img size of error pages 2017-07-04 03:02:19 +02:00
akuma06
e4d4878d64 Added Missing test 2017-07-04 02:54:43 +02:00
akuma06
d74d337c25 Adding redirecto when login 2017-07-04 02:48:20 +02:00
akuma06
d4c245e256 Fixing torrent edit for user&admin 2017-07-04 02:40:54 +02:00
akuma06
330ab06597 Adding upload of multi lang full support 2017-07-04 02:07:25 +02:00