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

2285 commits

Auteur SHA1 Message Date
akuma06 7846d999ff No errors on api controllers 2017-07-02 18:00:12 +02:00
akuma06 97b3a1d7ea Remove common package
Common is no more a thing
Use of TorrentParam instead of SearchParam now
Common structs for search are exported in utils/search/structs
Util has been renamed utils
2017-07-02 16:54:55 +02:00
akuma06 188c196fd3 Removed some unused dependencies 2017-07-01 23:23:15 +02:00
akuma06 205daea027 Finally services are nearly empty 👍
Moved api services. All validations are now in validator util and all upload functions are in upload util
2017-07-01 23:09:35 +02:00
akuma06 1316062c9a Refactored user forms struct + tests 2017-07-01 19:44:36 +02:00
akuma06 b142ee75a4 The validator work
Tests are passed
2017-07-01 02:59:39 +02:00
akuma06 946f02d0fc Use of validator pkg now
Use of validator pkg replacing modelHelper.

ValidateForm adds translated errors in messages context. To know if we have errors, we have to call messages.HasErrors() after the validation check.

New translation strings for some field check. I didn't add every tag as an error since it seems we won't use them (isbn, ...). This would overload the translation files that are already big.
2017-07-01 01:25:11 +02:00
PantsuDev ba1f48b08c Fix typo'd variable 2017-06-29 21:20:52 +10:00
PantsuDev e139f5e4db Fix most compiler errors 2017-06-29 21:15:23 +10:00
akuma06 4c8306a6fc Too much file to save :') 2017-06-29 01:11:03 +02:00
akuma06 210bf84d13 Forgot to commitsave these files 2017-06-29 01:06:30 +02:00
akuma06 2646bc2db8 This is a prelimenary work
Showing how we can remove services, preventing cyclic imports and lessing the number of imports.
Now db is in models. Db and models are highly tightened, according to go standards, you should put them in the same package.
In models, there are folders separating the different methods used to modify the models. For example, if you want to create a user, you have to use /models (for the user struct) and /models/user (for creating a user.
However, if you want to delete a torrent, you just have to import /models and do torrent.Delete(definitely bool).

By the way packages in models are the plural name of a model. For example, you have torrent.go for a torrent model and its package torrents for db stuff related functions (Find, Create, Some helpers)
2017-06-29 00:44:07 +02:00
akuma06 5991a21818 First batch of changes for the refactor (#1078)
* First batch of changes for the refactor

Added the support of gin in routes and other services/utils
Begining implementation of JetHTML

* Remove os folder

* Move scrapers to own repo

* Second batch of changes

All .jet.html are the working templates.
You can now test this PR, the index Page and upload works. If you want to complete the other html templates, you're welcome

* Move captcha to util

* Move uploadService to utils

* Use govalidator instead of regex

* Third batch of changes

All the front end should as previously.
I also fixed some minor things unrelated to the refactor (mostly style issues on static pages)
Now errors can be accessed by importing the "errors" helpers and using the `yield errors(name="xxx")` command in templates.
Same for infos.
Templates are now more hierarchized with a base template "base.jet.html" which is extended depending on the context in "index_site" or "index_admin" layouts. Those layouts are extended than in every pages.
Other helpers are captcha to render a captcha `yield captcha(captchaid="xxx")`
And also csrf, with the command `yield csrf_field()`
To translate, you don't have anymore to do `call $.T "xxx"`, you just have to do `T("xxx")`.

Pages for the website part are in folders in the folder "templates/site". Pages for the admin part are in "templates/admin". Layouts are separated in "templates/layouts". Helpers and menu are in "templates/layouts/helpers" and "templates/layouts/menu". Error pages should be put in "templates/errors"

* Added test on templates

When adding a new template, you have to tell to template_test.go, the context of the new template (if it doesn't use the common context)

* Panel admin works

Now the templating part should work. The PR can now be fully tested.

I think we should push the templating PR  and do the routes/controllers/removal of services in another branch. So we know that this one is functional

* Updated dependencies

* Fixed test for modelhelper

* Fix testing for commentlist

* Fix travis :')

* Just renamed router and removed network

* Applying same SEO fix

* Update form_validator.go

* Added back regexp package
2017-06-28 21:42:38 +10:00
PantsuDev 496e1d4ba4 Start refactor 2017-06-25 23:27:05 +10:00
MMP0 006dc1c034 Update Japanese translation (#1070)
* Update ja-jp.all.json

* Update ja-jp.all.json
2017-06-25 21:20:02 +10:00
sfan5 1dd7c9d5d3 Fix scraping on postgres 2017-06-25 13:18:03 +02:00
yiiT b59b5c092b Add /feed/magnet which displays the magnet instead of the torrent link (#1069)
* Add /feed/magnet which displays the magnet instead of the torrent link
2017-06-24 19:45:56 -05:00
akuma06 d4b36e2489 Fixes block templates for title and rss (#1068)
* Fixes block templates for title and rss

* Remove duplicate og site_name
* add rss links in meta for torznab and eztv
* Fixed 404 Error in og site_name

* Git didn't update the view fast enough
2017-06-25 01:54:33 +02:00
akuma06 4f203ba92c Merge pull request #1067 from Anonymous-senpai/patch-1
Update nl-nl.all.json
2017-06-25 01:53:09 +02:00
akuma06 ddafb142b6 Update nl-nl.all.json 2017-06-25 01:48:21 +02:00
akuma06 5dd580e746 Update nl-nl.all.json 2017-06-25 01:43:57 +02:00
Anonymous-senpai 60b2765c61 Update nl-nl.all.json 2017-06-25 01:19:30 +02:00
akuma06 0c990447eb Fix for API request hidden torrents
Usernames were not hidden when doing api request
2017-06-24 10:53:22 +02:00
tomleb ca87b242ae Fix searching for frame_arms (#1061)
Just mapping '_' to ' ' for both search and indexing
2017-06-24 11:56:58 +10:00
kilo 7788a018f5 Prettier color for g's sukebei user menu-button when hovered (#1060) 2017-06-24 09:05:33 +10:00
kilo a47f89cd0b Make flags overlap category icon (#1059)
* Prettier flag position

* flag overlap category icon

* HTML changes

* fix css that didn't apply properly & colspan not always being there

* Update main.css

* Update home.html

* Update home.html

* Update main.css

* Update main.css
2017-06-24 09:05:21 +10:00
PantsuDev bdaedd3975 Revert "Make torrent language form not required (#1046)"
This reverts commit 82a0f3729a.
2017-06-23 20:55:33 +10:00
akuma06 ce12ef3241 Merge pull request #1058 from Kiloutre/patch-14
Make latest commit hash at the bottom clickeable
2017-06-23 12:54:34 +02:00
kilo 74ac9aaccf same but for admin 2017-06-23 12:46:50 +02:00
kilo 95c858076e Make latest commit hash at the bottom clickeable
More convenient for contributors
2017-06-23 12:45:48 +02:00
akuma06 7fd6698eeb Merge pull request #1056 from Kiloutre/patch-11
Prettier color for red button when hovered and .h-user when focused
2017-06-23 12:03:46 +02:00
kilo 3f17da2c9d Better color for .h-user when hovered
And text hover color changes for red buttons
2017-06-23 10:05:30 +02:00
kilo d3586f232b Prettier color for red button2 (classic.css & hover changes)
The edit that i had made previously only applied to g's theme
And it didn't apply when the button were hovered
2017-06-23 10:01:36 +02:00
MMP0 e1edc62643 Update ja-jp.all.json (#1055) 2017-06-23 16:02:29 +10:00
PantsuDev 68ac3c21ad Remove left & right 15% 2017-06-23 11:28:55 +10:00
akuma06 947a5ecd91 Merge pull request #1054 from NyaaPantsu/description-fix
Fix
2017-06-23 03:20:17 +02:00
akuma06 3674a05233 Merge branch 'dev' into description-fix 2017-06-23 03:19:47 +02:00
akuma06 8c62d7bbe6 Fix modtools always shown 2017-06-23 03:15:56 +02:00
akuma06 bda946bbfe Fix description in API search/RSS (#1053)
* Fix description in API search/RSS

There were no descriptions in torrents in API/RSS search on dev. The cause was that ES didn't have the field description in it.

You should reindex after the merge

* Forgot to commit this
2017-06-23 08:54:31 +10:00
akuma06 5ab2688e78 Forgot to commit this 2017-06-22 17:37:09 +02:00
akuma06 d12ffb92ba Fix description in API search/RSS
There were no descriptions in torrents in API/RSS search on dev. The cause was that ES didn't have the field description in it.

You should reindex after the merge
2017-06-22 17:35:21 +02:00
PantsuDev cb13bcded9 Change max to limit 2017-06-22 11:21:30 +10:00
PantsuDev c2d931c71f Change max to limit in search header 2017-06-22 11:02:55 +10:00
PantsuDev 1936c74085 Make commentlength and descriptionlength configurable 2017-06-22 10:21:59 +10:00
akuma06 424a62549c Fix RSS link
Fix for #1051
2017-06-21 15:38:08 +02:00
akuma06 87794dc25e Merge pull request #1050 from MMP0/patch-22
Update Japanese translation
2017-06-21 13:40:13 +02:00
MMP0 5e6cdc1e05 Update ja-jp.all.json 2017-06-21 20:16:52 +09:00
Myrmece 5f99762dbc Updated translation. (#1048) 2017-06-21 20:51:51 +10:00
akuma06 ce13ce1bfb Precised that email are optional 2017-06-21 11:50:55 +02:00
akuma06 f1fed8fbc2 Merge branch 'dev' of https://github.com/NyaaPantsu/nyaa into dev 2017-06-21 11:44:00 +02:00