From 7a49b06b1e7242f4c4ed09e2890a7220c1800548 Mon Sep 17 00:00:00 2001 From: yasushiito Date: Wed, 18 Dec 2013 14:08:37 +0900 Subject: [PATCH] work --- app/controllers/panel_pictures_controller.rb | 2 +- app/controllers/speech_balloons_controller.rb | 26 +++++++++++------------ app/views/ground_colors/new.html.erb | 2 +- app/views/ground_pictures/new.html.erb | 2 +- app/views/home/index.html.erb | 1 + app/views/panel_pictures/new.html.erb | 2 +- app/views/panels/_element_form.html.erb | 2 +- app/views/panels/edit.html.erb | 2 +- app/views/panels/new.html.erb | 2 +- app/views/resource_pictures/show.html.erb | 6 +++--- app/views/speech_balloon_templates/index.html.erb | 2 +- app/views/speech_balloon_templates/show.html.erb | 6 +++--- lib/manifest/form.rb | 12 ++++++++++- lib/manifest/manifest.rb | 3 +++ 14 files changed, 42 insertions(+), 28 deletions(-) diff --git a/app/controllers/panel_pictures_controller.rb b/app/controllers/panel_pictures_controller.rb index cf55a8fa..e1b71fb2 100644 --- a/app/controllers/panel_pictures_controller.rb +++ b/app/controllers/panel_pictures_controller.rb @@ -54,7 +54,7 @@ class PanelPicturesController < ApplicationController end def create - raise Pettanr::NotWork unless @author.working_panel + raise Pettanr::NotWork unless @operators.author.working_panel @panel = Panel.edit(@operators.author.working_panel, @operators) @panel_picture = PanelPicture.new diff --git a/app/controllers/speech_balloons_controller.rb b/app/controllers/speech_balloons_controller.rb index e55e1760..6e95295b 100644 --- a/app/controllers/speech_balloons_controller.rb +++ b/app/controllers/speech_balloons_controller.rb @@ -48,10 +48,10 @@ class SpeechBalloonsController < ApplicationController end def new - raise Pettanr::NotWork unless @author.working_panel - @speech_balloon_template = SpeechBalloonTemplate.show params[:speech_balloon_template_id], @author + raise Pettanr::NotWork unless @operators.author.working_panel + @speech_balloon_template = SpeechBalloonTemplate.show params[:speech_balloon_template_id], @operators - @panel = Panel.edit(@author.working_panel, @author) + @panel = Panel.edit(@operators.author.working_panel, @operators) @speech_balloon = SpeechBalloon.new :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id @speech_balloon.boost @speech_balloon.supply_default @@ -67,9 +67,9 @@ class SpeechBalloonsController < ApplicationController end def edit - @speech_balloon = SpeechBalloon.show(params[:id], @author) + @speech_balloon = SpeechBalloon.show(params[:id], @operators.author) @speech_balloon_template = @speech_balloon.speech_balloon_template - @panel = Panel.edit(@speech_balloon.panel.id, @author) + @panel = Panel.edit(@speech_balloon.panel.id, @operators.author) @speech_balloon.boost @@ -81,9 +81,9 @@ class SpeechBalloonsController < ApplicationController end def create - raise Pettanr::NotWork unless @author.working_panel + raise Pettanr::NotWork unless @operators.author.working_panel SpeechBalloon.fold_extend_settings params - @panel = Panel.edit(@author.working_panel, @author) + @panel = Panel.edit(@operators.author.working_panel, @author) @speech_balloon = SpeechBalloon.new @speech_balloon.attributes = params[:speech_balloon] @@ -111,7 +111,7 @@ class SpeechBalloonsController < ApplicationController def update SpeechBalloon.fold_extend_settings params - @speech_balloon = SpeechBalloon.show(params[:id], @author) + @speech_balloon = SpeechBalloon.show(params[:id], @operators.author) @speech_balloon.attributes = params[:speech_balloon] @speech_balloon_template = @speech_balloon.speech_balloon_template @@ -119,11 +119,11 @@ class SpeechBalloonsController < ApplicationController params[:speech_balloon][:balloon_attributes][:system_picture_id] = @speech_balloon.get_balloon.select_system_picture - @panel = Panel.edit(@speech_balloon.panel.id, @author) + @panel = Panel.edit(@speech_balloon.panel.id, @operators.author) @speech_balloon.overwrite @panel.id respond_to do |format| - if @speech_balloon.valid? and @speech_balloon.store(@author, params[:speech_balloon]) + if @speech_balloon.valid? and @speech_balloon.store(@operators.author, params[:speech_balloon]) flash[:notice] = I18n.t('flash.notice.updated', :model => SpeechBalloon.model_name.human) format.html { redirect_to @speech_balloon } format.json { head :ok } @@ -138,11 +138,11 @@ class SpeechBalloonsController < ApplicationController end def destroy - @speech_balloon = SpeechBalloon.show(params[:id], @author) - @panel = Panel.edit(@speech_balloon.panel.id, @author) + @speech_balloon = SpeechBalloon.show(params[:id], @operators.author) + @panel = Panel.edit(@speech_balloon.panel.id, @operators.author) respond_to do |format| - if @speech_balloon.remove @author + 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 } diff --git a/app/views/ground_colors/new.html.erb b/app/views/ground_colors/new.html.erb index f853f7e7..b79147f8 100644 --- a/app/views/ground_colors/new.html.erb +++ b/app/views/ground_colors/new.html.erb @@ -2,6 +2,6 @@

