class Panel::News::BackEnd::NewsBulletinFilesController < ApplicationController
  
  layout 'new_admin'
  
  def index
    @news_bulletin_files = NewsBulletinFile.all
	
    respond_to do |format|
      format.html # index.html.erb
      # format.xml  { render :xml => @news_bulletins }
      format.js
    end
	
  end

  # POST /news_bulletins
  # POST /news_bulletins.xml
  def create
    @news_bulletin_file = NewsBulletinFile.new(params[:news_bulletin_file])

    respond_to do |format|
      if @news_bulletin_file.save
        format.html { redirect_to(panel_news_back_end_news_bulletins_url) }
        format.js
      else
        format.html { render :action => "new" }
        format.js { render action: "new" }
      end
    end
  end

  # PUT /news_bulletins/1
  # PUT /news_bulletins/1.xml
  def update
    @news_bulletin_file = NewsBulletinFile.find(params[:id])

    respond_to do |format|
      if @news_bulletin_file.update_attributes(params[:news_bulletin_file])
        format.html { redirect_to(panel_news_back_end_news_bulletins_url) }
        format.js
      else
        format.html { render :action => "edit" }
        format.js { render :action => "edit" }
      end
    end
  end
	
end
