aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2014-09-23 12:15:36 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2014-09-23 12:15:46 +0200
commitff2424690773fa5ba0e33a55e4f7db01d901aee7 (patch)
tree5b34c91581f862d422449151f42391ac16adce7c /server/sonar-web/src/main
parentccdfa7b7a3e7107b056f10c3a73b0b1259acdf24 (diff)
downloadsonarqube-ff2424690773fa5ba0e33a55e4f7db01d901aee7.tar.gz
sonarqube-ff2424690773fa5ba0e33a55e4f7db01d901aee7.zip
New URL widget/show?id=<widget id> to return only the widget HTML content, without layout nor <head>.
Diffstat (limited to 'server/sonar-web/src/main')
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/controllers/widget_controller.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/widget_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/widget_controller.rb
index 2a9ad511394..c40d8764c50 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/widget_controller.rb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/widget_controller.rb
@@ -29,6 +29,20 @@ class WidgetController < ApplicationController
render :action => 'index'
end
+ def show
+ load_resource
+ load_widget
+ begin
+ render :inline => @widget_definition.getTarget().getTemplate(), :locals => {
+ :widget_properties => @widget.properties_as_hash, :widget => @widget, :dashboard_configuration => @dashboard_configuration
+ }
+ rescue => error
+ logger.error(message('dashboard.cannot_render_widget_x', :params => [@widget_definition.getId(), error]), error)
+ render :status => 500
+ end
+
+ end
+
private
def load_resource