1 class ComicsController < ApplicationController
2 if Manifest.manifest.magic_numbers['run_mode'] == 0
3 before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
4 before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
6 before_filter :authenticate_reader, :only => [
7 :index, :show, :play, :by_story, :by_author
9 before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
10 before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
25 def show_html_format format
27 play_list = Locmare::ListGroup.list(
28 'comic_stories', 'by_comic', @operators,
29 {:id => @item.id, :my_play => @item.own?(@operators)}
31 @play_count = play_list.count(@operators)
37 respond_to do |format|
38 show_html_format format
39 show_prof_format format
40 show_json_format format
51 respond_to do |format|
53 if @item.own? @operators
54 @new_story_items = assist_items('home', 'stories')
57 list_json_format @list, format
71 @item = @my_model_class.new
73 @my_model_class.fold_extend_settings params[@my_model_class.item_name]
74 @item.attributes = params[@my_model_class.item_name]
75 @item.overwrite @operators
81 @my_model_class.fold_extend_settings params[@my_model_class.item_name]
82 @item.attributes = params[@my_model_class.item_name]
83 @item.overwrite @operators
88 @item = Comic.edit(params[:id], @operators)
89 respond_to do |format|
90 if @item.destroy_with_leafs
91 flash[:notice] = I18n.t('flash.notice.destroyed', :model => Comic.model_name.human)
92 format.html { redirect_to '/home/comics' }
93 format.json { head :ok }
95 flash[:notice] = I18n.t('flash.notice.not_destroyed', :model => Comic.model_name.human)
96 format.html { redirect_to @item }
97 format.json { render json: @item.errors, status: :unprocessable_entity }