OSDN Git Service

work
authoryasushiito <yas@pen-chan.jp>
Thu, 19 Dec 2013 23:36:52 +0000 (08:36 +0900)
committeryasushiito <yas@pen-chan.jp>
Thu, 19 Dec 2013 23:36:52 +0000 (08:36 +0900)
34 files changed:
app/controllers/comics_controller.rb
app/controllers/scroll_panels_controller.rb
app/controllers/scrolls_controller.rb
app/controllers/sheet_panels_controller.rb
app/controllers/sheets_controller.rb
app/controllers/speech_balloons_controller.rb
app/controllers/stories_controller.rb
app/controllers/story_sheets_controller.rb
app/models/panel.rb
app/models/speech_balloon.rb
app/views/comics/show.html.erb
app/views/ground_colors/_standard.html.erb
app/views/ground_colors/show.html.erb
app/views/ground_pictures/_standard.html.erb
app/views/ground_pictures/edit.html.erb
app/views/ground_pictures/show.html.erb
app/views/panel_pictures/_standard.html.erb
app/views/panel_pictures/edit.html.erb
app/views/panel_pictures/show.html.erb
app/views/panels/_element_copy.html.erb
app/views/scroll_panels/show.html.erb [deleted file]
app/views/scrolls/show.html.erb
app/views/sheet_panels/_element.html.erb
app/views/sheet_panels/show.html.erb [deleted file]
app/views/sheets/_body.html.erb
app/views/sheets/_standard.html.erb
app/views/sheets/show.html.erb
app/views/speech_balloons/_standard.html.erb
app/views/speech_balloons/show.html.erb
app/views/stories/show.html.erb
app/views/story_sheets/_append_story.html.erb
app/views/story_sheets/show.html.erb [deleted file]
lib/manifest/filer.rb
lib/manifest/form.rb

index f8f0a04..e8aee01 100644 (file)
@@ -21,7 +21,6 @@ class ComicsController < ApplicationController
     @item = Comic.show(params[:id], @operators)
     respond_to do |format|
       format.html {
-        @comic = @item
       }
       format_prof format
       format.json { render json: @item.to_json(Comic.show_json_opt) }
index f9db91f..3aab2c6 100644 (file)
@@ -21,9 +21,6 @@ class ScrollPanelsController < ApplicationController
     @item = ScrollPanel.show(params[:id], @operators)
 
     respond_to do |format|
-      format.html {
-        @scroll_panel = @item
-      }
       format_prof format
       format.json { render json: @item.scroll_panel_as_json(@operators.author) }
     end
index 80e40a8..0bdf6d8 100644 (file)
@@ -22,11 +22,9 @@ class ScrollsController < ApplicationController
 
     respond_to do |format|
       format.html {
-        @scroll = @item
         if @operators.author
-          controller = Pettanr::Application::manifest.controller_managers['home']
-          @action = controller.open('panels', {:page => 1, :page_size => 5}, @operators)
-          @new_panels_filer = @action.filer
+          @new_panel_items = assist_items('panel', 'private_list')
+          @new_panel_filer = assist_filer 'panel', @new_panel_items
         end
       }
       format.json { render json: @item.to_json(Scroll.show_json_opt) }
@@ -37,7 +35,7 @@ class ScrollsController < ApplicationController
   end
 
   def play
-    @scroll = Scroll.show(params[:id], [@user, @admin])
+    @scroll = Scroll.show(params[:id], @operators)
     cnt = ScrollPanel.count(:conditions => ['scroll_id = ?', @scroll.id]).to_i
     @offset = ScrollPanel.offset cnt, params[:offset]
     @panel_count = ScrollPanel.panel_count cnt, params[:count]
@@ -62,7 +60,7 @@ class ScrollsController < ApplicationController
           @new_panels = Panel.mylist(@author, 1, 5)
         end
       }
-      format.json {render text: ScrollPanel.list_as_json_text(@scroll_panels, @author)}
+      format.json {render text: ScrollPanel.list_as_json_text(@scroll_panels, @operators)}
       format.jsonp {
         render :json => "callback(" + @scroll_panels.to_json_list + ");"
       }
index 5d51278..81ffc75 100644 (file)
@@ -21,9 +21,6 @@ class SheetPanelsController < ApplicationController
     @item = SheetPanel.show(params[:id], @operators)
 
     respond_to do |format|
-      format.html {
-        @sheet_panel = @item
-      }
       format_prof format
       format.json { render json: @item.sheet_panel_as_json(@operators.author) }
     end
index c6929a9..d53fbe3 100644 (file)
@@ -22,11 +22,14 @@ class SheetsController < ApplicationController
 
     respond_to do |format|
       format.html {
-        @sheet = @item
         if @operators.author
-          @new_panels = Panel.mylist(@operators.author, 1, 5)
-          @new_stories = Story.mylist(@operators.author, 1, 5)
-          @fresh_stories = StorySheet.mylist(@operators.author, 1, 5).map {|ss| ss.story}
+          @new_panel_items = assist_items('panel', 'private_list')
+          @new_panel_filer = assist_filer 'panel', @new_panel_items
+          
+          @new_story_items = assist_items('story', 'private_list')
+          @new_story_filer = assist_filer 'story', @new_story_items
+          @fresh_story_items = assist_items('story_sheet', 'private_list').map {|ss| ss.story}
+          @fresh_story_filer = assist_filer 'story', @fresh_story_items
         end
       }
       format_prof format
