2 container_id = 'widget-issue-filter-' + widget.id.to_s
3 filter_id = widget_properties['filter']
4 filter = Internal.issues.findIssueFilterById(filter_id.to_i)
5 distribution_axis = widget_properties['distributionAxis']
6 display_mode = widget_properties['displayMode']
7 is_enough_permissions = filter.shared || (current_user && filter.userLogin == current_user.login)
9 if @dashboard_configuration.selected_period?
10 period_date = @snapshot.period_datetime(@dashboard_configuration.period_index).strftime('%FT%T%z')
18 <% if is_enough_permissions %>
20 <% @widget_title = "<a href=\"#{url_for({:controller => 'component_issues', :action => 'index'})}?id=#{u(@project.key)}##{filter.data}\">#{h(filter.name)}</a>" %>
21 <% if widget_properties['displayFilterDescription'] && !filter.description.blank? %>
22 <p class="note spacer-bottom"><%= h filter.description -%></p>
25 <div id="<%= container_id -%>"></div>
28 var query = '<%= filter.data -%>';
30 // do not show widget if the filter contains "my" criterion,
31 // and a user is not authenticated
32 if (query && query.indexOf('__me__') !== -1 && !window.SS.user) {
33 jQuery('#<%= container_id -%>').closest('.block').addClass('hidden');
37 var IssueFilterWidget = require('issue-filter-widget');
38 window.requestMessages().done(function () {
39 new IssueFilterWidget({
40 el: '#<%= container_id -%>',
42 distributionAxis: '<%= distribution_axis -%>',
43 displayMode: '<%= display_mode -%>',
45 periodDate: '<%= period_date -%>',
47 componentUuid: '<%= @project.uuid -%>',
48 componentKey: '<%= @project.key -%>'
56 <p class="alert alert-warning"><%= message 'widget.issue_filter.insufficient_privileges_warning' -%></p>
62 <p class="alert alert-warning"><%= message 'widget.issue_filter.unknown_filter_warning' -%></p>