Skip to content

Commit

Permalink
persist grid params in url + add link on overview to filter by a domain
Browse files Browse the repository at this point in the history
  • Loading branch information
Seb authored and sdieunidou committed Sep 13, 2017
1 parent d95a301 commit 4a280b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Resources/public/js/translation.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ app.factory('translationApiManager', ['$http', '$httpParamSerializer', function
/**
* ngTable column definition and parameters builder service.
*/
app.factory('tableParamsManager', ['ngTableParams', 'translationApiManager', function (ngTableParams, translationApiManager) {
app.factory('tableParamsManager', ['ngTableParams', 'translationApiManager', '$location', function (ngTableParams, translationApiManager, $location) {
return {
columns: [],
tableParams: null,
defaultOptions: { page: 1, count: 20, filter: {}, sort: {'_id': 'asc'} },
defaultOptions: angular.extend( { page: 1, count: 20, filter: {}, sort: {'_id': 'asc'} }, $location.search()),

build: function (locales, labels) {
this.columns = [
Expand All @@ -144,6 +144,8 @@ app.factory('tableParamsManager', ['ngTableParams', 'translationApiManager', fun
currentSort: {},
currentFilter: {},
getData: function($defer, params) {
$location.search(params.url());

translationApiManager
.getPage(params, this)
.success(function (responseData) {
Expand Down
2 changes: 1 addition & 1 deletion Resources/views/Translation/overview.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<tbody>
{% for domain in domains %}
<tr columns="columns">
<td>{{ domain }}</td>
<td><a href="{{ path('lexik_translation_grid') }}#?filter[_domain]={{ domain }}">{{ domain }}</a></td>
{% for locale in locales %}
<td class="text-center">
<span class="text {{ stats[domain][locale]['completed'] == 100 ? 'text-success' : 'text-danger' }}">
Expand Down

0 comments on commit 4a280b2

Please sign in to comment.