index 6e95295..5fba689 100644 (file)
@@ -8,7 +8,6 @@ class SpeechBalloonsController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
   end
-  before_filter :authenticate_admin!, :only => [:list, :browse]
 
   def self.model
     SpeechBalloon
@@ -29,24 +28,6 @@ class SpeechBalloonsController < ApplicationController
     end
   end
   
-  def list
-    @speech_balloons = SpeechBalloon.all
-
-    respond_to do |format|
-      format.html { render layout: 'system' }
-      format.json { render json: @speech_balloons }
-    end
-  end
-
-  def browse
-    @speech_balloon = SpeechBalloon.find(params[:id])
-
-    respond_to do |format|
-      format.html { render layout: 'system' }
-      format.json { render json: @speech_balloon }
-    end
-  end
-
   def new
     raise Pettanr::NotWork unless @operators.author.working_panel
     @speech_balloon_template = SpeechBalloonTemplate.show params[:speech_balloon_template_id], @operators
@@ -67,9 +48,9 @@ class SpeechBalloonsController < ApplicationController
   end
 
   def edit
-    @speech_balloon = SpeechBalloon.show(params[:id], @operators.author)
+    @speech_balloon = SpeechBalloon.show(params[:id], @operators)
     @speech_balloon_template = @speech_balloon.speech_balloon_template
-    @panel = Panel.edit(@speech_balloon.panel.id, @operators.author)
+    @panel = Panel.edit(@speech_balloon.panel.id,@operators)
     
     @speech_balloon.boost
     
@@ -83,7 +64,7 @@ class SpeechBalloonsController < ApplicationController
   def create
     raise Pettanr::NotWork unless @operators.author.working_panel
     SpeechBalloon.fold_extend_settings params
-    @panel = Panel.edit(@operators.author.working_panel, @author)
+    @panel = Panel.edit(@operators.author.working_panel, @operators)
     @speech_balloon = SpeechBalloon.new 
     @speech_balloon.attributes = params[:speech_balloon]
     
@@ -95,7 +76,7 @@ class SpeechBalloonsController < ApplicationController
     @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, 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 }
@@ -111,7 +92,7 @@ class SpeechBalloonsController < ApplicationController
 
   def update
     SpeechBalloon.fold_extend_settings params
-    @speech_balloon = SpeechBalloon.show(params[:id], @operators.author)
+    @speech_balloon = SpeechBalloon.show(params[:id], @operators)
     @speech_balloon.attributes = params[:speech_balloon]
     
     @speech_balloon_template = @speech_balloon.speech_balloon_template
@@ -119,11 +100,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, @operators.author)
+    @panel = Panel.edit(@speech_balloon.panel.id, @operators)
     @speech_balloon.overwrite @panel.id
     
     respond_to do |format|
