# -*- encoding : utf-8 -*-

class Admin::TranslationsController < ApplicationController
	before_filter :auth_admin

	layout "admin"


	before_filter :find_translations


	def index 

	end



	def edit
		@translation = Translation.find(params[:id])
	end
  
	def show
		@translation = Translation.find(params[:id])
	end

	

	def update
		@translation = Translation.find(params[:id])


		
	
		
		
		respond_to do |format|
			if @translation.update_attributes(params.require(:translation).permit!)
				

			
				flash[:notice] = "Le menu à été modifié avec succès."
				
				if @reorder
					format.js { 
						
						render :action => "update" }
				else
					format.js { 
					   @translation = Translation.find(@translation.id)
						render :action => "update_row" }
				end
      end
			
		end
    
    
    
    

	end


	
	protected
	
	def find_translations    
    
    @translations = Translation.all #.order("key ASC")
		

	
  end
  
end
