def show_html_format format
format.html {
play_list = Locmare::ListGroup.list 'story_sheet', 'play'
- @play_count = play_list.count(@operators, {:id => @item.id, :my_play => @item.own?(@operators)})
- if @operators.author
- @new_comic_items = assist_items('comic', 'private')
- end
+ @play_count = play_list.count(@operators,
+ {:id => @item.id, :my_play => @item.own?(@operators)}
+ )
}
end
end
def play
+ params[:offset] = nil
+ params[:count] = nil
+ params[:page] ||= 1
+ params[:page_size] = 1
@item = self.class.model.show(params[:id], @operators)
- @story = @item
set_play
- @options = {:id => params[:id], :offset => params[:offset], :count => 1}
- list_result = @list.open(@operators, @options)
- @items = list_result.items
- @count = @list.count(@operators, @options)
- @pager = Kaminari.paginate_array(Array.new(@count, nil)).page(params[:offset]).per(1)
+ play_list
+ p @items
@sort_items = @list.items(@operators,
{:id => params[:id], :my_play => @item.own?(@operators)},
- 0, -1
+ 0, -1 # no limit
)
respond_to do |format|
format.html {
- #@count = @action.list.count @item
- #@prev_offset = @action.list.prev_offset @item
- #@next_offset = @action.list.next_offset @item
- if @operators.author
+ if @item.own? @operators
@new_sheet_items = assist_items('sheet', 'private')
end
}
- format.json { render json: @items.to_json(self.class.model.list_json_opt) }
+ format.json { render json: @items.to_json }
end
end