-      if @speech_balloon.valid? and @speech_balloon.store(@operators.author, params[:speech_balloon])
+      if @speech_balloon.valid? and @speech_balloon.store(@operators, 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,8 +119,8 @@ class SpeechBalloonsController < ApplicationController
   end
 
   def destroy
-    @speech_balloon = SpeechBalloon.show(params[:id], @operators.author)
-    @panel = Panel.edit(@speech_balloon.panel.id, @operators.author)
+    @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
index 378a275..6739413 100644 (file)
@@ -22,9 +22,9 @@ class StoriesController < ApplicationController
 
     respond_to do |format|
       format.html { 
-        @story = @item
         if @operators.author
-          @new_sheets = Sheet.mylist(@operators.author, 1, 5)
+          @new_sheet_items = assist_items('sheet', 'private_list')
+          @new_sheet_filer = assist_filer 'sheet', @new_sheet_items
         end
       }
       format_prof format
@@ -33,7 +33,7 @@ class StoriesController < ApplicationController
   end
   
   def play
-    @story = Story.show(params[:id], [@user, @admin])
+    @story = Story.show(params[:id], @operators)
     @page = StorySheet.page params[:page]
     @sheet = StorySheet.play_sheet(@story, @author, @page)
     respond_to do |format|
index c976228..150bd1c 100644 (file)
@@ -21,9 +21,6 @@ class StorySheetsController < ApplicationController
     @item = StorySheet.show(params[:id], @operators)
 
     respond_to do |format|
-      format.html {
-        @story_sheet = @item
-      }
       format_prof format
       format.json { render json: @item.to_json(StorySheet.show_json_opt) }
     end
index 11ac112..3acafc8 100644 (file)
@@ -54,7 +54,7 @@ class Panel < Pettanr::Content
   end
   
   def visible? operators
-    return false unless super
+    return true if super
     return true if self.new_record?
     self.publish?
   end
index 63764dd..a46b02d 100644 (file)
@@ -165,7 +165,7 @@ class SpeechBalloon < Pettanr::Content
     {:include => {:panel => {:include => {:author => {} }}, :balloon => {}, :speech => {}, :speech_balloon_template => {} }}
   end
   
-  def store au, attr
+  def store operators, attr
     if self.new_record?
       sb = self.panel.speech_balloons.build
       sb.attributes = attr
@@ -177,7 +177,7 @@ class SpeechBalloon < Pettanr::Content
         break
       end
     end
-    self.panel.store({}, au)
+    self.panel.store({}, operators)
   end
   
   def remove au
index 9b7a8d6..abc0614 100644 (file)
@@ -1,29 +1,29 @@
-<% @page_title = t('.title') + ':' + @comic.title %>
+<% @page_title = t('.title') + ':' + @item.title %>
 <h1><%= t('.title') %></h1>
 <p id="notice"><%= notice %></p>
 
 <p>
   <b><%= t_m 'Comic.title' -%>:</b>
-  <%= link_to h(@comic.title), comic_path(@comic) %>
+  <%= link_to h(@item.title), comic_path(@item) %>
 </p>
 
 <p>
   <b><%= t_m 'Comic.description' -%>:</b>
-  <%= h(@comic.description) %>
+  <%= h(@item.description) %>
 </p>
 
 <p>
   <b><%= t_m 'Comic.visible' -%>:</b>
-  <%= t_selected_item('comic_visible_items', @comic.visible) %>
+  <%= t_selected_item('comic_visible_items', @item.visible) %>
 </p>
 
 <p>
   <b><%= t_m 'Comic.author_id' -%>:</b>
-  <%= link_to h(@comic.author.name), author_path(@comic.author) %>
+  <%= link_to h(@item.author.name), author_path(@item.author) %>
 </p>
 
-<% @comic.stories.each do |story| %>
-  <% if story.visible? @author -%>
+<% @item.stories.each do |story| %>
+  <% if story.visible? @operators -%>
     <div>
       <%= link_to t('stories.show.t', :t => story.disp_t), story_path(story) %>
       <%= link_to h(story.title), play_story_path(story) %>
 <% end %>
 <p>
   <b><%= t_m 'Comic.created_at' -%>:</b>
-  <%= l @comic.created_at %>
+  <%= l @item.created_at %>
 </p>
 
 <p>
   <b><%= t_m 'Comic.updated_at' -%>:</b>
-  <%= l @comic.updated_at %>
+  <%= l @item.updated_at %>
 </p>
 
-<% if @comic.own? @operators -%>
-  <%= link_to t('link.edit'), edit_comic_path(@comic) %>
-  <%= link_to t('link.destroy'), comic_path(@comic), :method => :delete %>
+<% if @item.own? @operators -%>
+  <%= link_to t('link.edit'), edit_comic_path(@item) %>
+  <%= link_to t('link.destroy'), comic_path(@item), :method => :delete %>
 
   <h2>
     <%= t('stories.index.new') %>
   </h2>
   <% @story = Story.new -%>
   <% @story.supply_default -%>
-  <% @story.attributes = {:comic_id => @comic.id} -%>
+  <% @story.attributes = {:comic_id => @item.id} -%>
   <%= render 'stories/form' %>
 <% end %>
index 35f438f..d3acc7a 100644 (file)
@@ -1,6 +1,6 @@
 <b><%= t_m 'Panel.caption' -%>:</b>
 <%= h(panel.caption) %>
-<%= render 'panels/body', :panel => panel, :author => author, :spot => spot %>
-<%= render 'panels/footer', :panel => panel, :author => author %>
+<%= render 'panels/body', :panel => panel, :operators => operators, :spot => spot %>
+<%= render 'panels/footer', :panel => panel, :operators => operators %>
 <%= render 'panels/licensed_pictures', :licensed_pictures => panel.licensed_pictures %>
 
index 0b9b3d0..bbd11a0 100644 (file)
@@ -1,7 +1,7 @@
 <h1><%= t('.title') %></h1>
 <p id="notice"><%= notice %></p>
 
-<%= render 'panel_pictures/standard', :panel => @ground_color.panel, :author => @author, :spot => @ground_color %>
+<%= render 'panel_pictures/standard', :panel => @ground_color.panel, :operators => @operators, :spot => @ground_color %>
 
 <p>
   <b><%= t_m 'GroundColor.caption' -%>:</b>
@@ -51,4 +51,4 @@
 <%= link_to t('link.edit'), edit_ground_color_path(@ground_color) %>
 <%= link_to t('link.destroy'), ground_color_path(@ground_color), :method => :delete %>
 
-<%= render 'panels/element_copy', :element => @ground_color, :author => @author %>
+<%= render 'panels/element_copy', :element => @ground_color, :operators => @operators %>
index 35f438f..d3acc7a 100644 (file)
@@ -1,6 +1,6 @@
 <b><%= t_m 'Panel.caption' -%>:</b>
 <%= h(panel.caption) %>
-<%= render 'panels/body', :panel => panel, :author => author, :spot => spot %>
-<%= render 'panels/footer', :panel => panel, :author => author %>
+<%= render 'panels/body', :panel => panel, :operators => operators, :spot => spot %>
+<%= render 'panels/footer', :panel => panel, :operators => operators %>
 <%= render 'panels/licensed_pictures', :licensed_pictures => panel.licensed_pictures %>
 
index 40bf68a..da84ebd 100644 (file)
@@ -2,6 +2,6 @@
 <p id="notice"><%= notice %></p>
 
 <h2><%= t('home.index.catch') -%></h2>
-<%= render 'panels/standard', :panel => @panel, :author => @author %>
+<%= render 'panels/standard', :panel => @panel, :operators => @operators %>
 <h2><%= t('ground_colors.update_color') -%></h2>
 <%= render @ground_picture.form_template, :elm => @ground_picture, :no_attr => 0 %>
index 47c19f7..4f5c8ed 100644 (file)
@@ -1,7 +1,7 @@
 <h1><%= t('.title') %></h1>
 <p id="notice"><%= notice %></p>
 
-<%= render 'panel_pictures/standard', :panel => @ground_picture.panel, :author => @author, :spot => @ground_picture %>
+<%= render 'panel_pictures/standard', :panel => @ground_picture.panel, :operators => @operators, :spot => @ground_picture %>
 
 <p>
   <b><%= t_m 'GroundPicture.caption' -%>:</b>
@@ -41,4 +41,4 @@
 <%= link_to t('link.edit'), edit_ground_picture_path(@ground_picture) %>
 <%= link_to t('link.destroy'), ground_picture_path(@ground_picture), :method => :delete %>
 
-<%= render 'panels/element_copy', :element => @ground_picture, :author => @author %>
+<%= render 'panels/element_copy', :element => @ground_picture, :operators => @operators %>
index 35f438f..d3acc7a 100644 (file)
@@ -1,6 +1,6 @@
 <b><%= t_m 'Panel.caption' -%>:</b>
 <%= h(panel.caption) %>
-<%= render 'panels/body', :panel => panel, :author => author, :spot => spot %>
-<%= render 'panels/footer', :panel => panel, :author => author %>
+<%= render 'panels/body', :panel => panel, :operators => operators, :spot => spot %>
+<%= render 'panels/footer', :panel => panel, :operators => operators %>
 <%= render 'panels/licensed_pictures', :licensed_pictures => panel.licensed_pictures %>
 
index 79fd9be..624058f 100644 (file)
@@ -2,7 +2,7 @@
 <p id="notice"><%= notice %></p>
 
 <h2><%= t('home.index.catch') -%></h2>
-<%= render 'panels/standard', :panel => @panel, :author => @author %>
+<%= render 'panels/standard', :panel => @panel, :operators => @operators %>
 <h2><%= t('panel_pictures.panel_picture') -%></h2>
 <% if @panel_picture.picture and @panel_picture.picture.resource_picture %>
   <table>
index 8b2894d..cad5618 100644 (file)
@@ -1,7 +1,7 @@
 <h1><%= t '.title' -%></h1>
 <p id="notice"><%= notice %></p>
 
-<%= render 'panel_pictures/standard', :panel => @panel_picture.panel, :author => @author, :spot => @panel_picture %>
+<%= render 'panel_pictures/standard', :panel => @panel_picture.panel, :operators => @operators, :spot => @panel_picture %>
 
 <p>
   <b><%= t_m 'PanelPicture.caption' -%>:</b>
@@ -56,4 +56,4 @@
 <%= link_to t('link.edit'), edit_panel_picture_path(@panel_picture) %>
 <%= link_to t('link.destroy'), panel_picture_path(@panel_picture), :method => :delete %>
 
-<%= render 'panels/element_copy', :element => @panel_picture, :author => @author %>
+<%= render 'panels/element_copy', :element => @panel_picture, :operators => @operators %>
index 837054d..4de1370 100644 (file)
@@ -1,11 +1,11 @@
-<% if author and author.working? -%>
+<% if operators.author and operators.author.working? -%>
   <h2><%= t('panels.element_copy') -%></h2>
   <h3><%= t('home.index.catch') -%></h3>
-  <%= 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) %>
 
