Implement support for some basic embed options for work sheets via LTI

This commit also fixes an issue with the flash messages being positioned too high and displayed for too long
This commit is contained in:
Sebastian Serth
2018-12-10 16:53:43 +01:00
parent 4fd128b31b
commit a0d8b30ef2
25 changed files with 178 additions and 90 deletions

View File

@ -5,7 +5,7 @@ class ApplicationController < ActionController::Base
MEMBER_ACTIONS = [:destroy, :edit, :show, :update]
after_action :verify_authorized, except: [:help, :welcome]
before_action :set_locale, :allow_iframe_requests
before_action :set_locale, :allow_iframe_requests, :load_embed_options
protect_from_forgery(with: :exception, prepend: true)
rescue_from Pundit::NotAuthorizedError, with: :render_not_authorized
@ -38,4 +38,14 @@ class ApplicationController < ActionController::Base
def allow_iframe_requests
response.headers.delete('X-Frame-Options')
end
def load_embed_options
if session[:embed_options].present? && session[:embed_options].is_a?(Hash)
@embed_options = session[:embed_options].symbolize_keys
else
@embed_options = {}
end
@embed_options
end
private :load_embed_options
end