<%= notice %>

<%= t('home.index.catch') -%>

-<%= render 'panels/standard', :panel => @panel, :author => @author %> +<%= render 'panels/standard', :panel => @panel, :operators => @operators %>

<%= t('ground_colors.create_color') -%>

<%= render @ground_color.form_template, :elm => @ground_color, :no_attr => 0 %> diff --git a/app/views/ground_pictures/new.html.erb b/app/views/ground_pictures/new.html.erb index 8493ff05..138e608e 100644 --- a/app/views/ground_pictures/new.html.erb +++ b/app/views/ground_pictures/new.html.erb @@ -2,7 +2,7 @@

<%= notice %>

<%= t('home.index.catch') -%>

-<%= render 'panels/standard', :panel => @panel, :author => @author %> +<%= render 'panels/standard', :panel => @panel, :operators => @operators %>

<%= t('ground_pictures.create_ground_picture') -%>

<% if @ground_picture.picture and @ground_picture.picture.resource_picture %> diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 3fc48ad2..54accf3e 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -53,6 +53,7 @@ diff --git a/app/views/panel_pictures/new.html.erb b/app/views/panel_pictures/new.html.erb index 8c86441f..27aecb65 100644 --- a/app/views/panel_pictures/new.html.erb +++ b/app/views/panel_pictures/new.html.erb @@ -2,7 +2,7 @@

<%= notice %>

<%= t('home.index.catch') -%>

-<%= render 'panels/standard', :panel => @panel, :author => @author %> +<%= render 'panels/standard', :panel => @panel, :operators => @operators %>

<%= t('panel_pictures.resource_picture') -%>

<% if @panel_picture.picture and @panel_picture.picture.resource_picture %>
<%= link_to t_m('GroundColor'), '/home/ground_colors' %> + <%= link_to t('*'), new_ground_color_path %>
diff --git a/app/views/panels/_element_form.html.erb b/app/views/panels/_element_form.html.erb index 70eda646..dfc8d5d1 100644 --- a/app/views/panels/_element_form.html.erb +++ b/app/views/panels/_element_form.html.erb @@ -1,6 +1,6 @@ <% element_name = elm.element_name %> <% extend_element_name = elm.extend_element_name %> -<% form_configurations = elm.find_configurations @configurations['forms'], extend_element_name %> +<% form_configurations = Pettanr::Application::manifest.profiler_managers[extend_element_name] %> <% base_attributes = if form_configurations['base'] %> <% @configurations['forms'][form_configurations['base']]['attributes'] %> <% else %> diff --git a/app/views/panels/edit.html.erb b/app/views/panels/edit.html.erb index 4e9faf3a..f2f63050 100644 --- a/app/views/panels/edit.html.erb +++ b/app/views/panels/edit.html.erb @@ -2,7 +2,7 @@

<%= notice %>

- <%= render 'panels/body', :panel => @panel, :author => @author, :spot => nil %> + <%= render 'panels/body', :panel => @panel, :operators=> @operators, :spot => nil %> <%= render 'form', :panel => @panel %>
<%= link_to t('link.destroy'), panel_path(@panel), :method => :delete %> diff --git a/app/views/panels/new.html.erb b/app/views/panels/new.html.erb index fe255b56..7395af26 100644 --- a/app/views/panels/new.html.erb +++ b/app/views/panels/new.html.erb @@ -1,6 +1,6 @@

