Sha256: 400f47cfdb3f1d6e429359f8c7a21546c101261621f5a039a4cfcf31df04b305

Contents?: true

Size: 1.12 KB

Versions: 3

Compression:

Stored size: 1.12 KB

Contents

def account
  fetch :account, new: {}
end

def default_account_status
  "active"
end

def current_account?
  id && Auth.current_id == id
end

format :html do
  def default_board_tab
    card.current_account? ? :account_tab : super
  end

  view :account_tab do
    board_pill_sections "Account" do
      [["Settings", account_details_items],
       ["Content", account_content_items]]
    end
  end

  def show_account_tab?
    card.account.real?
  end

  def account_formgroups
    Auth.as_bot do
      subformat(card.account)._render :content_formgroups, structure: true
    end
  end

  def account_details_items
    [
      ["Email and Password", :account,
       { path: { slot: { hide: %i[help_link board_link] } } }],
      ["Roles", :roles,
       { path:  { view: :content } }],
      ["Notifications", :follow],
      # FIXME: this should be added in api_key mod!
      ["API", :account,
       { path: { view: :api_key,
                 items: { view: :content },
                 slot: { hide: %i[help_link board_link] } } }]
    ]
  end

  def account_content_items
    [["Created", :created],
     ["Edited", :edited]]
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
card-mod-account-0.16.0 set/abstract/accountable.rb
card-mod-account-0.15.6 set/abstract/accountable.rb
card-mod-account-0.15.5 set/abstract/accountable.rb