1 class WritingFormatsController < ApplicationController
2 if Manifest.manifest.magic_numbers['run_mode'] == 0
3 before_filter :authenticate_user, :only => []
5 before_filter :authenticate_reader, :only => [:index, :by_system_picture, :show, :count, :count_by_system_picture]
6 before_filter :authenticate_user, :only => []
8 before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy]
18 def show_html_format format
25 respond_to do |format|
26 show_html_format format
27 show_prof_format format
28 show_json_format format
36 def count_by_system_picture
50 @item = @my_model_class.new
52 @my_model_class.fold_extend_settings params[@my_model_class.item_name]
53 @item.attributes = params[@my_model_class.item_name]
60 @my_model_class.fold_extend_settings params[@my_model_class.item_name]
61 @item.attributes = params[@my_model_class.item_name]
67 @item = self.class.model.edit(params[:id], @operators)
68 respond_to do |format|
69 flash[:notice] = I18n.t('flash.notice.not_destroyed', :model => self.class.model.model_name.human)
70 format.html { redirect_to @item }
71 format.json { render json: @item.errors, status: :unprocessable_entity }