-  <%= form_for(author.working_panel) do |f| %>
-    <%= hidden_field_tag "json", element.copy(author.working_panel).to_json %>
+  <%= form_for(operators.author.working_panel) do |f| %>
+    <%= hidden_field_tag "json", element.copy(operators.author.working_panel).to_json %>
     <div>
       <%= submit_tag t('panels.inspire') -%>
     </div>
diff --git a/app/views/scroll_panels/show.html.erb b/app/views/scroll_panels/show.html.erb
deleted file mode 100644 (file)
index bdd9edf..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<h1><%= t('.title') %></h1>
-<p id="notice"><%= notice %></p>
-
-<p>
-  <b><%= t_m 'ScrollPanel.scroll_id' -%>:</b>
-  <%= link_to scroll_icon(:object => @scroll_panel.scroll), scroll_path(@scroll_panel.scroll) %>
-  <%= link_to h(@scroll_panel.scroll.title), play_scroll_path(@scroll_panel.scroll) %>
-</p>
-
-<p>
-  <b><%= t_m 'ScrollPanel.panel_id' -%>:</b>
-  <%= link_to panel_icon(:object => @scroll_panel.panel), panel_path(@scroll_panel.panel) %>
-</p>
-
-<p>
-  <b><%= t_m 'ScrollPanel.t' -%>:</b>
-  <%= @scroll_panel.t %>
-</p>
-
-<p>
-  <b><%= t_m 'ScrollPanel.author_id' -%>:</b>
-  <%= link_to author_icon(:object => @scroll_panel.author), author_path(@scroll_panel.author) %>
-  <%= link_to h(@scroll_panel.author.name), author_path(@scroll_panel.author) %>
-</p>
-
-<p>
-  <b><%= t_m 'ScrollPanel.created_at' -%>:</b>
-  <%= l @scroll_panel.created_at %>
-</p>
-
-<p>
-  <b><%= t_m 'ScrollPanel.updated_at' -%>:</b>
-  <%= l @scroll_panel.updated_at %>
-</p>
-<% if @scroll_panel.own? @author -%>
-  <%= link_to t('link.edit'), edit_scroll_panel_path(@scroll_panel) %>
-  <%= link_to t('link.destroy'), scroll_panel_path(@scroll_panel), :method => :delete %>
-<% end %>
-
-<hr>
-<%= render 'panels/standard', :panel => @scroll_panel.panel, :author => @author %>
index ac1d9f4..4c55304 100644 (file)
@@ -1,39 +1,43 @@
-<% @page_title = t('.title') + ':' + @scroll.title %>
+<% @page_title = t('.title') + ':' + @item.title %>
 <h1><%= t('.title') %></h1>
 <p id="notice"><%= notice %></p>
 
 <p>
   <b><%= t_m 'Scroll.title' -%>:</b>
-  <%= link_to h(@scroll.title), play_scroll_path(@scroll) %>
+  <%= link_to h(@item.title), play_scroll_path(@item) %>
 </p>
 
 <p>
   <b><%= t_m 'Scroll.description' -%>:</b>
-  <%= h(@scroll.description) %>
+  <%= h(@item.description) %>
 </p>
 
 <p>
   <b><%= t_m 'Scroll.visible' -%>:</b>
-  <%= t_selected_item('scroll_visible_items', @scroll.visible) %>
+  <%= t_selected_item('scroll_visible_items', @item.visible) %>
 </p>
 
 <p>
   <b><%= t_m 'Scroll.author_id' -%>:</b>
-  <%= link_to h(@scroll.author.name), author_path(@scroll.author) %>
+  <%= link_to h(@item.author.name), author_path(@item.author) %>
 </p>
 
 <p>
   <b><%= t_m 'Scroll.created_at' -%>:</b>
-  <%= l @scroll.created_at %>
+  <%= l @item.created_at %>
 </p>
 
 <p>
   <b><%= t_m 'Scroll.updated_at' -%>:</b>
-  <%= l @scroll.updated_at %>
+  <%= l @item.updated_at %>
 </p>
 
-<% if @scroll.own? @operators -%>
-  <%= link_to t('link.edit'), edit_scroll_path(@scroll) %>
+<% if @item.own? @operators -%>
+  <%= link_to t('link.edit'), edit_scroll_path(@item) %>
   <h3><%= t('scroll_panels.append.new_panels') -%></h3>
-  <%= render 'system/filer', {:filer => @new_panels_filer} %>
+  <table>
+    <% @new_panel_items.each do |panel| %>
+      <%= render 'scroll_panels/append_panel', :panel => panel, :scroll => @item, :operators => @operators %>
+    <% end %>
+  </table>
 <% end %>
index bc7d448..77a32df 100644 (file)
@@ -1,6 +1,6 @@
 <div <%= raw elm.any_tag_attr() -%> class="sheet_panel" style="top:<%= elm.y %>px; left:<%= elm.x %>px; z-index:<%= elm.z %>;">
   <% if elm.panel -%>
     <%# blocked in panels/body panel = Panel.show elm.panel, author -%>
-    <%= render 'panels/body', :panel => elm.panel, :author => author, :spot => nil %>
+    <%= render 'panels/body', :panel => elm.panel, :operators => operators, :spot => nil %>
   <% end %>
 </div>
