Module: Card::Set::Right::EnabledRoles::HtmlFormat

Extended by:
AbstractFormat
Defined in:
card/tmpsets/set/mod030-card-mod-layout/right/enabled_roles.rb,
card/tmpsets/set/mod031-card-mod-layout/right/enabled_roles.rb

Instance Method Summary collapse

Instance Method Details

#checkbox_inputObject



56
57
58
59
60
61
# File 'card/tmpsets/set/mod030-card-mod-layout/right/enabled_roles.rb', line 56

def checkbox_input
  card.ensure_roles
  wrap_with :div, class: "pointer-checkbox-list" do
    (&method(:role_item_checkbox))
  end
end

#edit_successObject



48
49
50
# File 'card/tmpsets/set/mod030-card-mod-layout/right/enabled_roles.rb', line 48

def edit_success
  { reload: true }
end

#hidden_form_tags(_action, opts) ⇒ Object



52
53
54
# File 'card/tmpsets/set/mod030-card-mod-layout/right/enabled_roles.rb', line 52

def hidden_form_tags _action, opts
  "#{super} #{hidden_tags card: { type_id: SessionID }}"
end

#input_typeObject



44
45
46
# File 'card/tmpsets/set/mod030-card-mod-layout/right/enabled_roles.rb', line 44

def input_type
  :checkbox
end

#role_item_checkbox(role_name) ⇒ Object



63
64
65
66
67
# File 'card/tmpsets/set/mod030-card-mod-layout/right/enabled_roles.rb', line 63

def role_item_checkbox role_name
  haml :role_checkbox, id: "pointer-checkbox-#{role_name.to_name.key}",
                       checked: card.item_names.include?(role_name),
                       option_name: role_name
end

#view: edit_inlineObject

permission change compared to super



40
41
42
# File 'card/tmpsets/set/mod030-card-mod-layout/right/enabled_roles.rb', line 40

view :edit_inline, perms: :none, unknown: true, cache: :never, wrap: :slot do
  super()
end