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
This commit is contained in:
Kfir Hadas
2017-07-08 00:50:55 +03:00
parent 3913d8cea2
commit 0887dde6fc
12 changed files with 209 additions and 192 deletions

View File

@@ -29,7 +29,7 @@
<div class="row">
<div class="col-md-1">Submitter:</div>
<div class="col-md-5">
{% set user_url = torrent.user and url_for('view_user', user_name=torrent.user.username) %}
{% set user_url = torrent.user and url_for('users.view_user', user_name=torrent.user.username) %}
{%- if not torrent.anonymous and torrent.user -%}
<a class="text-{{ torrent.user.userlevel_color }}" href="{{ user_url }}">{{ torrent.user.username }}</a>
{%- else -%}
@@ -145,7 +145,7 @@
<div class="panel-body">
<div class="col-md-2">
<p>
<a class="text-{{ comment.user.userlevel_color }}" href="{{ url_for('view_user', user_name=comment.user.username) }}">{{ comment.user.username }}</a>
<a class="text-{{ comment.user.userlevel_color }}" href="{{ url_for('users.view_user', user_name=comment.user.username) }}">{{ comment.user.username }}</a>
{% if comment.user.id == torrent.uploader_id and not torrent.anonymous %}
(uploader)
{% endif %}