@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) }
@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
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) }
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]
@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 + ");"
}
@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
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
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
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
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
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]
@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 }
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
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 }
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
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
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|
@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
end
def visible? operators
- return false unless super
+ return true if super
return true if self.new_record?
self.publish?
end
{: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
break
end
end
- self.panel.store({}, au)
+ self.panel.store({}, operators)
end
def remove au
-<% @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 %>
<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 %>
<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>
<%= 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 %>
<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 %>
<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 %>
<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>
<%= 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 %>
<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 %>
<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>
<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>
<%= 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 %>
-<% 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>
+++ /dev/null
-<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 %>
-<% @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 %>
<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>
+++ /dev/null
-<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 %>
<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>
-<%= 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>
-<% @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 %>
<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 %>
<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>
<%= 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 %>
<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 %>
<%= 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 %>
+++ /dev/null
-<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 %>
-
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
:tag_column
when 'method'
:tag_method
+ when 'none'
+ :tag_none
else
:tag_else
end
end
def visible?
- self.link_method_name != :link_none
+ @tag_method_name != :tag_none
end
def render view, item, operators
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