mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
added unsubscribe link
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
<a dropdown-toggle class="pull-right feed-menu-icon"><i class="icon icon-chevron-down"></i> </a>
|
<a dropdown-toggle class="pull-right feed-menu-icon"><i class="icon icon-chevron-down"></i> </a>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li>
|
<li>
|
||||||
<a>Unsubscribe</a>
|
<a ng-click="unsubscribe(feed)">Unsubscribe</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -56,6 +56,21 @@ module.directive('category', function($compile) {
|
|||||||
format-category-name="formatCategoryName({category:category})" format-feed-name="formatFeedName({feed:feed})">\
|
format-category-name="formatCategoryName({category:category})" format-feed-name="formatFeedName({feed:feed})">\
|
||||||
</category>');
|
</category>');
|
||||||
$compile(ul.contents())(scope);
|
$compile(ul.contents())(scope);
|
||||||
|
},
|
||||||
|
controller: function($scope, $dialog, SubscriptionService) {
|
||||||
|
$scope.unsubscribe = function(subscription) {
|
||||||
|
var title = 'Unsubscribe';
|
||||||
|
var msg = 'Unsubscribe from ' + subscription.name + ' ?';
|
||||||
|
var btns = [{result:'cancel', label: 'Cancel'}, {result:'ok', label: 'OK', cssClass: 'btn-primary'}];
|
||||||
|
|
||||||
|
$dialog.messageBox(title, msg, btns)
|
||||||
|
.open()
|
||||||
|
.then(function(result){
|
||||||
|
if(result == 'ok'){
|
||||||
|
SubscriptionService.unsubscribe(subscription.id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user