2008-07-25 20:56:48 +02:00
|
|
|
<br style="clear:both">
|
|
|
|
|
|
2019-05-17 19:34:49 +03:00
|
|
|
<% data = {
|
|
|
|
|
datasets: [{
|
2019-05-19 16:40:00 +03:00
|
|
|
data: Array.new,
|
2019-05-17 19:34:49 +03:00
|
|
|
}],
|
2019-05-19 16:40:00 +03:00
|
|
|
labels: Array.new,
|
|
|
|
|
ids: Array.new,
|
2019-05-17 19:34:49 +03:00
|
|
|
}
|
|
|
|
|
Stats::TopContextsQuery.new(current_user).result.map { |context|
|
|
|
|
|
data[:datasets][0][:data].append(context.total)
|
|
|
|
|
data[:labels].append(context.name)
|
2019-05-19 16:40:00 +03:00
|
|
|
data[:ids].append(context.id)
|
2019-05-17 19:34:49 +03:00
|
|
|
}
|
|
|
|
|
options = {
|
2019-05-19 16:51:26 +03:00
|
|
|
width: "400px",
|
|
|
|
|
height: "400px",
|
|
|
|
|
plugins: {
|
|
|
|
|
colorschemes: {
|
|
|
|
|
scheme: 'brewer.Paired12',
|
|
|
|
|
},
|
|
|
|
|
},
|
2019-05-17 19:34:49 +03:00
|
|
|
}
|
|
|
|
|
%>
|
2019-05-19 16:40:00 +03:00
|
|
|
<% #TODO: Move data handling to model. Show value as percentage %>
|
|
|
|
|
<%= pie_chart data, options.merge({
|
|
|
|
|
'title': {'display': true, 'text': t('stats.spread_of_actions_for_all_context')},
|
2019-05-19 18:46:02 +03:00
|
|
|
'onClick': 'function(event, array) { window.location.href = "' + url_for(:controller => 'contexts', :action => 'show', :id => -1).gsub('-1', '') + '" + array[0]._chart.chart.data.ids[array[0]._index]; }'
|
2019-05-19 16:40:00 +03:00
|
|
|
}) %>
|
2019-05-12 14:10:59 +03:00
|
|
|
|
2019-05-17 19:34:49 +03:00
|
|
|
<% data = {
|
|
|
|
|
datasets: [{
|
2019-05-19 16:40:00 +03:00
|
|
|
data: Array.new,
|
2019-05-17 19:34:49 +03:00
|
|
|
}],
|
2019-05-19 16:40:00 +03:00
|
|
|
labels: Array.new,
|
|
|
|
|
ids: Array.new,
|
|
|
|
|
}
|
2019-05-17 19:34:49 +03:00
|
|
|
Stats::TopContextsQuery.new(current_user, :running => true).result.map { |context|
|
|
|
|
|
data[:datasets][0][:data].append(context.total)
|
|
|
|
|
data[:labels].append(context.name)
|
2019-05-19 16:40:00 +03:00
|
|
|
data[:ids].append(context.id)
|
2019-05-17 19:34:49 +03:00
|
|
|
}
|
|
|
|
|
%>
|
2019-05-19 16:40:00 +03:00
|
|
|
<%= pie_chart data, options.merge({
|
2019-05-19 18:46:02 +03:00
|
|
|
'onClick': 'function(event, array) { window.location.href = "' + url_for(:controller => 'contexts', :action => 'show', :id => -1).gsub('-1', '') + '" + array[0]._chart.chart.data.ids[array[0]._index]; }',
|
2019-05-19 16:40:00 +03:00
|
|
|
'title': {'display': true, 'text': t('stats.spread_of_running_actions_for_visible_contexts')}}) %>
|
2019-05-12 14:10:59 +03:00
|
|
|
|
2019-05-19 13:04:33 +03:00
|
|
|
<br style="clear:both">
|
|
|
|
|
|
2013-03-02 08:11:15 -05:00
|
|
|
<%= render :partial => 'contexts_list', :locals => {:contexts => contexts.actions, :key => 'contexts'} -%>
|
|
|
|
|
|
|
|
|
|
<%= render :partial => 'contexts_list', :locals => {:contexts => contexts.running_actions, :key => 'visible_contexts_with_incomplete_actions'} -%>
|
2007-09-13 03:21:37 +00:00
|
|
|
|