# HG changeset patch # User durandn # Date 1442852672 -7200 # Node ID 8158421193e344bf484236c388aa17f73b3ab29e # Parent ded3cd1312c1c56e0c36a3545e6de7f7e0b19118 Fixed user filter on AnnotationList to not display username in the dropdown but what is displayed in the list + Added project_id to api templates for delete in case the target API understands it diff -r ded3cd1312c1 -r 8158421193e3 src/widgets/AnnotationsList.js --- a/src/widgets/AnnotationsList.js Fri Sep 18 17:21:12 2015 +0200 +++ b/src/widgets/AnnotationsList.js Mon Sep 21 18:24:32 2015 +0200 @@ -51,6 +51,7 @@ annotations_count_header : true, show_creation_date : false, show_timecode : true, + project_id: "", /* * Only annotation in the current segment will be displayed. Designed to work with the Segments Widget. */ @@ -684,7 +685,7 @@ IriSP.Widgets.AnnotationsList.prototype.sendDelete = function(id){ var _this = this, - _url = Mustache.to_html(this.api_delete_endpoint, {annotation_id: id}) + _url = Mustache.to_html(this.api_delete_endpoint, {annotation_id: id, project_id: this.project_id}) IriSP.jQuery.ajax({ url: _url, @@ -724,7 +725,17 @@ }); this.userselect_$.html(""); this.usernames.forEach(function(_user){ - _this.userselect_$.append(""); + var _users = _this.source.users_data.filter(function(_user_data){ + return _user_data.username == _user; + }), + _user_data = {}; + if (_users.length == 0){ + _user_data.username = _user; + } + else{ + _user_data = _users[0]; + } + _this.userselect_$.append(""); }); } if (this.keyword_filter){ diff -r ded3cd1312c1 -r 8158421193e3 src/widgets/Markers.js --- a/src/widgets/Markers.js Fri Sep 18 17:21:12 2015 +0200 +++ b/src/widgets/Markers.js Mon Sep 21 18:24:32 2015 +0200 @@ -505,7 +505,7 @@ IriSP.Widgets.Markers.prototype.sendDelete = function(){ _this = this; - _url = Mustache.to_html(this.api_endpoint_template_delete, {annotation_id: this.selectedMarker ? this.selectedMarker.id : ""}); + _url = Mustache.to_html(this.api_endpoint_template_delete, {annotation_id: this.selectedMarker ? this.selectedMarker.id : "", project_id: this.selectedMarker.project_id? this.selectedMarker.project_id : this.project_id}); IriSP.jQuery.ajax({ url: _url, type: this.api_method_delete,