diff --git a/app/views/sheet_panels/show.html.erb b/app/views/sheet_panels/show.html.erb
deleted file mode 100644 (file)
index 9b2c05f..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-<h1><%= t('.title') %></h1>
-<p id="notice"><%= notice %></p>
-
-<p>
-  <b><%= t_m 'SheetPanel.sheet_id' -%>:</b>
-  <%= link_to sheet_icon(:object => @sheet_panel.sheet), sheet_path(@sheet_panel.sheet) %>
-  <%= link_to h(@sheet_panel.sheet.caption), play_sheet_path(@sheet_panel.sheet) %>
-</p>
-
-<p>
-  <b><%= t_m 'SheetPanel.panel_id' -%>:</b>
-  <%= link_to panel_icon(:object => @sheet_panel.panel), panel_path(@sheet_panel.panel) %>
-</p>
-
-<p>
-  <b><%= t_m 'SheetPanel.x' -%>:</b>
-  <%= @sheet_panel.x %>
-</p>
-
-<p>
-  <b><%= t_m 'SheetPanel.y' -%>:</b>
-  <%= @sheet_panel.y %>
-</p>
-
-<p>
-  <b><%= t_m 'SheetPanel.z' -%>:</b>
-  <%= @sheet_panel.z %>
-</p>
-
-<p>
-  <b><%= t_m 'SheetPanel.t' -%>:</b>
-  <%= @sheet_panel.t %>
-</p>
-
-<p>
-  <b><%= t_m 'SheetPanel.author_id' -%>:</b>
-  <%= link_to author_icon(:object => @sheet_panel.author), author_path(@sheet_panel.author) %>
-  <%= link_to h(@sheet_panel.author.name), author_path(@sheet_panel.author) %>
-</p>
-
-<p>
-  <b><%= t_m 'SheetPanel.created_at' -%>:</b>
-  <%= l @sheet_panel.created_at %>
-</p>
-
-<p>
-  <b><%= t_m 'SheetPanel.updated_at' -%>:</b>
-  <%= l @sheet_panel.updated_at %>
-</p>
-<% if @sheet_panel.own? @author -%>
-  <%= link_to t('link.edit'), edit_sheet_panel_path(@sheet_panel) %>
-  <%= link_to t('link.destroy'), sheet_panel_path(@sheet_panel), :method => :delete %>
-<% end %>
-
-<hr>
-<%= render 'panels/standard', :panel => @sheet_panel.panel, :author => @author %>
index e1c58df..5be0d57 100644 (file)
@@ -1,7 +1,7 @@
 <div id="<%= sheet.tag_id -%>" sheet_id="<%= sheet.tag_sheet_id -%>" class="sheet" style="width:<%= sheet.width %>px;height:<%= sheet.height %>px;">
   <% if sheet.visible? @operators -%>
     <% sheet.sheet_elements.each do |elm| %>
-      <%= render elm.class.to_s.tableize + '/element', :elm => elm, :author => author %>
+      <%= render elm.class.to_s.tableize + '/element', :elm => elm, :operators => operators %>
     <% end %>
   <% else %>
     <h2><%= t('sheets.hidden') %></h2>
index ad2f5f4..094d4fc 100644 (file)
@@ -1,9 +1,9 @@
-<%= render 'sheets/body', :sheet => sheet, :author => author %>
+<%= render 'sheets/body', :sheet => sheet, :operators => operators %>
 <div class="sheet-data">
   <% sheet.sheet_elements.each do |sheet_panel| %>
-    <%= render 'sheet_panels/play_footer', :sheet_panel => sheet_panel, :author => author %>
+    <%= render 'sheet_panels/play_footer', :sheet_panel => sheet_panel, :operators => operators %>
   <% end %>
-  <%= render 'sheet_panels/licensed_pictures', :licensed_pictures => @sheet.licensed_pictures %>
+  <%= render 'sheet_panels/licensed_pictures', :licensed_pictures => sheet.licensed_pictures %>
 </div>
 <div class="sheet-break">
 </div>
index 5caa8e9..45366b5 100644 (file)
@@ -1,15 +1,15 @@
-<% @page_caption = t('.title') + ':' + @sheet.caption %>
+<% @page_caption = t('.title') + ':' + @item.caption %>
 <h1><%= t('.title') %></h1>
 <p id="notice"><%= notice %></p>
 
-<%= render 'standard', :sheet => @sheet, :author => @author %>
+<%= render 'standard', :sheet => @item, :operators => @operators %>
 
-<% if @author %>
-  <% if @sheet.copyable? %>
+<% if @operators.author %>
+  <% if @item.copyable? %>
     <h2><%= t('sheets.show.copy') -%></h2>
     <%= form_for(Sheet.new, :html => {:jqform => 'pettanr-sheet-form'}) do |f| %>
 
-      <%= hidden_field_tag "json", @sheet.copy().to_json %>
+      <%= hidden_field_tag "json", @item.copy().to_json %>
       <div>
         <%= submit_tag t('sheets.show.inspire') -%>
       </div>
   <% end %>
 <% end %>
 
