diff --git a/app/controllers/embed_controller.rb b/app/controllers/embed_controller.rb index 692243a..99258e1 100644 --- a/app/controllers/embed_controller.rb +++ b/app/controllers/embed_controller.rb @@ -1,9 +1,17 @@ class EmbedController < ApplicationController - #no_design_blocks - no_design_theme + def embed_block + block = Block.find(params[:id]) + source = params[:source] - def index - end + if !block.visible? + render :template => 'shared/embed_denied.rhtml', :status => 403, :layout => "embed-block" + else + locals = {:source => source, :block => block} + render 'embed/index', :layout => 'embed-block', :locals => locals + end + rescue ActiveRecord::RecordNotFound + render :template => 'shared/embed_not_found.rhtml', :status => 404, :layout => "embed-block" + end end diff --git a/app/views/embed/index.html.erb b/app/views/embed/index.html.erb index 057e033..324854f 100644 --- a/app/views/embed/index.html.erb +++ b/app/views/embed/index.html.erb @@ -1 +1 @@ -<%= 'bli' %> +<%= display_block(block) %> diff --git a/app/views/layouts/embed-block.rhtml b/app/views/layouts/embed-block.rhtml new file mode 100644 index 0000000..eac5f45 --- /dev/null +++ b/app/views/layouts/embed-block.rhtml @@ -0,0 +1,23 @@ + + +
+<%= _('Embed denied. The requested embed is disable.') %>
++ <%= _('You may have clicked an expired link or mistyped the address.') %> + <%= _('If you clicked a link that was in another site, or was given to you by someone else, it would be nice if you tell them that their link is not valid anymore.') %> +
+