* [WIP] Torrent Generation on not found error
As asked in #1517, it allows on-the-fly torrent generation. Since it uses magnet links, it needs some time to connect to peers. So it can't be instant generation, we need the user to wait and try after a minute at least.
* Replace Fatal by simple error
* attempt at fixing travis
* del
* Add Anacrolyx dependency
* Add back difflib
* Remove .torrent suffix in the url example
* Add some explanations when file missing page shown
* Ignore downloads directory
* Either use cache (third-party site) or own download directory
* Wrong import
* If there is an error then it means we aren't generating a torrent file
May it be "torrent not found" or "We do not store torrent files" which are the two only existing errors for this page
* hash is never empty
* TorrentLink may be empty at times
So we add a /download/:hash link if it is
* Update README.md
* Made a mistake here, need to check if false
* Update en-us.all.json
* Update CHANGELOG.md
* Torrent file generation can be triggered by click on button if JS enabled
* Update download.go
* Update download.go
* Use c.JSON instead of text/template
* Return to default behavior if we don't generate the file
* Don't do the query if returned to default behavior
* Add "Could not generate torrent file" error
* Fix JS condition & lower delay until button updates
* Start download automatically once torrent file is generated
* Fix torrentFileExists() constantly returning false if external torrent download URL
* torrent-view-data is two tables instead of one
This allows the removal of useless things without any problem (e.g Website link), but also a better responsibe design since the previous one separated stats after a certain res looking very wonky
* CSS changes to go along
* Remove useless <b></b>
* Update main.css
* In torrentFileExists, check if filestorage path exists instead of looking at the domain in torrent link
When checking if the file is stored on another server i used to simply check if the domain name was inside the torrent link, but we can straight up check for filestorage length
* Fix JS of on-demand stat fetching
* ScrapeAge variable accessible through view.jet.html
Contains last scraped time in hours, is at -1 is torrent has never been scraped
Stats will get updated if it's either at -1 or above 1460 (2 months old)
* Refresh stats if older than two months OR unknown and older than 24h
Show last scraped date even if stats are unknown
* Add StatsObsolete variable to torrent
Indicating if:
- They can be shown
- They need to be updated
* Update scraped data even if Unknown, prevent users from trying to fetch stats every seconds
* Torrent file stored locally by default
* no need to do all of that if no filestorage
* fix filestorage path
* Fix torrent download button stuck on "Generating torrent file" at rare times
* fix some css rules that didn't work on IE
* Fix panic error
Seems like this error is a known bug from anacrolyx torrent https://github.com/anacrolix/torrent/issues/83
To prevent it, I'm creating a single client and modifying the socket.go to make it not raise a panic but a simple error log.
* fix display of user search in firefox & IE
* remove '
* fix display of user search's search button on user search page search search search search
* remove '
* Lower amount of torrents shown in user profile
* Additional routes for user search
* Handler for user not found page
* User not found error page, with input to search username
* Move theme css in their own folder
* Delete g.css
* Delete classic.css
* Delete classic_colors.css
* Delete tomorrow.css
* Delete bg-body.png
* Delete bg-header-tile.png
* Delete s_bg-header-tile.png
* Change path used by stylesheet in html head
* Change theme path used by JS theme changers
* Update user_not_found.jet.html
* Update CHANGELOG.md
* Update en-us.all.json
* fix ad scrolling
* remove useless stuff
* fix travis & json file
* fix travis again
* remove duplicate
* Update CHANGELOG.md
* Writing an username instead of an userid in userprofile URL will no longer return the Anonymous profile
* redirect to username search instead of rendering a template without checking if username exists
* alt attribute for ads images
* fix <tr> too much
* fix missing <tr> that created HTML error
* fix wrong translation string name
* ditto
* fix accepted tags not having background on classic
* Put tag table inside upload table
* Update classic.css
* Remove prefix of dlsite tag on view
* Update main.css
* 10px bigger website
* fix wrong css selector
* fix markdown scroll visually broken in classic.css
* Add magnet link on torrent file not found page
* don't show magnet <a> if empty
* Fetch magnet link in download.go and pass it on to torrent_file_missing
* add magnet in template_test
* 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