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

87 commits

Auteur SHA1 Message Date
kilo
d1d4bf8e28 Remove hide ads options (#1536)
* Update base.jet.html

* Update settings.jet.html

* Update template.go

* Update publicSettings.go

* Update user.go

* Update settings.go

* Update main.js

* Update base.jet.html

* Update template_test.go

* Update en-us.all.json
2017-09-08 20:46:45 +02:00
kilo
70a865e49a Show message pinned at the bottom of the window warning of cookie usage to comply with EU law (#1506)
* Add global variable to template_test

* Add global variable related to EU cookie law

* Add GetEUCookieFromRequest function that checks if the EU cookie exists (to comply with EU law)

* Add div at bottom of page if no EU cookie set

* add styling in css

* Prevent message from showing up any more than once

* prevent cookie from being erased by resetCookies() function

* Fix wrong function return type

* shorter condition

* Import timeHelper

* Update template_test.go

* remove variable name

* Update template_test.go
2017-09-06 07:55:00 +02:00
Miiiiaaooooo
25e6fe2942 Ads enabled settings, ads in FAQ, ads actually in code (#1493)
* Update base.jet.html

* Remove inline styling, put whole thing into a div instead of center to be able to move it at other places at will

* Move inline styling in there & some adjustements that will need further tweaking

* Add GetAdsEnabledFromRequest() function

* Ads Enabled global var

* Need to add global var in test file for it to work properly

* AdEnabled handler in settings

* Create AdsEnabled var for users

* Check if user wants to hide ads

* change var name

* change var name

* change var name

* change var name

* var name changes

* Add ad enabled settings & put each indiviidual setting into a span

* add |raw

* add translation strings

* add ads to faq

* Remove <br> and add faq link

* Fix travis

* Fix wrong condition check

* exclude aldColors & hideAds cookie from deletion

* remove useless things

* Fix template_test.go

* No idea why that part got removed

* Forgot }}

* lower padding for ad container
2017-09-04 21:48:47 +10:00
kilo
26932b904a Make alt colors enabled by default for logged in users (#1483)
* Make alt colors enabled by default for logged in users

* Better background color for sukebei's h-user when focused

* Fix border not being shown

* Fix display of rules on Internet Explorer
2017-09-03 18:50:00 +10:00
akuma06
38d3e45ef4 Fix search Status (#1467)
Should fix #1428 ?s=2 and others. Reason: the sql query wasn't correct when filtering (status >= ? = ?)
2017-09-03 10:11:19 +10:00
kilo
095712a674 Make AltColors default (#1460) 2017-09-02 03:04:33 +02:00
akuma06
2982118ef8 Fix broken sub category search
Fix #1428
2017-09-02 02:22:27 +02: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
akuma06
195912d11f Change default struct of Tags in Search Struct (#1437)
Doing this makes it possible to use the method from ArrayString (Contains and Join).
Therefore:
* Tags.Join() would return a string of all the tags separated by commas
* Tags.Contains(str) would return a boolean on whether there is the str or not
2017-08-29 11:44:20 +10:00
akuma06
9bb26a7dbe Add username search (#1434)
* Add username search

Quite simple, you need to provide ?user=xxxx

* Add userID search + Changed name of input field

Now ?user=xxx can also search userID.
For that you need to prefix it with "#".
Example:
* ?user=akuma06 would search torrents based on username akuma06
* ?user=#123 would search torrents based on userID 123 (be aware that you have to encode the "#" in url format %23)

* Update search.jet.html (#1436)

* Update main.css (#1435)
2017-08-29 11:06:16 +10:00
akuma06
ed61de6276 Add bbcode support (#1433)
* Add bbcode support

Closes #687
As the issue suggested, I added bbcodes support to the forms.
Now we support basic bbcodes, markdown and html tags

* Add new dependencies
2017-08-29 09:56:44 +10:00
akuma06
5bb45bbd75 Cacheforpg (#1415)
* Added cache on PG query with results

+ Add a log info to say that ES is enabled

* Added log when ES is disabled too

* Added log info when cache is retrieved

+ moved notnull set variable with others

* Fix travis test :')
2017-08-28 09:15:57 +10:00
akuma06
53ba669ba6 Add remember me checkbox back (#1397)
I tried locally and I'm kept logged in. @ewhal check after update that you do have the same hash set in both nyaa and sukebei. If you do, just change the domain name (".pantsu.cat") in the functions getDomainName() to the subdomain. Because I don't see why it wouldn't work otherwise
2017-08-26 12:57:02 +10:00
akuma06
0e4f194b32 Exclude User Search argument (#1399)
Now you can exclude a particular user from search by putting in the url ?nuserID=xxxx
As asked in #528
2017-08-26 12:28:34 +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
1dbfe1b3b4 Added moderation part + tests 2017-08-03 03:38:07 +02:00
akuma06
a3731e2ba0 add messages system 2017-08-02 22:15:59 +02:00
akuma06
d0a647bf8e fix travis error 2017-08-02 18:04:44 +02:00
akuma06
0db143d685 Possibility to add tags from edit panel + upload 2017-08-01 23:38:13 +02:00
akuma06
b16e76d0b6 Fix for ajax query + uniformize api response 2017-08-01 14:47:27 +02:00
akuma06
6f983260ae Remove cache on empty results query 2017-07-31 19:25:09 +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
a8bc3887ba Initial tag system 2017-07-29 14:44:54 +02:00
akuma06
349a0a2347 Merge branch 'tags' of https://github.com/NyaaPantsu/nyaa into tags 2017-07-29 14:43:53 +02:00
akuma06
742dfa84fd Initial tag system 2017-07-29 14:41:53 +02:00
akuma06
c09beeefa2 Merge branch 'dev' into tags 2017-07-28 14:37:17 +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
akuma06
50d3b17f4b Merge branch 'dev' into tags 2017-07-27 23:31:00 +02:00
PantsuDev
cdabd79c03 Fix more style issues 2017-07-24 15:03:43 +10:00
PantsuDev
d9142a73c3 Fix most go lint warnings 2017-07-23 15:50:18 +10:00
akuma06
caa6d41d06 Forgot to delete log test 2017-07-22 02:42:52 +02:00
akuma06
b797b7aacf Fix categories on sukebei 2017-07-22 02:41:28 +02:00
akuma06
a69b0b4ead Fix issue with torrent magnet 2017-07-22 01:55:23 +02:00
akuma06
938bd27e3b Initial tag system 2017-07-22 01:14:16 +02:00
akuma06
c09d35f480 Fixing some issues 2017-07-21 02:13:41 +02:00
akuma06
4714c5c0f5 Improviong dynamic load of configs by putting only one variable one 2017-07-21 01:36:25 +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
6e63555a33 Forgot to commit those files 2017-07-19 21:40:44 +02:00
akuma06
ad2e80e3a7 Some fixes and add test on template functions 2017-07-19 21:33:07 +02:00
akuma06
e98ce1d318 Fix #1199 by converting a model to a map of interface 2017-07-17 21:32:55 +02:00
akuma06
ee95510242 Template refactor (#1212)
* Template rafactor

Now templates go files are in /templates in a templates package. Controllers only have controller files

* Fix template test. Forgot I moved ReassignForm
2017-07-16 17:20:35 +02:00
akuma06
c10c1e86ae Fix for hideUser 2017-07-15 01:44:09 +02:00
akuma06
7092e4fc36 Fixing win32.go 2017-07-14 23:53:12 +02:00
akuma06
64d9bfcded Fix for #1176 The query builder was querying with sub_category=0 when sub was not supplied 2017-07-14 19:08:02 +02:00
akuma06
6bbb2e9801 Preload User on find. Should fix the edit not showing up for anonymous.
Fix issue with hidden checkbox and remake one on chrome.
Refactor flag list on edit/upload form. Now a helper function in flags helper.
2017-07-14 17:53:37 +02:00
akuma06
80e681fad4 Fix for deleted torrents search with ES. 2017-07-14 16:14:38 +02:00
akuma06
07dcd96bc0 Replacing flag code function 2017-07-13 18:34:19 +02:00
akuma06
32315bc7bb Fixing form registration tests 2017-07-13 18:10:38 +02:00
akuma06
8122015a2e Fixing registration + Added a log on request errors 2017-07-13 18:05:53 +02:00