Sha256: 8aa75e37d453b48a21cfc819355ecd955f0edc99b5f1d6da3c4876632f15dfb1

Contents?: true

Size: 968 Bytes

Versions: 6

Compression:

Stored size: 968 Bytes

Contents

format :html do
  view :template_link, cache: :never do
    wrap do
      voo.title = parent.voo.nest_syntax if parent
      "{{#{link_to_template_editor}}}"
    end
  end

  def link_to_template_editor
    link_to_view :template_editor, voo.title, path: { slot: { title: voo.title } }
  end

  # TODO: hamlize
  view :template_editor do
    wrap { haml :template_editor }
  end

  def frame_header
    voo.show?(:template_closer) ? template_frame_header : super
  end

  def template_frame_header
    [render_template_closer, _render_header]
  end

  # no slot, because frame is inside template_editor's slot
  def standard_frame slot=true
    voo.show?(:template_closer) ? super(false) : super
  end

  view :template_editor_frame do
    voo.title = card.label
    frame do
      _render_core
    end
  end

  view :template_closer do
    wrap_with "div", class: "card-menu template-closer" do
      link_to_view :template_link, icon_tag("remove")
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
card-1.98.3 mod/rules/set/type/set/html_views/template.rb
card-1.98.2 mod/rules/set/type/set/html_views/template.rb
card-1.98.1 mod/rules/set/type/set/html_views/template.rb
card-1.98.0 mod/rules/set/type/set/html_views/template.rb
card-1.97.0.1 mod/rules/set/type/set/html_views/template.rb
card-1.97.0 mod/rules/set/type/set/html_views/template.rb