# HG changeset patch # User durandn # Date 1433954200 -7200 # Node ID a2316b57449976fd920bf1ade65e45f09495a81d # Parent cc17e3d211cd996fccb8f6e66e41dfedad47d1d8 Added a filter based on annotation user name for AnnotationList metadataplayer widget + Added a way to make the creator field readonly for CreateAnnotation widget (so you can define a given annotation creator name for the widget that the user can't change) diff -r cc17e3d211cd -r a2316b574499 src/ldt/ldt/static/ldt/metadataplayer/AnnotationsList.js --- a/src/ldt/ldt/static/ldt/metadataplayer/AnnotationsList.js Wed Jun 10 16:24:24 2015 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/AnnotationsList.js Wed Jun 10 18:36:40 2015 +0200 @@ -35,9 +35,15 @@ newest_first : false, show_audio: true, show_creation_date: false, + /* + * Only annotation in the current segment will be displayed. Designed to work with the Segments Widget. + */ filter_by_segments: false, - show_only_from_user: false, segments_annotation_type: "chap", + /* + * Set to a username if you only want to display annotations from a given user + */ + show_only_annotation_from_user: false, polemics : [{ keyword: "++", background_color: "#c9ecc6" @@ -173,8 +179,11 @@ return (_current_segments[0].begin <= _annotation_time && _current_segments[0].end >= _annotation_time) }); } - - + } + if (this.show_only_annotation_from_user){ + _list = _list.filter(function(_annotation){ + return _annotation.creator == _this.show_only_annotation_from_user; + }); } if (this.limit_count) { /* Get the n annotations closest to current timecode */ diff -r cc17e3d211cd -r a2316b574499 src/ldt/ldt/static/ldt/metadataplayer/CreateAnnotation.js --- a/src/ldt/ldt/static/ldt/metadataplayer/CreateAnnotation.js Wed Jun 10 16:24:24 2015 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/CreateAnnotation.js Wed Jun 10 18:36:40 2015 +0200 @@ -9,6 +9,7 @@ IriSP.Widgets.CreateAnnotation.prototype.defaults = { show_title_field : true, show_creator_field : true, + creator_field_readonly : false, start_visible : true, always_visible : false, show_slice : true, @@ -104,7 +105,7 @@ + '

{{/show_title_field}}' + ' {{#show_slice}}{{l10n.from_time}} {{/show_slice}}{{^show_slice}}{{l10n.at_time}} {{/show_slice}} 00:00' + '{{#show_slice}} {{l10n.to_time}} {{end}}{{/show_slice}}' - + '{{#show_creator_field}}{{l10n.your_name_}} {{/show_creator_field}}

' + + '{{#show_creator_field}}{{l10n.your_name_}} {{/show_creator_field}}' + '' + '
' + ''