Ability to order versions list descending#304
Conversation
|
@filipac It's a good idea, however, I don't think the button to sort the versions should be in the orange section, as that's reserved for the plugin name. The conventional placement for that button would be next to the "Add" button, like it is for the "CMS" section of the Backend. Would you mind moving it into there and styling it appropriately? Once done, feel free to send us a screenshot. |
| @@ -0,0 +1,8 @@ | |||
| <div class="pull-right"> | |||
| <?php if($this->getConfig('sort', 'asc') === 'asc'): ?> | |||
There was a problem hiding this comment.
@filipac Please add a space between the if and (.
| <?php if($this->getConfig('sort', 'asc') === 'asc'): ?> | |
| <?php if ($this->getConfig('sort', 'asc') === 'asc'): ?> |
| @@ -0,0 +1,8 @@ | |||
| <div class="pull-right"> | |||
| <?php if($this->getConfig('sort', 'asc') === 'asc'): ?> | |||
| <a href="javascript:;" data-request="<?= $this->getEventHandler('onSort') ?>" data-request-data="sort: 'desc'" class="white oc-icon-sort-numeric-desc" title="<?= e(trans('rainlab.builder::lang.version.sort_descending')) ?>"></a> | |||
There was a problem hiding this comment.
@filipac Please indent this 4 spaces to the right to nest it inside the condition. Please also do the same for the line below the <?php else: ?> line.
widgets/VersionList.php
Outdated
| $items = $result; | ||
| } | ||
|
|
||
| if($this->getConfig('sort', 'asc') == 'desc') { |
There was a problem hiding this comment.
@filipac Space between if and (.
| if($this->getConfig('sort', 'asc') == 'desc') { | |
| if ($this->getConfig('sort', 'asc') == 'desc') { |
widgets/VersionList.php
Outdated
|
|
||
| public function onSort() | ||
| { | ||
| $this->config->sort = request()->sort; |
There was a problem hiding this comment.
@filipac We prefer using the facade for reading data.
| $this->config->sort = request()->sort; | |
| $this->config->sort = Request::input('sort'); |
Co-Authored-By: Luke Towers <github@luketowers.ca>
Co-Authored-By: Luke Towers <github@luketowers.ca>
|
done. |
|
@LukeTowers @bennothommo any updates on this required? :D i did composer update and lost my local changes and i miss the order :)) |
|
@filipac CSS is missing still😄 Buttons are messed up. Screenshot (will add a screenshot, when GitHub will let me. Uploaded on free hosting for now): |
|
@filipac If you are still interested in getting this merged, please review @w20k's comment above. |


While working on a big private plugin, I quite often go into the versions list of builder to create new manually migrations. After I edit those in an external editor, I have to re-open it in Builder to get new code before applying. When you have hundreds of versions, it's quite time consuming to scroll to the bottom every time you refresh. Example:

This could be easily fixed by adding a new button on version list to reverse the order. This is my PR esentially:
After my changes:

Changes are welcomed before merging.