-
Notifications
You must be signed in to change notification settings - Fork 132
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
New design for sort options #2161
Comments
So instead of the line with 4 anchors we should add a button with a drop down list with all possible sort options. |
Great, I am assigning this to you then! 😄 Please make sure to check the comment mentioned in the description, as there is some draft of code already. There are several places where the "Sort" links are used, so it is not always 4 anchors. But yes, the point is to remove those links and replace them with a button + dropdown list instead. The pages where the "Sort" links are being used are listed in another comment in the same thread. I suggest you implement this new design in one only page at first, then do a draft PR like you did previously. We can check if it's alright on this page and you can finish with the other pages once we have settled down on the wording. |
Yesterday I finally had time to start studying this issue.Since there are several pages with the same inline sort options, I decided to focus on one first, in particular The box has alway a top bar with I am checking if there's an existing css class to allign on right, otherwise I found out that I can get the right placement with this kind of styling:
My main concern with the looks is how to load an icon in
tries to load http://localhost:8080/eng/sentences_lists/img/list.svg instead of http://localhost:8080/img/list.svg (which should be the right path (then I will find the proper sort icon) Then I will figure out how to display the dropdown list (I have to understand ho to display it, maybe using javascript and an a select) |
Rather than aligning to the right, you can make the
At the moment we are not using SVGs but the Material Font Icons with ligatures.
Perhaps you've missed the info but there is already an example of how to display the sort menu. I should have probably posted here all the relevant info from the other thread. Code sample
If you replace the toolbar code in Sort option labelsFor each sort link that we currently have, there will be 2 options in the menu. Below is the list of every page where there are sort links and the corresponding suggested labels. https://tatoeba.org/eng/sentences_lists/index
https://tatoeba.org/eng/sentences_lists/show/9633
https://tatoeba.org/eng/tags/view_all
https://tatoeba.org/eng/tags/show_sentences_with_tag/2139
https://tatoeba.org/eng/users/all
https://tatoeba.org/eng/sentences/of_user/TRANG
https://tatoeba.org/eng/reviews/of/TRANG
There was also some mention of the sort section from the advanced search but we can leave this out of scope for this issue. |
@trang Thank you very much. I checked and it works as expected. I am sorry but I didn't think about checking about the other discussion. I was wondering, should I put links inside the menu or try to work with a directive in |
No problem @gioele-santi 🙂 In the code sample, the You can replace the
I'll leave it to you to figure out how to handle the indicator for the current selected sort. |
Thank you very much. |
Ok, today I was able to reprise my work on this issue. Currently options are visualized with this code:
I already know the management of First parameter should be the database column used for sorting, second parameter the localized name for the link. Ascending or descending has no direct control, so I am not sure if I can generate two links for each options as ascending/descending are automatically alternated by Then I am focusing on the check mark with |
You should create two links for each sort key, see Trang's comment above. echo $this->Paginator->sort('name', __('list name'), ['direction' => 'asc', 'lock' => true]);
// Result: <a class="desc locked" href="/eng/sentences_lists/index?sort=name&direction=asc">list name</a>
echo $this->Paginator->sort('name', __('list name'), ['direction' => 'desc', 'lock' => true]);
// Result: <a class="asc locked" href="/eng/sentences_lists/index?sort=name&direction=desc">list name</a>
Since we reload the page after each new sort selection, you can set the correct icon already on the server (i.e. in the PHP code). |
Thank you. I looked for documentation about |
You want to look at the documentation for the PaginatorHelper. |
Thank you very much! |
Ok I have updated the first page with new sort options menu. My last doubt is about translations, is there a list of translation Meanwhile I will write the code in other pages. |
I'm not sure to understand what you mean exactly but if you are talking about translations of the UI strings, the "translation key" is the string itself. You have to encapsulate strings in the function |
I mean: in the list above there are some suggested labels. Should I use them even if there's not yet a translation? (I am not sure, I should check). About sorting I need to check what's the exact parameter name for user status ( Then the only page where I have some troubles with |
By the way, I remember you once pointed me to a page with a list of standard users (ids and passwords) for testing the local website. I cannot find it anymore, could you show me a link again as I want to test the new sort lists with some content... |
Yes, you should use these labels even if there's no translation yet. We will get them translated once your pull request is merged.
The param is You can also see it in the URL if you click on the "Member status" link to change the sort direction.
Right, that page actually has two version (for old design and new design). You should implement the change only for the new design. The corresponding template file is called show_angular.ctp.
This information can be found on the README of the imouto repository. → You can log in using one of these accounts: admin, corpus_maintainer, advanced_contributor, contributor, inactive and spammer. For all of them the password is 123456. |
Thank you. I already started changing the labels. |
Ok I created some sentences, tags and reviews and tested my changes (I looked many times at that README page but I don't know why I always skipped the line with password, probably I expected to find it at the end of page...). Anyway most of the pages work as expected but Am I right? Is there any configuration or difference in the downloaded project that may influence this or did I change the wrong files? |
For For
|
Luckily today I had no problem with that, maybe I changed the option yesterday while I was looking for review option.
I see. In fact I edited sentences_lists of user instead of sentences. It is not in the description above but since it had the sort links I think I should leave it with the updates, I just changed it to use the same sort options used in sentences list. |
We discussed in #2108 about a new design for the sort options.
The idea looks basically like this:
See #2108 (comment) and the next few replies for the wording of each option.
Consider implementing this together with #1063.
The text was updated successfully, but these errors were encountered: