merge interface tweaks

This commit is contained in:
Athou
2013-07-08 22:20:32 +02:00
parent 132c1b0aaf
commit d6237c56c6
2 changed files with 20 additions and 1 deletions

View File

@@ -1222,8 +1222,24 @@ module.controller('ManageDuplicateFeedsCtrl', [
});
};
$scope.autoMerge = function() {
for (var i = 0; i < $scope.counts.length; i++) {
var count = $scope.counts[i];
if (count.autoMerge) {
AdminCleanupService.mergeFeeds({
intoFeedId: count.feeds[0].id,
feedIds: _.pluck(count.feeds, 'id')
}, function() {
alert('done!');
});
}
}
};
$scope.focus = function(count) {
$scope.current = count;
$scope.mergeData.intoFeedId = count.feeds[0].id;
$scope.mergeData.feedIds = _.pluck(count.feeds, 'id');
};
$scope.merge = function() {

View File

@@ -4,16 +4,19 @@
Page <input type="number" ng-model="page" />
Min. count <input type="number" ng-model="minCount" />
<input type="button" class="btn" ng-click="refreshData()" value="Refresh" />
<input type="button" class="btn" ng-click="autoMerge()" value="Auto merge selected" />
<table class="table table-condensed table-hover" ui-if="counts">
<thead>
<tr>
<th></th>
<th>url</th>
<th>count</h>
</tr>
</thead>
<tbody>
<tr ng-repeat="count in counts" ng-click="focus(count)" class="pointer">
<td>{{count.normalizedUrlHash}}</td>
<td><input type="checkbox" ng-model="count.autoMerge" /> </td>
<td>{{count.feeds[0].url}}</td>
<td>{{count.feeds.length}}</td>
</tr>
</tbody>