forked from Archives/Athou_commafeed
merge interface tweaks
This commit is contained in:
@@ -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.focus = function(count) {
|
||||||
$scope.current = count;
|
$scope.current = count;
|
||||||
|
$scope.mergeData.intoFeedId = count.feeds[0].id;
|
||||||
|
$scope.mergeData.feedIds = _.pluck(count.feeds, 'id');
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.merge = function() {
|
$scope.merge = function() {
|
||||||
|
|||||||
@@ -4,16 +4,19 @@
|
|||||||
Page <input type="number" ng-model="page" />
|
Page <input type="number" ng-model="page" />
|
||||||
Min. count <input type="number" ng-model="minCount" />
|
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="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">
|
<table class="table table-condensed table-hover" ui-if="counts">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th></th>
|
||||||
<th>url</th>
|
<th>url</th>
|
||||||
<th>count</h>
|
<th>count</h>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="count in counts" ng-click="focus(count)" class="pointer">
|
<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>
|
<td>{{count.feeds.length}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
Reference in New Issue
Block a user