* 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
* Make torrent language form not required
It's required currently and that's annoying because the majority of torrents do not need that
* Make torrent language form not required
* Make torrent language form not required
* Should fix old uploader name in torrent view
* Fix "save changes" in modtools
* Modtool more colorful
* Fix search bar placement in modpanel
* Fix for widescreen
* Fix buttons in modpanel and some troncated text
* Update torrent.go
* Update admin_index.html
* Some last fix
Re added icon on download&magnet links
GetCategory categoryID keepParent (eg: GetCategory "3" true <= for all
anime)
Modified
GetCategories to (keepParent, keepChild) (eg: GetCategories true true <=
for every catagories)
* Should fix old uploader name in torrent view
* Fix "save changes" in modtools
* Modtool more colorful
* Fix search bar placement in modpanel
* Make colors more consistent; less would be super helpful tbqach fam
* Display the old username if it's there
* Fix some admin index html
* Add custom icons and remove png code from all CSS
* Move a good amount of cosmetic code from main to classic
* Fix some weird bug with point-events; add some global icon formatting; fix mascot fucking up
* Spruce up admin panel with icons on smaller viewports, along with adding trash icon
* 404 redesign ;^)
* Mufuyu mascot on all themes; says something slightly lewd
* Fix weird user menu bug where shit would overflow
List Torrent delete log
Torrent edit log
Comment delete log
And every other logged activities
Can be filtered out by a filter tag ("edit" or "delete" supported)
Pages navigation
Can be accessed by /activities
Added some translation string
Fixed hidden username on api request
Fixed comments username on modpanel
New Activity model
New Activity handler
New Activity Service
Fixed some updating issue for ES when moderating torrents
Be aware deleting torrents and comments return the model now!
* Add flags for torrents
Add a new field, .Language, to the Torrent model, and a new package,
torrentLanguages, which maps languages to flags. Added also a flag icon pack
from googlei18n/region-flags, with (mostly) public domain flags from Wikipedia.
* Optimize flags
* Use FlagSprites CSS instead of .png files
* Only use flags for languages we support
* Add test for CSS flags
Ensure that we have all the flags for the languages we support.
* Add AdditionalLanguages field to config
This allows us to support additional languages for new uploaded torrents,
even if we have no translation for it.
* Minor CSS fix
* Add "other" and "multiple" torrent languages
Also removed the TorrentLanguage struct, as it wasn't much useful.
* Fix test
* Add colspan=2 to category when language is empty
Also hide the language column if empty.
* Add lang field to search.
Hopefully it works with Elasticsearch as well, but I haven't tested
(lol Java)
* Add language field to ES index and settings
* Add language column to JS template
* Add keyword type to language ES field
* Remove 'raw' from keyword
* Set "simple" analyzer on language
* Document .Language field on Torrent model
* Comments count number
* New Modpanel fix
Fixes#755 (@ilikecats)
modpanel tables have margins
modpanel delete buttons are red
some coloring for buttons
reassign form looks better
reassign form textarea have rows="20" cols="40"
"save changes" btn green
report reasons are now translated in modpanel
delete is a real button on modpanel users page
* moved getReportDescription
* New ModPanel Theme
* Implemented the new @kipukun theme in ModPanel
* Added new translation string
* Fixed the toolbar in /mod/torrents
* Little fix on torrents report
* Remove double navigation
* Added a tag h1 for pages and new translation strings~
* fix warn message
* Mass Edit MOD api JS (WIP)
In continuity with the mass edit mod api, this is the javascript use of
it.
##What does it do?
* Delete of multiple torrents on index/search
* Category change of multiple torrents
* Change of owner of multiple torrents
* Lock & delete of multiple torrents
##How?
* New toolbar only visible for mods
* Checkboxes added only for mods
* Selection and click on the button in toolbar
* Nothing is submitted, you have to review the changes in a modal window
listing them.
* Then the ajax queries are initialized one at a time with a progression
bar
* You can always at any moment delete entries from the queuing list
* Improved progress bar
* Deleting part almost done
Improved modal design
All dom interactions should be done
Prepared Query for only one callback
Improved Modal to keep a link to the active modal
* Finished =D
Added some translation string
* Forgot the refreshing of the page
Just an option that can be disabled by making refreshTimeout to 0
* Added new dep: gorilla/csrf
* CSRF field in forms
* CSRF variable in commontemplatevariables
* New key for messages and user context
Please change EnableSecureCSRF to false when testing locally and don't
merge config/env.go with the changes
* Added a check on username and userId when converting torrent to JSON
* Added a checkbox for hidden in modepanel, torrent user edit and upload
* Added a Hidden field bool in torrent model and upload form
* Making the code Golint friendly
* No exported variables when not needed
* Same for functions
* Simplifying Templates variables with a form basic template variable
and a modelList basic template variable
* Adapted templates to new template variables
* use of .Models instead of model list
* use of .Form instead of modelform
* Small fix
* Small fix 2
Forgot $.Form
* Reverting templateDir as a var
* Torrent Mass Edit Api (WIP)
* Torrents can be deleted in mass from frontend with api post request
* Torrents status can be edited from frontend with api post request
-- Look to function doc for more info on how to use it
It is a WIP so it might not work =D
* Finished Mass mod Api
As per suggestion of @yiiTT in #720, I added:
* Changing torrents category
* Deletion of reports with deletion of a torrent
* Changing owner of multiple torrents
Commit also add some new translation strings.
* Make some changes
* Reports can now be cleared for the torrents selected without having to
delete them
* Users with no admin rights can't delete reports
* Fix moveto to status
moveto deprecated in api
* Tested and works!
Changes:
* Updates only the colomns of torrent table
* Moved categories config in config/torrents.go
* Forgot this file in last commit
* Less useless queries
The use of Save makes it that users are created and updates also all the
associatiated models. Better to just update the colomns needed (less
useless queries)
* Some Updates
* Added a new status of 5 for locking torrents
* Modifying the list torrents view for using it in deleted torrents view
* Added function to get deleted torrents
* Torrents (and reports) can be definitely deleted
* Some new translation string
* Fixing
* fix 2
* Added upload check for locked torrents
If a user owns a torrent, has deleted it and try to repload it. As long
as it has not been locked, he can.
* Fixing wrong condition in isdeleted
* Finished
* Info messages on success when deletes or lock
* Fixed double deleted_at is Null
* Added Link to view of deleted torrents
* Added new translation string
User can edit torrents
* delete torrents
+ New translation string for mod panel and user edit torrent panel
+ Improvement of messages util with implementation of T (no need to get
Tfunc now, messages util do that for you)
+ Use of @ElegantMonkey GetCategories to generate select of categories
in search and forms
* Add T field to template variables
* Remove languages.SetTranslationFromRequest
* Add Tfunc on handlers
* Remove T and Ts from template_functions
* Update templates
Change the templates to use the local Tfunc, instead of the global one.
Also changed the signature of the fields on template_variables.go, so that
they return a template.HTML to avoid escaping problems.
* Remove unnecessary variable
* Hide change language footer when logged in
* Force people to select a report reason
* Don't ask for confirmation before deleting a torrent report
* Small cleanup of modpanel templates
* Fix modpanel comment list
* Fix missing "Delete" translation in modpanel
* Update German translation
* A few updates to the FAQ
* Fix table on modpanel index
* Fix actions on torrent report list page
* Fix error reporting on modpanel templates
* Convenience functions for modpanel
Link to view page primarily and to edit page as a seperate link
* Missing confirm before torrent deletion
* Add edit button directly onto view page
When in a user page and clicked on more torrents, show a list navigable
of the user torrent
On that list, we can make advance search (categories, order, ...)
Moderation search reimplemented
Clicking on user (id) in the torrent list redirect to the list of the
user torrents
Ability to search within the user torrents