<%= t '.title' -%>

- <%= render 'panels/body', :panel => @panel, :author => @author, :spot => nil %> + <%= render 'panels/body', :panel => @panel, :operators => @operators, :spot => nil %> <%= render 'form', :panel => @panel %>
diff --git a/app/views/resource_pictures/show.html.erb b/app/views/resource_pictures/show.html.erb index 9dc43031..ab30c402 100644 --- a/app/views/resource_pictures/show.html.erb +++ b/app/views/resource_pictures/show.html.erb @@ -42,10 +42,10 @@ <%= link_to t('link.back'), resource_pictures_path %> -<% if @author and @author.working? -%> +<% if @operators.author and @operators.author.working? -%>

<%= t('home.index.catch') -%>

- <%= link_to panel_icon(:object => @author.working_panel, :size => 25), panel_path(@author.working_panel) %> - <%= link_to @author.working_panel.caption, main_app.panel_path(@author.working_panel) %> + <%= link_to panel_icon(:object => @operators.author.working_panel, :size => 25), panel_path(@operators.author.working_panel) %> + <%= link_to @operators.author.working_panel.caption, main_app.panel_path(@operators.author.working_panel) %>

<%= link_to t('resource_pictures.add_to_panel_for_panel_picture'), main_app.new_panel_picture_path(:picture_id => @resource_picture.picture_id) %> diff --git a/app/views/speech_balloon_templates/index.html.erb b/app/views/speech_balloon_templates/index.html.erb index 35338bbb..48afbe65 100644 --- a/app/views/speech_balloon_templates/index.html.erb +++ b/app/views/speech_balloon_templates/index.html.erb @@ -10,7 +10,7 @@

- <% if @author and @author.working? -%> + <% if @operators.author and @operators.author.working? -%> <%= link_to t('speech_balloon_templates.add_to_panel'), main_app.new_speech_balloon_path(:speech_balloon_template_id => st.id) %> <% end -%>
diff --git a/app/views/speech_balloon_templates/show.html.erb b/app/views/speech_balloon_templates/show.html.erb index 74f810e2..45321a57 100644 --- a/app/views/speech_balloon_templates/show.html.erb +++ b/app/views/speech_balloon_templates/show.html.erb @@ -8,10 +8,10 @@ -<% if @author and @author.working? -%> +<% if @operators.author and @operators.author.working? -%>

<%= t('home.index.catch') -%>

- <%= link_to panel_icon(:object => @author.working_panel, :size => 25), panel_path(@author.working_panel) %> - <%= link_to @author.working_panel.caption, main_app.panel_path(@author.working_panel) %> + <%= link_to panel_icon(:object => @operators.author.working_panel, :size => 25), panel_path(@operators.author.working_panel) %> + <%= link_to @operators.author.working_panel.caption, main_app.panel_path(@operators.author.working_panel) %>

<%= link_to t('speech_balloon_templates.add_to_panel'), main_app.new_speech_balloon_path(:speech_balloon_template_id => @speech_balloon_template.id) %> diff --git a/lib/manifest/form.rb b/lib/manifest/form.rb index b1439118..74bd8652 100644 --- a/lib/manifest/form.rb +++ b/lib/manifest/form.rb @@ -1,14 +1,24 @@ module Pettanr class FormManager + class Form + end + + attr :form_manifest, :item_name, :manifest, :form_conf, def initialize form_manifest @form_manifest = form_manifest @item_name = @form_manifest.item_name @manifest = @form_manifest.manifest @form_conf = @form_manifest.conf + attributes = @form_manifest.conf + + end + + def attributes end - def open list_name, page, page_size, operators + def open list_name, item, operators + Form.new item_name, item, operators, @manifest end end diff --git a/lib/manifest/manifest.rb b/lib/manifest/manifest.rb index 14d43972..b13d9614 100644 --- a/lib/manifest/manifest.rb +++ b/lib/manifest/manifest.rb @@ -100,6 +100,9 @@ module Pettanr @manifest = manifest end + def attributes + end + end attr :system_resources, :magic_numbers, :select_items, -- 2.11.0