-<% if @sheet.own? @author %>
-  <%= link_to t('link.edit'), edit_sheet_path(@sheet) %>
-  <%= link_to t('link.destroy'), sheet_path(@sheet), :method => :delete %>
+<% if @item.own? @operators %>
+  <%= link_to t('link.edit'), edit_sheet_path(@item) %>
+  <%= link_to t('link.destroy'), sheet_path(@item), :method => :delete %>
 
   <h3><%= t('sheet_panels.append.new_panels') -%></h3>
   <table>
-    <% @new_panels.each do |panel| %>
-      <%= render 'sheet_panels/append_panel', :sheet => @sheet, :panel => panel, :author => @author %>
+    <% @new_panel_items.each do |panel| %>
+      <%= render 'sheet_panels/append_panel', :sheet => @item, :panel => panel, :operators => @operators %>
     <% end %>
   </table>
   <h3><%= t('story_sheets.append.new_stories') -%></h3>
   <table>
-    <% @new_stories.each do |story| %>
-      <%= render 'story_sheets/append_story', :sheet => @sheet, :story => story, :author => @author %>
+    <% @new_story_items.each do |story| %>
+      <%= render 'story_sheets/append_story', :sheet => @item, :story => story, :operators => @operators %>
     <% end %>
   </table>
   <h3><%= t('story_sheets.append.fresh_stories') -%></h3>
   <table>
-    <% @fresh_stories.each do |story| %>
-      <%= render 'story_sheets/append_story', :sheet => @sheet, :story => story, :author => @author %>
+    <% @fresh_story_items.each do |story| %>
+      <%= render 'story_sheets/append_story', :sheet => @item, :story => story, :operators => @operators %>
     <% end %>
   </table>
 <% end %>
index 35f438f..d3acc7a 100644 (file)
@@ -1,6 +1,6 @@
 <b><%= t_m 'Panel.caption' -%>:</b>
 <%= h(panel.caption) %>
-<%= render 'panels/body', :panel => panel, :author => author, :spot => spot %>
-<%= render 'panels/footer', :panel => panel, :author => author %>
+<%= render 'panels/body', :panel => panel, :operators => operators, :spot => spot %>
+<%= render 'panels/footer', :panel => panel, :operators => operators %>
 <%= render 'panels/licensed_pictures', :licensed_pictures => panel.licensed_pictures %>
 
index 998ee30..f7f0755 100644 (file)
@@ -1,7 +1,7 @@
 <h1><%= t('.title') %></h1>
 <p id="notice"><%= notice %></p>
 
-<%= render 'speech_balloons/standard', :panel => @speech_balloon.panel, :author => @author, :spot => @speech_balloon %>
+<%= render 'speech_balloons/standard', :panel => @speech_balloon.panel, :operators => @operators, :spot => @speech_balloon %>
 
 <p>
   <b><%= t_m 'SpeechBalloon.caption' -%>:</b>
@@ -95,4 +95,4 @@
 <%= link_to t('link.edit'), edit_speech_balloon_path(@speech_balloon) %>
 <%= link_to t('link.destroy'), speech_balloon_path(@speech_balloon), :method => :delete %>
 
-<%= render 'panels/element_copy', :element => @speech_balloon, :author => @author %>
+<%= render 'panels/element_copy', :element => @speech_balloon, :operators => @operators %>
index ad03496..6f9cc26 100644 (file)
@@ -3,36 +3,36 @@
 
 <p>
   <b><%= t_m 'Story.comic_id' -%>:</b>
-  <%= link_to comic_icon(:object => @story.comic), comic_path(@story.comic) %>
-  <%= link_to h(@story.comic.title), comic_path(@story.comic) %>
+  <%= link_to comic_icon(:object => @item.comic), comic_path(@item.comic) %>
+  <%= link_to h(@item.comic.title), comic_path(@item.comic) %>
 </p>
 
 <div>
-  <%= link_to t('stories.show.t', :t => @story.disp_t), story_path(@story) %>
-  <%= link_to_if @story, h(@story.title), play_story_path(@story) %>
+  <%= link_to t('stories.show.t', :t => @item.disp_t), story_path(@item) %>
+  <%= link_to_if @item, h(@item.title), play_story_path(@item) %>
 </div>
 
 <p>
   <b><%= t_m 'Story.description' -%>:</b>
-  <%= h(@story.description) %>
+  <%= h(@item.description) %>
 </p>
 
 <p>
   <b><%= t_m 'Story.visible' -%>:</b>
-  <%= t_selected_item('story_visible_items', @story.visible) %>
+  <%= t_selected_item('story_visible_items', @item.visible) %>
 </p>
 
 <p>
   <b><%= t_m 'Story.created_at' -%>:</b>
-  <%= l @story.created_at %>
+  <%= l @item.created_at %>
 </p>
 
 <p>
   <b><%= t_m 'Story.updated_at' -%>:</b>
-  <%= l @story.updated_at %>
+  <%= l @item.updated_at %>
 </p>
