mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-22 04:58:01 +01:00
Added archive filter to tracks page
This commit is contained in:
parent
1f74636a39
commit
afa9e8f50e
3 changed files with 25 additions and 0 deletions
|
@ -357,6 +357,11 @@ class TracksController extends ApiControllerBase
|
|||
$query->whereIn('show_song_track.show_song_id', Request::get('songs'));
|
||||
}
|
||||
|
||||
if (Request::has('archive')) {
|
||||
// Select which archive to view
|
||||
$query->where('source', Request::get('archive'));
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,6 +63,17 @@
|
|||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown" ng-class="{'has-filter': !query.filters.archive.isDefault}">
|
||||
<a class="dropdown-toggle btn btn-default" bs-dropdown>
|
||||
Archive: <strong>{{query.filters.archive.title}}</strong>
|
||||
</a>
|
||||
<a class="btn btn-default" pfm-eat-click ng-click="clearFilter('archive')"><i class="fa fa-remove"></i></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li ng-repeat="filter in ::filters.archive.values track by $index" ng-class="{selected: filter == query.filters.archive}">
|
||||
<a pfm-eat-click href="#" ng-click="setFilter('archive', filter)">{{::filter.title}}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="pagination" ng-if="totalPages > 1">
|
||||
|
|
|
@ -239,6 +239,15 @@ module.exports = angular.module('ponyfm').factory('tracks', [
|
|||
values: []
|
||||
filterName: 'songs'
|
||||
|
||||
self.filters.archive =
|
||||
type: 'single'
|
||||
name: 'archive'
|
||||
values: [
|
||||
{title: 'None', query: '', isDefault: true, filter: ''}
|
||||
{title: 'MLP Music Archive', query: 'mlpma', isDefault: false, filter: 'archive=mlpma'}
|
||||
{title: 'Ponify', query: 'ponify', isDefault: false, filter: 'archive=ponify'}
|
||||
]
|
||||
|
||||
taxonomies.refresh().done (taxes) ->
|
||||
for genre in taxes.genresWithTracks
|
||||
self.filters.genres.values.push
|
||||
|
|
Loading…
Reference in a new issue