Commit Graph

521 Commits

Author SHA1 Message Date
Shane 72c997173c [Schema+config change] Comment editing (#396)
* Comment editing
* Optional time limit for comment editing
2017-11-05 16:26:30 +02:00
TheAMM b4c0ad9e84 torrents.py: Add link to torrent page into .torrent comment metadata 2017-11-04 23:46:50 +02:00
Nicolas F 96468a5a11 torrents: don't allow download of deleted torrents (#399)
Only allow moderators to download torrent files that are deleted.
2017-11-03 18:54:08 +02:00
Nicolas F 7095567b29 Comment deletion: fix small lack of validation (#395)
People could delete their own comments on torrents other than
the one the URL would indicate, which meant they could mess with
the total comment count on a torrent by having it be higher than
it actually is through repeatedly posting and deleting comments
that way.

However, they could only ever delete their own comments, so this
isn't a huge issue in the first place.
2017-10-29 20:01:19 +02:00
Arylide ca7dc276e2 Fix some text and revert a js thing 2017-10-20 22:24:36 -07:00
Nicolas F b4c9d7cd1b Fix filter dropdowns if JS is disabled (#389)
Before bootstrap-select is loaded, a small JS piece replaces the
class for the pickers with the appropriate bootstrap-select classes.

If there is no JS, the dropdowns will stay as form-control.
2017-10-20 21:01:36 -07:00
Nicolas F 4019343d50 Implement torrent nuking ability for mods (#377)
* Implement torrent nuking ability for mods

This deletes all torrents of a specific user.
A current caveat is that it will delete both sukebei and nyaa torrents,
but will only leave a log entry in the current flavour's log.

Also did some bootstrap untangling on the user view page.

* Per-flavour logging

Hopefully this works. Maybe.

* Tracker API: chunk into 100-element sublists

* isort

* Restrict nuking to superadmins

Also do a lint.sh.
2017-10-16 18:17:12 -07:00
Anna-Maria Meriniemi de1fd2f1bc [Config change] Upload ratelimit for non-trusted uploaders (#384)
* Implement upload ratelimit for non-trusted uploaders

Users may upload X torrents in Y minutes after which they
will have to wait Z minutes between uploads.

* Show torrent period count when ratelimited

* Only ratelimit new accounts
2017-10-09 18:41:18 -07:00
Nicolas F 37546354a7 Explicitly tell users they were banned (#379)
This tells users who are banned the reason that they are banned,
and doesn't show the same message for inactive users.

IP banned users are still just shown the boring 403 page.
2017-10-07 19:16:24 -07:00
Anna-Maria Meriniemi 9e87e810af [Config change] Password reset by email (#381)
* Password reset by email

Adds endpoint, templates, email templates, forms

* Timeout password reset request in six hours
2017-10-08 04:34:40 +03:00
Anna-Maria Meriniemi 6d09920abd Update email verification, add Mailgun backend (#380)
Changes config.example.py!
2017-10-07 17:31:32 -07:00
Nicolas F 19eaa2c532 Fix timezone awareness for account creation time (#378) 2017-10-06 22:36:13 +03:00
Anna-Maria Meriniemi 1e5f61ddf7 [Config change] Require recaptcha of new uploaders (#376)
* Reorganize config.example.py, add ACCOUNT_RECAPTCHA_AGE

* Require new accounts to pass recaptcha on upload

Based on ACCOUNT_RECAPTCHA_AGE in config.
2017-10-04 16:05:35 -07:00
Nicolas F 214952e7b6 Disable report button on empty reason (#374)
Previously, people couldn't quite tell you needed to give a report
reason. Now we disable the submit button until there is a reason,
and flask.flash() if someone manages to submit an empty reason
anyway.
2017-10-03 17:03:22 -07:00
Arylide 0eea181020 Fix search form typo and some HTML 2017-10-03 16:57:40 -07:00
nyaadev 4091cba837 fix mysql error and bad colors in css 2017-09-19 01:32:45 +02:00
nyaadev 2e6e924247 fix pep8 error message 2017-09-19 01:16:34 +02:00
nyaadev 89590c91bb Add ascii check in User.by_username to fix mysql errors 2017-09-18 13:28:15 +02:00
Anna-Maria Meriniemi c5d705210d Read-only maintenance mode setting for config.py (#356)
Disables all POSTs, optionally allowing users to log in (without updating last login date)
Blocked POSTs will redirect to the GET endpoint if possible, otherwise to referrer or in last case, home page.
API requests will get a plaintext message with 405 status code.
2017-09-04 18:16:52 -04:00
Arylide 5e93d7ec6d probably fix a css thing and change out a tracker 2017-09-04 15:14:26 -07:00
sfan5 45e1a650fb Improve dark theme (2) (#358)
* Further improve dark theme

* do something about .alert-info, idk
2017-09-04 18:01:40 -04:00
sfan5 4995f95ebd Improve dark theme (#357)
* Add 'dark' class to <body> if dark theme is activated

* Make dark theme suck considerably less
2017-09-03 18:18:39 -04:00
TheAMM 6b49af4fb7 Exception handling: include a random string to identify stacks from log 2017-09-02 22:18:32 +03:00
Anna-Maria Meriniemi 36d3f8aed0 Early filename validation (#354)
Currently just rejects torrents with RTL overrides in filenames
2017-09-01 18:27:14 -04:00
Anna-Maria Meriniemi 04a8ff95d2 Words (#355)
* Add words

* Add more words

Words are nice
2017-09-01 18:14:11 -04:00
TheAMM 07b45622f4 Get rid of index name hardcoding, read from database (and cache)
Index names are not necessarily named 'ix_table_column', so inspect the real schema for index names. Results are cached in memory.
(I have no clue how, but mine are prefixed idx_ instead of ix_!)
Clears out the "sort" variable naming as well.
2017-08-31 19:12:50 +03:00
nyaadev 57a71be7b8 minor changes 2017-08-31 14:20:34 +02:00
Alex Ingram df288bfadd Add Firefox search provider. (#353)
* Add Firefox search provider.

* Add search provider to layout.

* Add search thing for Sukebei, too.

* Fix layout.
2017-08-30 23:52:50 -04:00
nyaadev 294a12700c fix mysql being shit 2017-08-31 03:36:29 +02:00
Anna-Maria Meriniemi 4eed4971a3 Fix banning torrents without uploader ip
Pretty much just for archived torrents
2017-08-26 02:52:59 +03:00
Anna-Maria Meriniemi aa3c2ba77b Fix banning anonymous torrents
We miss ye, testing
2017-08-26 02:36:38 +03:00
A nyaa developer f8a314df4f Better bans (#341)
* better bans

* put jinja2 template into correct file
2017-08-25 18:53:35 -04:00
TheAMM 6aab5557d6 ...remove debug print
Alas, hasty mergers
I'm not force-pushing master on a 1030-star repo because of an accidental debug line, no sirrre.
2017-08-20 04:06:04 +03:00
Anna-Maria Meriniemi 39fcfc0058 Add (optional) validation for minimum anonymous torrent size (#342)
MINIMUM_ANONYMOUS_TORRENT_SIZE can be used to require a minimum total
size of torrents uploaded by anonymous users (ie. without accounts).

Sets up a "framework" for post-WTForm torrent validation as well;
this can easily be extended into filename blacklists and such.
2017-08-19 20:48:08 -04:00
Nicolas F 48d4217f02 help page: Add help for deletion (#340)
Some people may not realise that they can do this themselves,
and maybe they'll consult the help page before abusing the report
button.
2017-08-19 06:38:32 -04:00
Kfir Hadas a758f5f078 Optimize routes (define url_prefix in Blueprints)
* /admin/*
* /api/*
2017-08-15 17:12:54 +03:00
nyaadev 0bcd782695 Minor improvements 2017-08-15 01:41:31 +02:00
Arylide 2cd2dbf66d Replaced dead tracker and give mods a hammer 2017-08-14 16:02:06 -07:00
mreweilk 2e50f14fb7 Change admin routes from /adminlog and /reports to /admin/log and /admin/reports 2017-08-14 13:30:17 -04:00
nyaadev d5b8a3a2ae Increase maximum comment size from 255 to 1024.
DB change: Change comment text field from VARCHAR(255) to mysql.TEXT
2017-08-14 19:08:36 +02:00
nyaadev 1c3724cae1 Delete cached torrent file when replacing torrent. 2017-08-07 00:20:02 +02:00
nyaadev 602d35bab7 Integrate tracker API for torrent ban/unban 2017-08-06 23:55:45 +02:00
Arylide 5fb178f3a8 idk 2017-08-05 13:03:43 -07:00
TheAMM 7a04d64f9c Weed out last few hardcoded urls 2017-08-05 22:43:13 +03:00
A nyaa developer e728ca1818 Expose soft delete to users and allow reuploading of deleted torrents. (#331)
Add banning torrents for moderators which disallows reuploading.
New delete UI.
2017-08-05 15:41:59 -04:00
Anna-Maria Meriniemi 95e35a10c9 Change torrent Content-Disposition back to inline
As per comments in #288, Firefox forces a "what do you want to do with this"-dialog for 'attachment' even when it's set to open them immediately in another program.
2017-08-03 11:28:21 +03:00
Kfir Hadas 87dd95f1e0 Refactor into an app factory [2 of 2] (#322)
* Replace all `from nyaa import app` imports with `app = flask.current_app` (or `from flask import current_app as app` where possible)
* Add a separate config object for top-level and class statements as `nyaa.extensions.config`
Required because those codes don't have app context at the time of evaluation/execution.
* Remove `routes.py` file and register all blueprints in `nyaa/__init__.py`
* Refactor `nyaa/__init__.py` into an app factory
* Update tools
* Update tests (temporary, will be replaced)
2017-08-01 21:02:08 +03:00
Kfir Hadas 0181d6cb33 Prepare for app factory [1 of 2] (#315)
* Move db, assets, debug toolbar and fix_paginate into nyaa.extensions
* Change all `from nyaa import db` imports to `from nyaa.extensions import db`
* Move `nyaa.torrents.create_magnet_from_es_info` context processor into template-utils blueprint
* Fix tools (wrap in `with app.app_context():` where needed)
2017-07-30 20:35:16 +03:00
TheAMM 1dae331156 Completely handle qBittorrent webseeds
Fixes #319

Zero webseeds: empty bytestring
One webseed: bytestring
More than one: a list of bytestrings (as the spec asks for!)
2017-07-30 11:49:13 +03:00
TheAMM 987103b213 Handle qButtorrent empty url-list/webseeds
url-list is supposed to be omitted in case of no webseeds,
but qB will instead use an empty bytestring '' as the value.
This commit makes the validation more lenient regarding url-list.
2017-07-30 11:36:38 +03:00
Anna-Maria Meriniemi 1bc36c5a17 [Schema change] Add webseed support (BEP-19) (#317)
Store webseeds in Trackers table with is_webseed flag
Adjusts torrent creation accordingly
2017-07-30 00:00:39 +03:00
Kfir Hadas b992467dad Apply isort & flake8 (#312)
* Update isort settings
* Apply import sorting (isort) on all files in nyaa/
* Fixed Flake8 errors in nyaa/ (see PR for list)
* Add isort to lint.sh and requirements.txt
2017-07-28 20:01:19 +03:00
Kfir Hadas 99c052c85f Tiny code reformat 2017-07-27 23:29:25 +03:00
Kfir Hadas 42725d4a3c Hotfix Gravatar 2017-07-27 23:17:06 +03:00
Kfir Hadas ab6193d01d Update Gravatar (#313)
* Update help.html with a section about user avatars

* Update Gravatar implementation to use the rating feature
2017-07-27 16:03:13 -04:00
Kfir Hadas 2424639bf9 Refactor routes.py 2017-07-27 14:14:00 +03:00
Kfir Hadas c539795fdc Move the remaining template_global into 'template-utils' blueprint 2017-07-27 14:14:00 +03:00
Kfir Hadas 93f94023d1 Move delete_comment and submit_report into blueprint 2017-07-27 14:14:00 +03:00
Kfir Hadas ef56e54521 Move torrent magnet and torrent download into 'torrents' blueprint 2017-07-27 14:14:00 +03:00
Kfir Hadas 9fef343c1b Move torrent edit and upload into 'torrents' blueprint
Move supporting functions and variables into other files
* nyaa.views.torrents:
  - _create_upload_category_choices
* nyaa.backend:
  - get_category_id_map
2017-07-27 14:14:00 +03:00
Kfir Hadas 9acdd14e81 Move /view/<int:torrent_id> route into 'torrents' blueprint
and update templates.
2017-07-27 14:14:00 +03:00
Kfir Hadas 42535bbdab Move 404 handler into 'main' blueprint 2017-07-27 14:14:00 +03:00
Kfir Hadas 4aac17ff23 Move 'before_request' into 'main' blueprint
Update comment in api_handler with new before_request location
2017-07-27 14:14:00 +03:00
Kfir Hadas eccb0ebdff Move '/' and '/rss' routes into 'main' blueprint
and update templates.
2017-07-27 14:14:00 +03:00
Kfir Hadas f3b923ccca Move template filters and globals into blueprint (#301)
* Move 8 of 9 template filters and globals into a blueprint

* Rename nyaa.filters -> nyaa.template_utils

* Fix import sorting
2017-07-27 14:14:00 +03:00
Kfir Hadas 50529920bd Move /user/activate/<payload> route into users
Move supporting functions as well:
  - get_serializer
  - get_activation_link
2017-07-27 14:14:00 +03:00
Kfir Hadas 0887dde6fc Move /user/<user_name> route into a blueprint
Move supporting functions and variables into other files
* nyaa.utils:
  - cached_function
  - chain_get
* nyaa.search:
  - DEFAULT_MAX_SEARCH_RESULT
  - DEFAULT_PER_PAGE
  - SERACH_PAGINATE_DISPLAY_MSG
  - _generate_query_string
2017-07-27 14:14:00 +03:00
Kfir Hadas 3913d8cea2 Move admin routes into blueprint
and update templates

Routes:
* /reports
* /adminlog
2017-07-27 14:14:00 +03:00
Kfir Hadas f316353176 Move account routes into blueprint (#292)
and update templates,
and remove unused imports

Routes:
* /login
* /logout
* /register
* /profile
2017-07-27 14:14:00 +03:00
Kfir Hadas 911fbc317f Move static routes into a blueprint
and update templates

Routes:
* /help
* /rules
* /xmlns/nyaa
* /about (commented out)
2017-07-27 14:14:00 +03:00
Kfir Hadas 7e16616a5d Remove unused imports 2017-07-27 14:14:00 +03:00
Kfir Hadas de8bd047d5 Apply isort on routes.py 2017-07-27 14:14:00 +03:00
Arylide dc627bf398 Revert "upload page: use alerts, add alert about rules (#304)"
This reverts commit c5ce99c3f3.
2017-07-24 20:03:58 -07:00
queue b1d187613a bencode: fix nontermination on empty or malformed input
read(1) returns b'' on EOF, which wasn't checked for in a couple cases,
which could cause empty/truncated input to enter one of the `while True`
loops without hope of exit. programming is hard.
2017-07-24 20:53:48 -06:00
Nicolas F c5ce99c3f3 upload page: use alerts, add alert about rules (#304)
This changes the tracker announce URL message to be one of those
bootstrap alert bubbles, and adds an additional warning which tells
people to read the rules and not upload off-topic crap.
2017-07-24 16:46:39 +03:00
Arylide 6988daf803 HTML Changes 2017-07-22 20:31:50 -07:00
TheAMM a50d39ccaa Improve RSS feed title (show term, torrent/magnet) 2017-07-22 21:54:28 +03:00
TheAMM c31749c1d5 Add link for site-revision vs Github master comparison in footer
Quality of Life. What new features?
2017-07-22 21:41:48 +03:00
TheAMM 6b71cf101e Add simple info in RSS <description>
Allows puny humans to gather some information from the RSS feed
Fixes #299
(... and nobody will know!)
2017-07-22 21:37:53 +03:00
Kfir Hadas fe4ac73ca2 Update torrent download route headers (#298)
- Change disposition from inline to attachment
- Add Content-Length header (by updating `_get_cached_torrent_file`)
2017-07-20 11:00:20 +03:00
Arylide 2e8e548067 Revert "Autofocus on search input box"
This reverts commit c9389cb888.
2017-07-17 17:02:19 -07:00
mreweilk b51045503d Fix banned display on selection box 2017-07-16 14:19:20 -04:00
mreweilk c9389cb888 Autofocus on search input box 2017-07-11 23:28:30 -04:00
Matt Kliewer 708e0da5a1 Add logging to report view and add option to disable (ban) a user for superadmins 2017-07-09 18:07:31 -05:00
Alex Ingram 570ee1225a Fix broken comment CSS 2017-07-08 20:03:14 -05:00
zapzapzap1 1ae577acdb Add links to torrent clients' download pages (#259)
* Add links to torrent client's download pages

* Fuck uTorrent

* Goodbye, uTorrent
2017-07-08 00:10:33 -05:00
Kfir Hadas c466e76471 Fix RFC822 filters + More tests (#257)
* Make rfc822 filters compatible with Windows systems.

.strftime() is relative to the system it's being run on.
UNIX has '%s' for seconds since the EPOCH, Windows doesn't (ValueError).
Solution: use .timestamp() to achieve the same result on both platforms.
This also allows us to drop the float() around it, since it returns a float.

* Start testing filters

* Add placeholders for more tests

* Make 'tests' folder a Python package

Now you can run tests with just `pytest tests`

* Update readme and travis config

* Test timesince()

* Update and organize .gitignore

Deleted: (nothing)
Added: Coverage files, .idea\

* Test filter_truthy, category_name

* Tests for backend.py

* Tests for bencode.py

* Move (empty) test_models.py to tests package

* Tests for utils.py

* Fixes for flattenDict

* Change name to `flatten_dict`
* `newkey` was assigned but never used

* Add a helper class for testing

* Show coverage on Travis

(only Travis for now...)

* Remove IDE

* Use correct assert functions

* Update README.md
2017-07-07 16:14:37 -05:00
Matt Kliewer 45e3834f2a Change portion of welcome message 2017-07-05 13:15:58 -04:00
Kfir Hadas 3b55af85f0 Fix torrent deletion log
* Fix `url referenced before assignment.`
* Fix every action logged as delete/undelete
2017-07-05 13:48:34 +03:00
mreweilk dd8cb4757e Admin Log 2.0 (#283)
* Admin log added

* Add admin log to top bar

* Fixed some admin log bugs

* Remove comment_id column because comments die when they are killed

* Fix tabs in admin log template

* Fixed sort of admin logs to be created_time desc

* Fix navbar wrapping to a new line

when 992px <= width <= 1200px

* Put reports and admin log in "Admin" dropdown

Applied ./lint.sh fixes

Fixed long lines

* Updated log to be text instead of id based to account for future deletions

* Small fix in log message formatting
2017-07-04 23:13:59 -05:00
Nicolas F fdb041c23b Don't use responsive table on reports list
The responsive table actually does *worse* in narrow layouts because
the action column fucks off out of view and needs to be scrolled to
if the report reason is long. With a normal table you may not get
consistent row heights, but at least you don't have to horizontally
scroll to perform an action.

Also fixed a goof where I used a style attribute instead of making
the max-width for the action column a class.
2017-06-27 16:07:10 +02:00
Nicolas F 25535e9cb9 Add extra information to reports list
Shows whether the reporter is trusted, whether the uploader is trusted,
the name of the uploader and for superadmins the IP for the uploader.
2017-06-27 15:56:46 +02:00
Nicolas F 9dfce327b6 Improve reports table styling
Condense the table, vertically align the text inside rows, use a
bootstrap styled select, group it together with the review button
and shrink it down a little.
2017-06-27 15:25:55 +02:00
Nicolas F f1df776410 Add alert about reports that nobody will read
Apparently some people don't understand what the report button
is for. Adding this small warning can be considered a success even
if it just leads to one less stupid report.
2017-06-27 14:40:58 +02:00
TheAMM 081eb16246 Make username regex to stop the validation chain
with a decorator to replace ValidationError with StopValidation
2017-06-19 16:05:42 +03:00
Kfir Hadas 94574d1682 Hide "Report" button for site guests (#265) 2017-06-14 20:07:53 +03:00
Johnny Ding ffb2cdec5f Merge pull request #251 from sharkykh/tests
INITIAL UNIT TESTING FUCK YEAH
2017-06-07 23:27:53 -07:00
Kfir Hadas 16e72a2a9c set noqa to ignore a single error 2017-06-08 04:14:04 +03:00
nyaazi 9fbaf3c12a Setting height for comment textarea (#253) 2017-06-07 23:53:25 +03:00
Kfir Hadas 6f526de5ea Lint 2017-06-07 19:38:19 +03:00
aldacron 80fecd5496 add description and keywords 2017-06-06 23:53:19 -07:00
UnKnoWn bd0f9edce3 Reorder the search bar
Moving media queries to the end to ensure priority
2017-06-07 04:15:45 +08:00
Johnny Ding 06735a6536 Merge pull request #243 from nyaadevs/elasticsearch-fullword
Multi-field search display_name to match words over ngram limit. Resolves #205
2017-06-05 20:34:04 -07:00
Kfir Hadas c70a60b719 UI Fixes (#246)
* Fix markdown renderer

Use a simple for loop instead of `for (var target of markdownTargets)`, because it's unsupported in IE.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of#Browser_compatibility

* view.html : HTML Fixes

- Remove unmatched `</a>`
- Add missing `</div>`
- Use single quotes in {{ }}
- Closing tags comments

* layout.html

- Use single quotes in {{ }}
- Closing tags comments

* help.html: Convert all `<p>` to `<div>`

HTML spec doesn't allow lists inside `<p>` elements.

* Missing semicolon in `<script>`
2017-06-05 20:23:30 -04:00
TheAMM 2d0cf7cbb4 [ES Schema change] Multi-field search display_name to match words over ngram limit
This fixes searching for "Machiavellianism", 16 chars ("Machiavellianis", 15 chars, worked previously).
Does not (seem to!) break anything, but requires a re-indexing of ES.
2017-06-05 17:29:00 +03:00
aldacron ae71b6ed59 clean up motds 2017-06-05 00:04:21 -07:00
aldacron 566e7d8cf8 resolves #239 2017-06-05 00:02:52 -07:00
Alex Ingram 0a12db74d0 Change report button to btn-xs as a temporary fix. 2017-06-05 00:45:50 -05:00
Kfir Hadas 467270837c Enable `linkify` for Markdown parser
Autoconvert URL-like text to links
2017-06-05 02:36:18 +03:00
TheAMM 6592bec67c Clean up info api script
And a tiny bit of the serverside endpoint.
2017-06-04 00:52:11 +03:00
kyamiko 570a06bd9e API Info (#157)
Squashing 11 commits into one.
2017-06-03 23:57:53 +03:00
snowfag abfb5c178e Update rules page. 2017-06-03 15:06:15 -04:00
snowfag 68c2c965a4 Move hardcoded urls into config. 2017-06-03 14:40:32 -04:00
Kfir Hadas 3165389d52 Fix lint check + update lint script (#224)
* Fix PEP8 E301 on nyaa/models.py

* Add utils/ to lint checker

* Run of lint.sh + manual fixes

As suggested https://github.com/nyaadevs/nyaa/pull/157#issuecomment-305051428

* Fix backwards tick in README

* Updated script

* Update Travis config
2017-06-01 06:40:33 -05:00
ReimuHakurei 3e2437bba1 Fix merge mistake. 2017-06-01 11:37:50 +00:00
Alex Ingram b5e70ba0b0 Merge branch 'master' into focus-report-field 2017-06-01 06:30:34 -05:00
Nicolas F e564b3ee19 Change label of button on edit page
Small nitpick change.

"Edit" being the button that saves the edits might be a little
confusing, whereas "Save Changes" is less ambiguous and more
easily recognised.
2017-06-01 06:29:14 -05:00
Nicolas F ae30e9c95c Get started with a bare-bones help page
It includes little anchors over headings that you can click to link
your one reading-challenged friend to the right section.

In the future, adding an explanation of the different categories
and labels under a new h2 would be a good thing.
2017-06-01 06:28:49 -05:00
TheAMM 80587e02fe Default description to "" in field renderer
Otherwise we get None on upload page
2017-06-01 06:28:38 -05:00
TheAMM f4fb9fc065 Render markdown text field manually in the template
We need to escape newlines in the editor as well!
2017-06-01 06:28:38 -05:00
TheAMM 505b4e18bd Move to markdown-it, render markdown in DOMContentLoaded
No more separate <script>s for comments
Adds a link to a GFM cheatsheet on markdown form
Spaces to tabs on "markdownEditors" DOMContentLoaded
2017-06-01 06:28:38 -05:00
Nicolas F 07d45b6223 Focus report reason text field when reporting
A small convenience change which by sets the focus to the newly
opened modal dialog's text field if the report button is hit.

This way, people can type away their gripes with the torrent without
having to click into the text field first.
2017-05-30 19:31:28 +02:00
TheAMM 051f3f38d2 Clean up Torrent flag properties 2017-05-30 12:46:27 +03:00
nyaazi 5525337931 Replace the header titles 2017-05-30 10:29:59 +03:00
TheAMM 2b331c307e Optimize MySQL COUNT queries and pagination
Also leaves 'Torrent.trackers' as 'select' for the joining, since we don't need it on listings
2017-05-29 18:27:34 +03:00
nyaazi 5dc8bdaf74 For the green 2017-05-29 16:24:45 +03:00
nyaazi bea63315cd Merge branch 'master' into reports 2017-05-29 16:20:48 +03:00
TheAMM 32fa021f34 Turn comments icon on search result into link to comments
Also cleans up torrent.id/torrent.meta.id
2017-05-28 02:46:04 +03:00
Anna-Maria Meriniemi f02836f75e Merge pull request #194 from shm0o/url-stuff
More `url_for`
2017-05-28 02:42:42 +03:00
TheAMM 16194a12a3 Fix typo in ES search sort keys 2017-05-27 21:37:26 +03:00
Anna-Maria Meriniemi ea17f2d4da Merge pull request #169 from sharkykh/num-comments
Add number of comments to torrent lists
2017-05-27 21:36:29 +03:00
TheAMM 260dc2cdc8 Forbid caching when debugging 2017-05-27 21:33:20 +03:00
Anna-Maria Meriniemi d65602ee9f [DB Changes! Read PR!] Merge pull request #196 from nyaadevs/elasticsearch-comment-count
Elasticsearch comment count. Read PR #201 as well.
2017-05-27 20:12:43 +03:00
Anna-Maria Meriniemi 279ec26f7c [DB Changes! Read PR!] Merge pull request #201 from nyaadevs/update-alembic-migrations
Rewrite database models for declarative and update Alembic migrations
2017-05-27 20:11:57 +03:00
TheAMM 07cf0de6f9 Rewrite site-specific database models into declarative bases
This allows us to easily extend the bases into Nyaa and Sukebei models, with working FKs and relationships.

Note: the schema will (should!) otherwise match, however; the following index on Torrent was renamed:
uploader_flag_idx will be <prefix>_uploader_flag_idx, as we will be always creating both flavors.
The index rename should not affect SQA, but will potentially break migrations.
2017-05-27 18:14:39 +03:00
TheAMM f7ed2c06d3 Jeez fine PEP8 I get it 2017-05-27 18:10:21 +03:00
TheAMM d89f74893b Remove username validator from login form to allow logging in with email
Since our previous regex was broken, the validator passed practically everything.
2017-05-26 23:28:28 +03:00
Kfir Hadas fa946844d1 Style fixes
Comments box changed the height of the `<tr>`
Tweak icon/text sizes.
2017-05-26 19:23:34 +03:00
Kfir Hadas aad5a0c6ea Update style
Add support for sorting comments (in advance),
add th for sorting by comments_count, add title to the counter box and fix it being under the torrent's name,
2017-05-26 18:25:56 +03:00
Kfir Hadas 90695cad11 Add number of comments to torrent lists
Will only show when number of comments is above zero.
2017-05-26 16:50:31 +03:00
TheAMM b5ebebf98e Update Torrent.comment_count on comment submit/delete 2017-05-26 16:11:31 +03:00
TheAMM 6c80557e39 SCHEMA CHANGE: Add comment_count to Torrent
with a helper function on Torrent to update the count.
2017-05-26 16:08:46 +03:00
nyaazi 9e656ff7f6 Line too long 2017-05-26 15:29:49 +03:00
nyaazi 5332ba1a49 Merge branch 'master' into reports 2017-05-26 15:25:02 +03:00
shm0o 3edc73a518 templates/layout.html: use url_for for the appropriate endpoints 2017-05-25 19:33:47 -04:00
shm0o c178f905b0 templates/search_results.html: use url_for for the appropriate endpoints 2017-05-25 19:33:47 -04:00
shm0o 8b7712b1d0 templates/view.html: use url_for for the 'edit_torrent' endpoint 2017-05-25 19:33:47 -04:00
shm0o 18dd7cd66f static_cachebuster: build the url with url_for 2017-05-25 19:33:47 -04:00
TheAMM b6ecad898d Fix username validator
Tehee, oops!
2017-05-26 01:47:05 +03:00
TheAMM 3f49f17baa Add simple OG metadata tags to templates
Hello, #185
2017-05-26 01:03:59 +03:00