-<% @story.story_sheets.each do |story_sheet| %>
-  <% if story_sheet.sheet and story_sheet.sheet.visible?(@author) -%>
+<% @item.story_sheets.each do |story_sheet| %>
+  <% if story_sheet.sheet and story_sheet.sheet.visible?(@operators) -%>
     <div>
       <%= link_to sheet_icon(:object => story_sheet.sheet, :size => 25), sheet_path(story_sheet.sheet) %>
       <%= link_to h(truncate(story_sheet.sheet.caption, :length => 40)), play_sheet_path(story_sheet.sheet) %>
     </div>
   <% end %>
 <% end %>
-<% if @story.own? @author -%>
-  <%= link_to t('link.edit'), edit_story_path(@story) %>
-  <%= link_to t('link.destroy'), story_path(@story), :method => :delete %>
+<% if @item.own? @operators -%>
+  <%= link_to t('link.edit'), edit_story_path(@item) %>
+  <%= link_to t('link.destroy'), story_path(@item), :method => :delete %>
 
   <h3><%= t('story_sheets.append.new_sheets') -%></h3>
   <table>
-    <% @new_sheets.each do |sheet| %>
-      <%= render 'story_sheets/append_sheet', :story => @story, :sheet => sheet, :author => @author %>
+    <% @new_sheet_items.each do |sheet| %>
+      <%= render 'story_sheets/append_sheet', :story => @item, :sheet => sheet, :operators => @operators %>
     <% end %>
   </table>
 <% end %>
index eeda46f..35ea0b5 100644 (file)
@@ -8,7 +8,7 @@
     <%= distance_of_time_in_words_to_now story.updated_at %>
   </td>
   <td>
-    <% if story.own? author %>
+    <% if story.own? operators %>
       <% @story_sheet = StorySheet.new :story_id => story.id, :sheet_id => sheet.id %>
       <%= form_for(@story_sheet) do |f| %>
         <%= f.hidden_field :story_id %>
diff --git a/app/views/story_sheets/show.html.erb b/app/views/story_sheets/show.html.erb
deleted file mode 100644 (file)
index c21cf12..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<h1><%= t('.title') %></h1>
-<p id="notice"><%= notice %></p>
-
-<p>
-  <b><%= t_m 'StorySheet.story_id' -%>:</b>
-  <%= link_to story_icon(:object => @story_sheet.story), story_path(@story_sheet.story) %>
-  <%= link_to h(@story_sheet.story.title), play_story_path(@story_sheet.story) %>
-</p>
-
-<p>
-  <b><%= t_m 'StorySheet.sheet_id' -%>:</b>
-  <%= link_to sheet_icon(:object => @story_sheet.sheet), sheet_path(@story_sheet.sheet) %>
-</p>
-
-<p>
-  <b><%= t_m 'StorySheet.t' -%>:</b>
-  <%= @story_sheet.t %>
-</p>
-
-<p>
-  <b><%= t_m 'StorySheet.author_id' -%>:</b>
-  <%= link_to author_icon(:object => @story_sheet.author), author_path(@story_sheet.author) %>
-  <%= link_to h(@story_sheet.author.name), author_path(@story_sheet.author) %>
-</p>
-
-<p>
-  <b><%= t_m 'StorySheet.created_at' -%>:</b>
-  <%= l @story_sheet.created_at %>
-</p>
-
-<p>
-  <b><%= t_m 'StorySheet.updated_at' -%>:</b>
-  <%= l @story_sheet.updated_at %>
-</p>
-<% if @story_sheet.own? @author -%>
-  <%= link_to t('link.edit'), edit_story_sheet_path(@story_sheet) %>
-  <%= link_to t('link.destroy'), story_sheet_path(@story_sheet), :method => :delete %>
-<% end %>
-
index 21d94d7..e49d370 100644 (file)
@@ -83,14 +83,17 @@ module Pettanr
       end
       
       def render view, item, operators
-        link = self.__send__(@link_method_name, view, item, operators)
-        tag = self.__send__(@tag_method_name, view, item, operators)
-        unless tag.blank?
-          view.link_to_unless link.blank?, tag, link
+        if @tag_method_name == :tag_template
+          view.render item.path_name + '/' + @symbol_conf['name'], :item => item
+        else
+          link = self.__send__(@link_method_name, view, item, operators)
+          tag = self.__send__(@tag_method_name, view, item, operators)
+          unless tag.blank?
+            view.link_to_unless link.blank?, tag, link
+          end
         end
       end
       
-      
     end
     
     class Caption
@@ -126,6 +129,8 @@ module Pettanr
           :tag_column
         when 'method'
           :tag_method
+        when 'none'
+          :tag_none
         else
           :tag_else
         end
@@ -164,7 +169,7 @@ module Pettanr
       end
       
       def visible?
-        self.link_method_name != :link_none
+        @tag_method_name != :tag_none
       end
       
       def render view, item, operators
index 74bd865..489551f 100644 (file)
@@ -4,7 +4,7 @@ module Pettanr
     class Form
     end
     
-    attr :form_manifest, :item_name, :manifest, :form_conf
+    attr :form_manifest, :item_name, :manifest, :form_conf
     def initialize form_manifest
       @form_manifest = form_manifest
       @item_name = @form_manifest.item_name