Merge branch 'entry-filtering'

This commit is contained in:
Athou
2014-11-10 09:20:26 +01:00
15 changed files with 288 additions and 6 deletions

View File

@@ -98,6 +98,8 @@
"next_refresh" : "Next refresh",
"queued_for_refresh" : "Queued for refresh",
"feed_url" : "Feed URL",
"filtering_expression" : "Filtering expression",
"filtering_expression_help" : "If not empty, an expression evaluating to 'true' or 'false'. If false, new entries for this feed will be marked as read automatically.\nAvailable variables are 'title', 'content', 'url' and 'author' and their content is converted to lower case for convenience.\nExample: url.contains('youtube') or (author eq 'athou' and title.contains('github').\nComplete available syntax is available <a href='http://commons.apache.org/proper/commons-jexl/reference/syntax.html' target='_blank'>here</a>.",
"generate_api_key_first" : "Generate an API key in your profile first.",
"unsubscribe" : "Unsubscribe",
"unsubscribe_confirmation" : "Are you sure you want to unsubscribe from this feed?",

View File

@@ -322,17 +322,21 @@ module.controller('FeedDetailsCtrl', ['$scope', '$state', '$stateParams', 'FeedS
$scope.save = function() {
var sub = $scope.sub;
$scope.error = null;
FeedService.modify({
id : sub.id,
name : sub.name,
position : sub.position,
categoryId : sub.categoryId
categoryId : sub.categoryId,
filter : sub.filter
}, function() {
CategoryService.init();
$state.transitionTo('feeds.view', {
_id : 'all',
_type : 'category'
});
}, function(e) {
$scope.error = e.data;
});
};
}]);
@@ -489,7 +493,7 @@ module.controller('ToolbarCtrl', [
type : $stateParams._type,
id : $stateParams._id,
olderThan : olderThan,
keywords: $location.search().q,
keywords : $location.search().q,
read : true
});
};
@@ -882,7 +886,7 @@ module.controller('FeedListCtrl', [
service.mark({
id : $scope.selectedId,
olderThan : olderThan || $scope.timestamp,
keywords: $location.search().q,
keywords : $location.search().q,
read : true
}, function() {
CategoryService.refresh(function() {

View File

@@ -43,6 +43,10 @@ label {
display: block;
}
.pre-wrap {
white-space: pre-wrap;
}
.form-horizontal .control-group {
margin-bottom: 10px;
}

View File

@@ -3,6 +3,7 @@
<h3>{{ 'details.feed_details' | translate }}</h3>
</div>
<form name="form" class="form-horizontal" ng-submit="save()">
<div class="alert alert-danger" ng-if="error">{{ error }}</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'details.url' | translate }}</label>
<div class="col-sm-10 checkbox">
@@ -69,6 +70,14 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'details.filtering_expression' | translate }}</label>
<div class="col-sm-10 form-control-static">
<input type="text" name="filter" ng-model="sub.filter" class="form-control"></input>
<p class="help-block pre-wrap" ng-bind-html="'details.filtering_expression_help' | translate"></p>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary">{{ 'global.save' | translate }}</button>