This repository was archived by the owner on Feb 3, 2024. It is now read-only.
Open
Conversation
mxmeinhold
reviewed
Mar 27, 2022
Contributor
mxmeinhold
left a comment
There was a problem hiding this comment.
is there any way to do a search by content after pagination?
mxmeinhold
reviewed
Mar 31, 2022
| quote_query = db.session.query(Quote, | ||
| func.sum(Vote.direction).label('votes')).outerjoin(Vote).group_by(Quote) | ||
| # Put the most recent first | ||
| quote_query = quote_query.order_by(Quote.quote_time.desc()) |
Comment on lines
+244
to
+245
| begin=max(1, page-6), | ||
| end=min(page+6, rows) + 1 |
Contributor
There was a problem hiding this comment.
Can this logic not be done in jinja? seems kinda weird to pass these when you're already passing the page.
Collaborator
Author
There was a problem hiding this comment.
Min and Max are not jinja functions
| submitter = request.args.get('submitter')) | ||
|
|
||
| rows = query.count() | ||
| rows = int(rows//20 + bool(rows%20 > 0)) |
Contributor
There was a problem hiding this comment.
Is this really rows? Seems more like it's total number of pages
Comment on lines
33
to
35
| <li class="page-item"> | ||
| <a class="page-link" href="/storage/{{ num }}">{{ num }}</a> | ||
| </li> |
Contributor
There was a problem hiding this comment.
planning to mark the current page separately?
Collaborator
Author
There was a problem hiding this comment.
Probably should, good point.
Co-authored-by: Max Meinhold <mxmeinhold@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
So you know how Quotefault takes a small fucking eternity to load? Fixed.