Sha256: 119784b2092b25f8c40b290033298c5bdccb708ef30252ed54650023628ee9ac

Contents?: true

Size: 1.48 KB

Versions: 9

Compression:

Stored size: 1.48 KB

Contents

format :html do
  view :header do
    voo.hide :toggle, :toolbar
    main_header + _render_toolbar.to_s.html_safe
  end

  def main_header
    wrap_with :div, class: classy("d0-card-header") do
      wrap_with :div, class: classy("d0-card-header-title") do
        header_title_elements
      end
    end
  end

  def header_title_elements
    [_render_toggle, _render_title]
  end

  view :subheader do
    wrap_with :div, class: "card-subheader navbar-inverse btn-primary active" do
      [
        _render_title,
        (autosaved_draft_link(class: "float-right") if show_draft_link?)
      ]
    end
    # toolbar_view_title(@slot_view) || _render_title(args)
  end

  def show_draft_link?
    card.drafts.present? && @slot_view == :edit
  end

  view :toggle do
    verb, adjective, direction = toggle_verb_adjective_direction
    link_to_view adjective, icon_tag(direction.to_sym),
                 title: "#{verb} #{card.name}",
                 class: "#{verb}-icon toggler slotter nodblclick"
  end

  def toggle_verb_adjective_direction
    if @toggle_mode == :close
      %w[open open expand]
    else
      %w[close closed collapse_down]
    end
  end

  view :navbar_links do
    wrap_with :ul, class: "navbar-nav" do
      item_links.map do |link|
        wrap_with(:li, class: "nav-item") { link }
      end.join "\n"
    end
  end

  def show_follow?
    Auth.signed_in? && !card.new_card? && card.followable?
  end

  def structure_editable?
    card.structure && card.template.ok?(:update)
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
card-1.93.8 mod/standard/set/all/rich_html/header.rb
card-1.93.7 mod/standard/set/all/rich_html/header.rb
card-1.93.6 mod/standard/set/all/rich_html/header.rb
card-1.93.5 mod/standard/set/all/rich_html/header.rb
card-1.93.4 mod/standard/set/all/rich_html/header.rb
card-1.93.3 mod/standard/set/all/rich_html/header.rb
card-1.93.2 mod/standard/set/all/rich_html/header.rb
card-1.93.1 mod/standard/set/all/rich_html/header.rb
card-1.93.0 mod/standard/set/all/rich_html/header.rb