New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CB-198: Filter "browse/view all reviews" by entity type #97
Conversation
https://tickets.metabrainz.org/browse/CB-198 Users found it difficult to browse reviews of specific choice of entity type. Currently, they have to find it by visiting every page of the listed reviews. - Add select option to views reviews based on entity type - Add 'filter by entity type' while retrieving Review.list
Can one of the admins verify this patch? |
@brainzbot, ok to test. |
Please don't forget to assign that ticket to yourself and mark it as "In review". That way it's easier for us all to keep track of what other people are working on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It needs work on the UI but are the changes according to what the ticket was for?
Looks like it is. @Freso?
There is a problem with the UI in cases when there are no reviews to show. Currently it just returns a 404 page with no way to change the filtering. This can be improved by getting rid of 404 in that case and just showing a message like "No reviews found."
@@ -5,6 +5,16 @@ | |||
|
|||
{% block content %} | |||
<h2>{{ _('Reviews') }}</h2> | |||
<form method="GET" action="{{ url_for('review.browse') }}"> | |||
<div class="form-group" style="display: inline-block;"> | |||
<select class="form-control input-sm" name="entity_type" onchange="this.form.submit()"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would look better if we used "nav-pills" here (similar to what we have at https://metabrainz.org/reports). A row that looks like Entity type: <All> <Release group> <Event> <Place>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not include 'Entity type:' because it broke the line and looked congested on smaller screens.
Do we need to do that? I think, with all the entity types listed it's quite self-explanatory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been considering that it would be useful when we have more types of filters in the future. But if that's too much of a problem now, we can improve this later.
<form method="GET" action="{{ url_for('review.browse') }}"> | ||
<div class="form-group" style="display: inline-block;"> | ||
<select class="form-control input-sm" name="entity_type" onchange="this.form.submit()"> | ||
<option value="None">{{ _('All') }}</option> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can just have an all
value here instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did this in the latest commit
- Remove 404 and show 'No reviews found' for all entity types except 'all'
It needs work on the UI but are the changes according to what the ticket was for?