class GroundColorsController < ApplicationController
if Manifest.manifest.magic_numbers['run_mode'] == 0
- before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
- before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
+ before_filter :authenticate_user, :only => []
+ before_filter :authenticate_author, :only => []
else
before_filter :authenticate_reader, :only => [
:index, :show, :by_panel, :by_author, :count, :count_by_panel, :count_by_author
]
- before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
- before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
+ before_filter :authenticate_user, :only => []
+ before_filter :authenticate_author, :only => []
end
def self.model
list_count
end
- def new
- raise Pettanr::NotWork unless @operators.author.working_panel
- @panel = Panel.edit(@operators.author.working_panel, @operators)
- @ground_color = GroundColor.new :panel_id => @panel.id, :code => params[:code].to_i
- @ground_color.supply_default
-
- respond_to do |format|
- format.html
- format.json { render :json => @ground_color.to_json(GroundColor.show_json_opt) }
- end
- end
-
- def edit
- @ground_color = GroundColor.show(params[:id], @operators)
- @panel = Panel.edit(@ground_color.panel.id, @operators)
-
- respond_to do |format|
- format.html
- end
- end
-
- def create
- raise Pettanr::NotWork unless @operators.author.working_panel
- @panel = Panel.edit(@operators.author.working_panel, @operators)
-
- @ground_color = GroundColor.new
- @ground_color.attributes = params[:ground_color]
- @ground_color.overwrite @panel.id
-
- respond_to do |format|
- if @ground_color.valid?
- if @ground_color.store @operators
- flash[:notice] = I18n.t('flash.notice.created', :model => Panel.model_name.human)
- format.html { redirect_to @panel }
- format.json { render json: @panel.panel_elements_as_json, status: :created, location: @panel }
- else
- flash[:notice] = I18n.t('flash.notice.not_created', :model => GroundColor.model_name.human)
- format.html { render action: "new" }
- format.json { render json: @ground_color.errors, status: :unprocessable_entity }
- end
- else
- flash[:notice] = I18n.t('flash.notice.not_created', :model => GroundColor.model_name.human)
- format.html { render action: "new" }
- format.json { render json: @ground_color.errors, status: :unprocessable_entity }
- end
- end
- end
-
- def update
- @ground_color = GroundColor.show(params[:id], @operators)
- @ground_color.attributes = params[:ground_color]
- @panel = Panel.edit(@ground_color.panel.id, @operators)
- @ground_color.overwrite @panel.id
-
- respond_to do |format|
- if @ground_color.store @operators
- flash[:notice] = I18n.t('flash.notice.updated', :model => GroundColor.model_name.human)
- format.html { redirect_to @ground_color }
- format.json { head :ok }
- else
- flash[:notice] = I18n.t('flash.notice.not_updated', :model => GroundColor.model_name.human)
- format.html { render action: "edit" }
- format.json { render json: @ground_color.errors, status: :unprocessable_entity }
- end
- end
- end
-
- def destroy
- @ground_color = GroundColor.show(params[:id], @operators)
- @panel = Panel.edit(@ground_color.panel.id, @operators)
-
- respond_to do |format|
- if @ground_color.remove @operators
- flash[:notice] = I18n.t('flash.notice.destroyed', :model => GroundColor.model_name.human)
- format.html { redirect_to @panel }
- format.json { head :ok }
- else
- flash[:notice] = I18n.t('flash.notice.not_destroyed', :model => GroundColor.model_name.human)
- format.html { redirect_to @ground_color }
- format.json { render json: @ground_color.errors, status: :unprocessable_entity }
- end
- end
- end
-
end
class GroundPicturesController < ApplicationController
if Manifest.manifest.magic_numbers['run_mode'] == 0
- before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
- before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
+ before_filter :authenticate_user, :only => []
+ before_filter :authenticate_author, :only => []
else
before_filter :authenticate_reader, :only => [
:index, :show, :by_panel, :by_author, :count, :count_by_panel, :count_by_author
]
- before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
- before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
+ before_filter :authenticate_user, :only => []
+ before_filter :authenticate_author, :only => []
end
-
+
def self.model
GroundPicture
end
list_count
end
- def new
- raise Pettanr::NotWork unless @operators.author.working_panel
- @picture = Picture.show params[:picture_id], @operators
- raise ActiveRecord::Forbidden unless @picture.enable?
- @panel = Panel.edit(@operators.author.working_panel, @operators)
-
- @ground_picture = GroundPicture.new :panel_id => @panel.id, :picture_id => @picture.id
- @ground_picture.supply_default
-
- respond_to do |format|
- format.html
- format.json { render :json => @ground_picture.to_json(GroundPicture.show_json_opt) }
- end
- end
-
- def edit
- @ground_picture = GroundPicture.show(params[:id], @operators)
- @panel = Panel.edit(@ground_picture.panel.id, @operators)
-
- respond_to do |format|
- format.html
- end
- end
-
- def create
- raise Pettanr::NotWork unless @operators.author.working_panel
- @panel = Panel.edit(@operators.author.working_panel, @operators)
-
- @ground_picture = GroundPicture.new
- @ground_picture.attributes = params[:ground_picture]
- @ground_picture.overwrite @panel.id
-
- @picture = Picture.show @ground_picture.picture_id, @operators
- raise ActiveRecord::Forbidden unless @picture.enable?
-
- respond_to do |format|
- if @ground_picture.valid?
- if @ground_picture.store @operators
- flash[:notice] = I18n.t('flash.notice.created', :model => Panel.model_name.human)
- format.html { redirect_to @panel }
- format.json { render json: @panel.panel_elements_as_json, status: :created, location: @panel }
- else
- flash[:notice] = I18n.t('flash.notice.not_created', :model => GroundPicture.model_name.human)
- format.html { render action: "new" }
- format.json { render json: @panel.errors, status: :unprocessable_entity }
- end
- else
- flash[:notice] = I18n.t('flash.notice.not_created', :model => GroundPicture.model_name.human)
- format.html { render action: "new" }
- format.json { render json: @ground_picture.errors, status: :unprocessable_entity }
- end
- end
- end
-
- def update
- @ground_picture = GroundPicture.show(params[:id], @operators)
- @ground_picture.attributes = params[:ground_picture]
- @panel = Panel.edit(@ground_picture.panel.id, @operators)
- @ground_picture.overwrite @panel.id
-
- @picture = Picture.show @ground_picture.picture_id, @operators
- raise ActiveRecord::Forbidden unless @picture.enable?
-
- respond_to do |format|
- if @ground_picture.store @operators
- flash[:notice] = I18n.t('flash.notice.updated', :model => GroundPicture.model_name.human)
- format.html { redirect_to @ground_picture }
- format.json { head :ok }
- else
- flash[:notice] = I18n.t('flash.notice.not_updated', :model => GroundPicture.model_name.human)
- format.html { render action: "edit" }
- format.json { render json: @ground_picture.errors, status: :unprocessable_entity }
- end
- end
- end
-
- def destroy
- @ground_picture = GroundPicture.show(params[:id], @operators)
- @panel = Panel.edit(@ground_picture.panel.id, @operators)
-
- respond_to do |format|
- if @ground_picture.remove @operators
- flash[:notice] = I18n.t('flash.notice.destroyed', :model => GroundPicture.model_name.human)
- format.html { redirect_to @panel }
- format.json { head :ok }
- else
- flash[:notice] = I18n.t('flash.notice.not_destroyed', :model => GroundPicture.model_name.human)
- format.html { redirect_to @ground_picture }
- format.json { render json: @ground_picture.errors, status: :unprocessable_entity }
- end
- end
- end
-
end
class PanelPicturesController < ApplicationController
if Manifest.manifest.magic_numbers['run_mode'] == 0
- before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
- before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
+ before_filter :authenticate_user, :only => []
+ before_filter :authenticate_author, :only => []
else
before_filter :authenticate_reader, :only => [
:index, :show, :by_panel, :by_author, :count, :count_by_panel, :count_by_author
]
- before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
- before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
+ before_filter :authenticate_user, :only => []
+ before_filter :authenticate_author, :only => []
end
-
+
def self.model
PanelPicture
end
show_json_format format
end
end
-
+
def count
list_count
end
list_count
end
- def new
- raise Pettanr::NotWork unless @operators.author.working_panel
- @picture = Picture.show params[:picture_id], @operators
- raise ActiveRecord::Forbidden unless @picture.enable?
- @panel = Panel.edit(@operators.author.working_panel, @operators)
-
- @item = PanelPicture.new :panel_id => @panel.id, :picture_id => @picture.id
- @item.supply_default
- respond_to do |format|
- format.html {
- mounted = 1
- form_manager = Pettanr::Application::manifest.form_managers[@item.form_name]
- @form = form_manager.open @item, @operators, mounted
- }
- format.json { render :json => @panel_picture.to_json(PanelPicture.show_json_opt) }
- end
- end
-
- def edit
- @item = PanelPicture.show(params[:id], @operators)
- @panel = Panel.edit(@item.panel.id, @operators)
-
- respond_to do |format|
- format.html {
- mounted = 1
- form_manager = Pettanr::Application::manifest.form_managers[@item.form_name]
- @form = form_manager.open @item, @operators, mounted
- }
- end
- end
-
- def create
- raise Pettanr::NotWork unless @operators.author.working_panel
- @panel = Panel.edit(@operators.author.working_panel, @operators)
-
- @panel_picture = PanelPicture.new
- @panel_picture.attributes = params[:panel_picture]
- @panel_picture.overwrite @panel.id
-
- @picture = Picture.show @panel_picture.picture_id, @operators
- raise ActiveRecord::Forbidden unless @picture.enable?
-
- respond_to do |format|
- if @panel_picture.valid?
- if @panel_picture.store @operators
- flash[:notice] = I18n.t('flash.notice.created', :model => Panel.model_name.human)
- format.html { redirect_to @panel }
- format.json { render json: @panel.panel_elements_as_json, status: :created, location: @panel }
- else
- flash[:notice] = I18n.t('flash.notice.not_created', :model => PanelPicture.model_name.human)
- format.html { render action: "new" }
- format.json { render json: @panel.errors, status: :unprocessable_entity }
- end
- else
- flash[:notice] = I18n.t('flash.notice.not_created', :model => PanelPicture.model_name.human)
- format.html { render action: "new" }
- format.json { render json: @panel_picture.errors, status: :unprocessable_entity }
- end
- end
- end
-
- def update
- @panel_picture = PanelPicture.show(params[:id], @operators)
- @panel_picture.attributes = params[:panel_picture]
- @panel = Panel.edit(@panel_picture.panel.id, @operators)
- @panel_picture.overwrite @panel.id
-
- @picture = Picture.show @panel_picture.picture_id, @operators
- raise ActiveRecord::Forbidden unless @picture.enable?
-
- respond_to do |format|
- if @panel_picture.store @operators
- flash[:notice] = I18n.t('flash.notice.updated', :model => PanelPicture.model_name.human)
- format.html { redirect_to @panel_picture }
- format.json { head :ok }
- else
- flash[:notice] = I18n.t('flash.notice.not_updated', :model => PanelPicture.model_name.human)
- format.html { render action: "edit" }
- format.json { render json: @panel_picture.errors, status: :unprocessable_entity }
- end
- end
- end
-
- def destroy
- @panel_picture = PanelPicture.show(params[:id], @operators)
- @panel = Panel.edit(@panel_picture.panel.id, @operators)
-
- respond_to do |format|
- if @panel_picture.remove @operators
- flash[:notice] = I18n.t('flash.notice.destroyed', :model => PanelPicture.model_name.human)
- format.html { redirect_to @panel }
- format.json { head :ok }
- else
- flash[:notice] = I18n.t('flash.notice.not_destroyed', :model => PanelPicture.model_name.human)
- format.html { redirect_to @panel_picture }
- format.json { render json: @panel_picture.errors, status: :unprocessable_entity }
- end
- end
- end
-
end
class SpeechBalloonsController < ApplicationController
if Manifest.manifest.magic_numbers['run_mode'] == 0
- before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
- before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
+ before_filter :authenticate_user, :only => []
+ before_filter :authenticate_author, :only => []
else
before_filter :authenticate_reader, :only => [
:index, :show, :by_panel, :by_author, :by_speech_balloon_template, :count, :count_by_panel, :count_by_author, :count_by_speech_balloon_template
]
- before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
- before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
+ before_filter :authenticate_user, :only => []
+ before_filter :authenticate_author, :only => []
end
-
+
def self.model
SpeechBalloon
end
list_count
end
- def new
- form_new
- end
-
- def edit
- form_edit
- end
-
- def create
- raise Pettanr::NotWork unless @operators.author.working_panel
- SpeechBalloon.fold_extend_settings params
- @panel = Panel.edit(@operators.author.working_panel, @operators)
- @speech_balloon = SpeechBalloon.new
- @speech_balloon.attributes = params[:speech_balloon]
-
- @speech_balloon_template = @speech_balloon.speech_balloon_template
- @speech_balloon.boost
-
- params[:speech_balloon][:balloon_attributes][:system_picture_id] = @speech_balloon.get_balloon.select_system_picture
-
- @speech_balloon.overwrite @panel.id
-
- respond_to do |format|
- if @speech_balloon.valid? and @speech_balloon.store(@operators, params[:speech_balloon])
- flash[:notice] = I18n.t('flash.notice.created', :model => Panel.model_name.human)
- format.html { redirect_to @panel }
- format.json { render json: @panel.panel_elements_as_json, status: :created, location: @panel }
- else
- flash[:notice] = I18n.t('flash.notice.not_created', :model => SpeechBalloon.model_name.human)
- format.html {
- render @speech_balloon_template.engine_name + '/speech_balloons/new'
- }
- format.json { render json: @speech_balloon.errors, status: :unprocessable_entity }
- end
- end
- end
-
- def update
- @item = SpeechBalloon.show(params[:id], @operators)
- @speech_balloon = @item
- @form = Locmare::Bucket.factory @item.item_name, @item, true, true, @operators
- @form.fold_extend_settings params
- @speech_balloon.attributes = params[:speech_balloon]
-
- @speech_balloon_template = @speech_balloon.speech_balloon_template
-
- params[:speech_balloon][:balloon_attributes][:system_picture_id] = @speech_balloon.balloon.select_system_picture
-
- @panel = Panel.edit(@speech_balloon.panel.id, @operators)
- @speech_balloon.overwrite @panel.id
-
- respond_to do |format|
- if @speech_balloon.save
- flash[:notice] = I18n.t('flash.notice.updated', :model => SpeechBalloon.model_name.human)
- format.html { redirect_to @speech_balloon }
- format.json { head :ok }
- else
- flash[:notice] = I18n.t('flash.notice.not_updated', :model => SpeechBalloon.model_name.human)
- format.html {
- render @speech_balloon.speech_balloon_template.engine_name + '/speech_balloons/edit'
- }
- format.json { render json: @speech_balloon.errors, status: :unprocessable_entity }
- end
- end
- end
-
- def destroy
- @speech_balloon = SpeechBalloon.show(params[:id], @operators)
- @panel = Panel.edit(@speech_balloon.panel.id, @operators)
-
- respond_to do |format|
- if @speech_balloon.remove @operators.author
- flash[:notice] = I18n.t('flash.notice.destroyed', :model => SpeechBalloon.model_name.human)
- format.html { redirect_to @panel }
- format.json { head :ok }
- else
- flash[:notice] = I18n.t('flash.notice.not_destroyed', :model => SpeechBalloon.model_name.human)
- format.html { redirect_to @speech_balloon }
- format.json { render json: @speech_balloon.errors, status: :unprocessable_entity }
- end
- end
- end
-
end
end
def scenario
- panel_elements.map { |e|
+ scenario_elements.map { |e|
e.scenario
}.join
end
def plain_scenario
- panel_elements.map { |e|
+ scenario_elements.map { |e|
e.plain_scenario
}.join
end
--- /dev/null
+<% if element.speech.quotes.blank? -%>
+<% else -%>
+ <style>
+ <!--
+ #<%= element.speech.dom_item_id('scenario') -%>:before {
+ content:"<%= element.speech.arrayed_quotes[0] -%>";
+ }
+ #<%= element.speech.dom_item_id('scenario') -%>:after {
+ content:"<%= element.speech.arrayed_quotes[1] -%>";
+ }
+ -->
+ </style>
+<% end -%>
+<%= content_tag :div, '', element.balloon.tag_attributes('scenario', :class => "circle_speech_balloon-balloon-scenario") do %>
+ <%= h(element.caption) %>
+<% end %>
+<%= content_tag :div, '', element.speech.tag_attributes('scenario', :class => "circle_speech_balloon-speech-scenario") do %>
+ <%= h(element.speech.content) %>
+<% end %>
<%= render editor.generator.template_name, :generator => editor.generator %>
<div id="writing_formats">
<% WritingFormat.enable_list().each do |wf| %>
- <div id="writing_format-<%= wf.id -%>" writing_format_id="<%= wf.id -%>" writing_format_engine_name="<%= wf.engine_name -%>">
+ <div id="writing_format-<%= wf.id -%>" writing_format_id="<%= wf.id -%>" writing_format_engine_name="<%= wf.my_engine_name -%>">
</div>
<% end %>
</div>
end
def elements
- self.root_item.panel_elements
+ self.root_item.scenario_elements
end
end
end
def elements
- self.root_item.panel_elements
+ self.root_item.scenario_elements
end
def class_name
end
def elements
- self.root_item.panel_elements
+ self.root_item.scenario_elements
end
def class_name
def initialize parent
super
- @form = Locmare::Form.new self.element.item_name, self.element, self.mounted, false, @operators
+ @form = Locmare::Bucket.new self.element.item_name, self.element, self.mounted, false, @operators
@bucket = FormBucket.new self, @form
end
def editize
@root_item.boosts 'post'
self.register nil, @root_item
- # editize_element @root_item # test
+ editize_element @root_item
end
def editize_element parent
- parent.class.child_element_names(@root_item.class.element_tree_name).each do |element_name|
+ parent.class.child_element_names.each do |element_name|
e = parent.__send__ element_name
- e = [e] unless e.respond_to? :each
- e.each do |element|
- element.boost
- self.register parent, element
- self.editize_element element
+ e = [e] unless e.respond_to?(:each)
+ e.each do |element_item|
+ element_item.boosts 'post'
+ self.register parent, element_item
+ self.editize_element element_item
end
end
end
res
end
- def elements
- self.scenario_elements.map {|e|
- #(-_-;)<... kore wa hidoi
- JSON.parse e.to_json({:include => e.class.json_opt_for_panel})
- }
- end
-
- def scenario_elements_as_json
- self.to_json({:include => {:author => {}}, :methods => :elements})
- end
-
- def self.list_as_json_text ary
- '[' + ary.map {|i| i.panel_elements_as_json }.join(',') + ']'
- end
-
def new_t
self.scenario_elements.size
end