export_from_provider(url)
end
+ rescue_from Pettanr::NotWork, :with => :render_not_work
+ def render_not_work(exception = nil)
+ if exception
+ logger.info "Rendering , :: #{exception.message}"
+ end
+ respond_to do |format|
+ format.html {
+ render :file => "#{Rails.root}/public/not_work.html", :layout => false
+ }
+ format.json {
+ render :text => "400 Not work", :status => 400
+ }
+ end
+ end
+
if Rails.env == 'production'
rescue_from ActiveRecord::RecordNotFound, :with => :render_404
rescue_from ActiveRecord::Forbidden, :with => :render_403
end
def new
+ raise Pettanr::NotWork unless @author.working_panel
@panel = Panel.edit(@author.working_panel, @author)
@ground_color = GroundColor.new :panel_id => @panel.id, :code => params[:code].to_i
@ground_color.supply_default
end
def create
+ raise Pettanr::NotWork unless @author.working_panel
@panel = Panel.edit(@author.working_panel, @author)
@ground_color = GroundColor.new
end
def new
+ raise Pettanr::NotWork unless @author.working_panel
@picture = Picture.show params[:picture_id], @author
raise ActiveRecord::Forbidden unless @picture.enable?
@panel = Panel.edit(@author.working_panel, @author)
end
def create
+ raise Pettanr::NotWork unless @author.working_panel
@panel = Panel.edit(@author.working_panel, @author)
@ground_picture = GroundPicture.new
end
def new
+ raise Pettanr::NotWork unless @author.working_panel
@picture = Picture.show params[:picture_id], @author
raise ActiveRecord::Forbidden unless @picture.enable?
@panel = Panel.edit(@author.working_panel, @author)
end
def create
+ raise Pettanr::NotWork unless @author.working_panel
@panel = Panel.edit(@author.working_panel, @author)
@panel_picture = PanelPicture.new
end
def new
+ raise Pettanr::NotWork unless @author.working_panel
@speech_balloon_template = SpeechBalloonTemplate.show params[:speech_balloon_template_id], @author
@panel = Panel.edit(@author.working_panel, @author)
end
def create
+ raise Pettanr::NotWork unless @author.working_panel
SpeechBalloon.fold_extend_settings params
@panel = Panel.edit(@author.working_panel, @author)
@speech_balloon = SpeechBalloon.new
TestLayout = false
class BadRequest < StandardError
end
+ class NotWork < StandardError
+ end
end
--- /dev/null
+<!DOCTYPE html>
+<html>
+<head>
+ <title>コマをつかんでいません</title>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/404.html -->
+ <div class="dialog">
+ <h1>作業対象のコマが指定されていません。</h1>
+ <p>エレメントを新規作成するなど、一部の操作ではコマをつかんでおく必要があります。</p>
+ </div>
+</body>
+</html>