Sha256: f6aab2e64d4d6bcd6588d5b2c2109c2d20e0b41ff7cd1537ebe5de5cc3a4b100

Contents?: true

Size: 1.74 KB

Versions: 6

Compression:

Stored size: 1.74 KB

Contents

module Spina
  module Admin
    class AccountsController < AdminController

      def edit
        add_breadcrumb I18n.t('spina.preferences.account'), spina.edit_admin_account_path
      end

      def update
        current_account.update(account_params)
        redirect_back fallback_location: spina.edit_admin_account_path
      end

      def analytics
        add_breadcrumb I18n.t('spina.preferences.analytics'), spina.analytics_admin_account_path
      end

      def social
        add_breadcrumb I18n.t('spina.preferences.social_media'), spina.social_admin_account_path
      end

      def style
        add_breadcrumb I18n.t('spina.preferences.style'), spina.style_admin_account_path
        @themes = ::Spina::Theme.all
        @layout_parts = current_theme.layout_parts.map { |layout_part| current_account.layout_part(layout_part) }
      end

      private

      def account_params
        params.require(:account).permit(:address, :city, :email, :name, :phone,
                                        :postal_code, :preferences, :google_analytics,
                                        :google_site_verification, :facebook, :twitter, :google_plus,
                                        :instagram, :youtube, :linkedin,
                                        :kvk_identifier, :theme, :vat_identifier, :robots_allowed,
                                        layout_parts_attributes:
                                          [:id, :layout_partable_type, :layout_partable_id,
                                            :name, :title, :position, :content, :page_id,
                                            layout_partable_attributes:
                                              [:content, :photo_tokens, :attachment_tokens, :id]])
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
spina-1.2.0 app/controllers/spina/admin/accounts_controller.rb
spina-1.1.4 app/controllers/spina/admin/accounts_controller.rb
spina-1.1.3 app/controllers/spina/admin/accounts_controller.rb
spina-1.1.2 app/controllers/spina/admin/accounts_controller.rb
spina-1.1.1 app/controllers/spina/admin/accounts_controller.rb
spina-1.1.0 app/controllers/spina/admin/accounts_controller.rb