Sha256: 3882d6840374f94337a32e8aaf288105be7d08911867fc1f52b48da51e9d611f

Contents?: true

Size: 681 Bytes

Versions: 9

Compression:

Stored size: 681 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    # The controller to handle the Admin
    # Terms of use agreement.
    class AdminTermsController < Decidim::Admin::ApplicationController
      def accept
        current_user.admin_terms_accepted_at = Time.current
        if current_user.save!
          flash[:notice] = t("accept.success", scope: "decidim.admin.admin_terms_of_use")
          redirect_to stored_location_for(current_user) || decidim_admin.root_path
        else
          flash[:alert] = t("accept.error", scope: "decidim.admin.admin_terms_of_use")
          redirect_to decidim_admin.admin_terms_show_path
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
decidim-admin-0.27.9 app/controllers/decidim/admin/admin_terms_controller.rb
decidim-admin-0.27.8 app/controllers/decidim/admin/admin_terms_controller.rb
decidim-admin-0.27.7 app/controllers/decidim/admin/admin_terms_controller.rb
decidim-admin-0.27.6 app/controllers/decidim/admin/admin_terms_controller.rb
decidim-admin-0.26.10 app/controllers/decidim/admin/admin_terms_controller.rb
decidim-admin-0.26.9 app/controllers/decidim/admin/admin_terms_controller.rb
decidim-admin-0.27.5 app/controllers/decidim/admin/admin_terms_controller.rb
decidim-admin-0.26.8 app/controllers/decidim/admin/admin_terms_controller.rb
decidim-admin-0.27.4 app/controllers/decidim/admin/admin_terms_controller.rb