+
diff --git a/app/controllers/embed_controller.rb b/app/controllers/embed_controller.rb index 99258e1..25ecf5f 100644 --- a/app/controllers/embed_controller.rb +++ b/app/controllers/embed_controller.rb @@ -5,13 +5,13 @@ class EmbedController < ApplicationController source = params[:source] if !block.visible? - render :template => 'shared/embed_denied.rhtml', :status => 403, :layout => "embed-block" + render :template => 'shared/embed_denied.rhtml', :status => 403, :layout => "embed" else locals = {:source => source, :block => block} - render 'embed/index', :layout => 'embed-block', :locals => locals + render 'embed/index', :layout => 'embed', :locals => locals end rescue ActiveRecord::RecordNotFound - render :template => 'shared/embed_not_found.rhtml', :status => 404, :layout => "embed-block" + render :template => 'shared/embed_not_found.rhtml', :status => 404, :layout => "embed" end end diff --git a/app/helpers/boxes_helper.rb b/app/helpers/boxes_helper.rb index 4ce343a..6ee611a 100644 --- a/app/helpers/boxes_helper.rb +++ b/app/helpers/boxes_helper.rb @@ -221,11 +221,13 @@ module BoxesHelper #if block.respond_to?(:embedable) if true + + url = url_for :controller => 'embed', :action => 'embed_block', :id => block.id, :only_path => false; + html = content_tag('div', - content_tag('h2', _('Embed code')) + + content_tag('h2', _('Embed block code')) + content_tag('div', 'Below, you''ll see a field containing embed code for the block. Just copy the code and paste it into your website or blogging software.', :style => 'margin-bottom: 1em;') + - content_tag('textarea', '*This is the embed code for this block!*', :style => 'margin-bottom: 1em; width:100%; height:40%;') + - thickbox_copy_to_clipboard_button(_('Copy to clipboard')) + + content_tag('textarea', block.embed_code(url), :style => 'margin-bottom: 1em; width:100%; height:40%;') + thickbox_close_button(_('Close')), :style => 'display: none;', :id => "embed-code-box-#{block.id}") buttons << thickbox_inline_popup_icon(:embed, _('Embed code'), {}, "embed-code-box-#{block.id}") << html diff --git a/app/models/block.rb b/app/models/block.rb index 1d51c1c..f27959a 100644 --- a/app/models/block.rb +++ b/app/models/block.rb @@ -16,6 +16,10 @@ class Block < ActiveRecord::Base named_scope :enabled, :conditions => { :enabled => true } + def embed_code(url) + html = "" + end + # Determines whether a given block must be visible. Optionally a # context must be specified. context must be a hash, and # may contain the following keys: diff --git a/app/views/layouts/embed-block.rhtml b/app/views/layouts/embed-block.rhtml deleted file mode 100644 index eac5f45..0000000 --- a/app/views/layouts/embed-block.rhtml +++ /dev/null @@ -1,23 +0,0 @@ - - -
-