<%
- containerId = 'pie-chart-widget' + widget.id.to_s
+ containerId = 'word-cloud' + widget.id.to_s
chartTitle = widget_properties['chartTitle']
filterId = widget_properties['filter'].to_i
maxItems = widget_properties['maxItems'].to_i
<%
- containerId = 'pie-chart-widget' + widget.id.to_s
+ containerId = 'histogram-widget' + widget.id.to_s
chartTitle = widget_properties["chartTitle"]
filterId = widget_properties["filter"].to_i
maxItems = widget_properties["maxItems"].to_i
requestDetails = ->
- $.get "#{baseUrl}/api/dashboards/details", key: App.dashboard, (data) ->
+ $.get "#{baseUrl}/api/dashboards/show", key: App.dashboard, (data) ->
App.dashboard = new Backbone.Model _.omit data, 'widgets'
App.widgets = new Widgets data.widgets
comparator: (model) ->
- model.get('layout').row
+ model.get('row')
]
jQuery.mockjax
- url: "#{baseUrl}/api/dashboards/available_widgets"
+ url: "#{baseUrl}/api/dashboards/widgets"
responseText: JSON.stringify
widgets: [
+ {
+ key: 'action_plans'
+ name: 'Action Plans'
+ description: 'Shows all the open action plans of the project.'
+ category: ''
+ }
+ {
+ key: ''
+ name: ''
+ description: ''
+ category: ''
+ }
+ {
+ key: ''
+ name: ''
+ description: ''
+ category: ''
+ }
+ {
+ key: ''
+ name: ''
+ description: ''
+ category: ''
+ }
+ {
+ key: ''
+ name: ''
+ description: ''
+ category: ''
+ }
+ {
+ key: ''
+ name: ''
+ description: ''
+ category: ''
+ }
{
key: ''
name: ''
description: ''
category: ''
- props: []
}
]
getWidgetProps: ->
- properties = @model.get 'properties'
+ properties = @model.get 'props'
r = {}
properties.forEach (prop) ->
- r[prop.key] = prop.value if prop.value?
+ r[prop.key] = prop.val if prop.val?
r
appendHtml: (compositeView, itemView) ->
- layout = itemView.model.get 'layout'
- column = layout.column - 1
+ column = itemView.model.get('col') - 1
$container = @getItemViewContainer compositeView
$container.eq(column).append itemView.el
+<% if @snapshot %>
+ <a href="<%= url_for :controller => :dashboard2, :action => :index, :did => @dashboard.id, :id => @resource.id -%>">New Version</a>
+<% else %>
+ <a href="<%= url_for :controller => :dashboard2, :action => :index, :did => @dashboard.id -%>">New Version</a>
+<% end %>
+
<% if logged_in? || @snapshot %>
<div class="line-block">