class Admin::AcceptedOffersController < ApplicationController
  layout "admin"
  before_filter :auth_admin

  def show
    @offer = Offer.find(params[:offer_id])
    @accepted_offer = @offer.accepted_offers.find(params[:id])
    @documents = @accepted_offer.documents
  end


  def validate_all_documents
    @offer = Offer.find(params[:offer_id])
    @accepted_offer = @offer.accepted_offers.find(params[:id])
    @accepted_offer.state = :documents_completed

    if @accepted_offer.save
      flash[:success] = "Confirmation OK"
    else
      flash[:error] = "Impossible de confirmer"
    end
    redirect_to :back

  end






end
