lib/scrivito/controller_actions.rb in scrivito_sdk-0.60.0 vs lib/scrivito/controller_actions.rb in scrivito_sdk-0.65.0.rc1
- old
+ new
@@ -37,22 +37,27 @@
deliver_file if @obj.binary?
end
def show_widget
widget = load_widget
- render text: Scrivito::WidgetTag.new(view_context, widget).render, layout: false
+ widget_tag = Scrivito::WidgetTag.new(view_context, widget, nil, params[:template_name])
+ render text: widget_tag.render, layout: false
end
def widget_details
assert_dialog_layout
widget = load_widget
template_path = "#{widget.obj_class_name.underscore}/details"
+ @scrivito_default_widget_template = :details
render template_path, layout: 'scrivito_dialog', locals: {widget: widget}
end
def page_details
assert_dialog_layout
+ @scrivito_default_widget_template = :details
render @obj.details_view_path, layout: 'scrivito_dialog'
+ rescue ActionView::MissingTemplate
+ render 'scrivito/page_details', layout: 'scrivito_dialog'
end
def resource_details
assert_dialog_layout
@scrivito_resource = editing_context.selected_workspace.objs