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

22 commits

Auteur SHA1 Message Date
akuma06 2773fe200d Golint friendly (#747)
* 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
2017-05-25 21:54:58 +02:00
akuma06 6edc68fe22 Deleted torrents mod done (#732)
* 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
2017-05-25 02:19:05 +02:00
Ramon Dantas 86447b853c Add tree-view file list (Done) (#724)
* Add tree-view file list

* Add TotalSize field to folders

* Remove bootstrap/jquery related code

* Add icons to filelist, some CSS formatting

Moved a few styles from the format string for the tree view, to CSS
(where possible). Make icons look consistent under all themes.

* Make filelist hideable again, show it when JS is disabled
2017-05-25 00:13:56 +10:00
Eliot Whalan b4b1b1c26a
go fmt all the code 2017-05-24 17:11:13 +10:00
akuma06 21ac12c852 Some updates
* Added support of UGC without div tag for torrents
* Added support of basic html tags for comments (a, img, b, em, u)

Fixed:
* Bug with r *request becoming a nul pointer when loading from contextin
messages.go
2017-05-24 00:08:02 +02:00
akuma06 23e7d33bb6 Fixing insert of unneeded html tags in db
Added a Sanitize function in util
* Possibility to add model in it
* Already a preset default model

Comments shouldn't be allowed html, too difficult to check every comment
for broken html
Torrents are still allowed html tags but I don't think it should since
we use markdown.
2017-05-23 22:09:20 +02:00
akuma06 07623e85ed Merge pull request #698 from NyaaPantsu/revert-692-revert-690-user-torrent-edit
Allow users to edit & delete their torrents
2017-05-23 19:43:09 +02:00
nopjmp af2850518c Implement HEAD for views (#695)
* Implement HEAD for /view/{id}

Implement HEAD for the torrent view route by calling GetRawTorrentById.
Run gofmt on the file while we are here.

* Implement HEAD for /api/view/{id}

Implement HEAD in the same way as /view/{id}
Also run gofmt on the api_handler.go
2017-05-23 13:18:19 +10:00
akuma06 b75fc9ce53 update 2017-05-23 04:12:02 +02:00
akuma06 99f2092028 Revert "Revert "New User Edit Panel"" 2017-05-23 04:05:33 +02:00
alucard0134 ed5152a4a0 Revert "New User Edit Panel" 2017-05-22 19:10:06 -05:00
akuma06 c8c3dc1980 New User Edit Panel
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
2017-05-23 01:26:09 +02:00
akuma06 50c8f52ee8 Fix 2017-05-22 00:52:07 +02:00
akuma06 07c120407e Finished 2017-05-22 00:22:42 +02:00
akuma06 a4c23dda1f wiiiip 2017-05-21 20:20:40 +02:00
akuma06 5639033370 Wiiiiiip 2017-05-21 19:38:39 +02:00
Ramon Dantas adb90d657c Group common template variables together. (#665)
* Bundle fields used in most template variables under CommonTemplateVariables

* Make handlers use CommonTemplateVariables
2017-05-21 17:10:19 +10:00
akuma06 798ec9a3a8 Merge remote-tracking branch 'refs/remotes/origin/dev' into notifications
# Conflicts:
#	templates/_badgemenu.html
2017-05-21 01:21:56 +02:00
akuma06 5f60970eb9 Finished 2017-05-21 01:06:40 +02:00
Ramon Dantas 1968d2ae54 Move translation func to template variables (#652)
* 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
2017-05-21 08:38:28 +10:00
akuma06 cf478a4235 Add Torrent WebLink + fixes
Simplifying messages util (no need to add everytime r)
2017-05-20 17:01:13 +02:00
tomleb babf0a37f0 Cleanups and fixes (#623)
* Keep naming consistent

* Remove execute bit from files

* Default to DefaultLanguage (without passing it to the func)

* Remove commented code

* Use Content-Type to get language json

* Lines of 400 characters is dumb

* Update new repo in README

* Remove useless script since we fallback to a defaultlang

* Fix fallback language panic

* Fix uninitialized MaxPerPage when not in querystr

The issue was that the req.MaxPerPage was not set (default to 0) when
the query string didn't include "max". This makes the server query the
whole db since the resulting limit is 0.

* Fix creating empty torrents (only worked once)

* Lines of 400 characters is still dumb
2017-05-19 12:55:59 +10:00
Renommé depuis router/viewTorrentHandler.go (Continuer la navigation)