Class: RedmineExtensions::ApplicationHelper::EasyBoxRenderer

Inherits:
Struct
  • Object
show all
Defined in:
app/helpers/redmine_extensions/application_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#container_classObject



200
201
202
203
204
205
206
# File 'app/helpers/redmine_extensions/application_helper.rb', line 200

def container_class
  s = (@container_class.presence || css_classes[:container]).to_s
  s += ' collapsible' if collapsible?
  s += ' collapsed' if collapsed?

  s
end

#contentObject

Returns the value of attribute content.



198
199
200
# File 'app/helpers/redmine_extensions/application_helper.rb', line 198

def content
  @content
end

#content_class=(value) ⇒ Object (writeonly)

Sets the attribute content_class

Parameters:

  • value

    the value to set the attribute content_class to.



196
197
198
# File 'app/helpers/redmine_extensions/application_helper.rb', line 196

def content_class=(value)
  @content_class = value
end


241
242
243
244
245
246
247
# File 'app/helpers/redmine_extensions/application_helper.rb', line 241

def footer
  if block_given?
    @footer = view.capture { yield }
  else
    @footer.to_s.html_safe
  end
end

#headingObject

Returns the value of attribute heading

Returns:

  • (Object)

    the current value of heading



194
195
196
# File 'app/helpers/redmine_extensions/application_helper.rb', line 194

def heading
  @heading
end

#heading_classObject



216
217
218
# File 'app/helpers/redmine_extensions/application_helper.rb', line 216

def heading_class
  (@heading_class || css_classes[:heading]).to_s
end


224
225
226
227
228
229
230
# File 'app/helpers/redmine_extensions/application_helper.rb', line 224

def heading_links
  if block_given?
    @heading_links = view.capture { yield }
  else
    @heading_links.to_s.html_safe
  end
end

#iconObject



220
221
222
# File 'app/helpers/redmine_extensions/application_helper.rb', line 220

def icon
  @icon ||= options[:icon] && " icon #{options[:icon]}"
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



194
195
196
# File 'app/helpers/redmine_extensions/application_helper.rb', line 194

def id
  @id
end

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



194
195
196
# File 'app/helpers/redmine_extensions/application_helper.rb', line 194

def options
  @options
end

#viewObject

Returns the value of attribute view

Returns:

  • (Object)

    the current value of view



194
195
196
# File 'app/helpers/redmine_extensions/application_helper.rb', line 194

def view
  @view
end

Instance Method Details

#collapsed?Boolean

Returns:

  • (Boolean)


237
238
239
# File 'app/helpers/redmine_extensions/application_helper.rb', line 237

def collapsed?
  !!options[:default] || !!options[:collapsed] || !!options[:default_button_state]
end

#collapsible?Boolean

Returns:

  • (Boolean)


232
233
234
235
# File 'app/helpers/redmine_extensions/application_helper.rb', line 232

def collapsible?
  return @collapsible unless @collapsible.nil?
  @collapsible ||= !!options[:toggle] && (options[:collapsible].nil? || !!options[:collapsible])
end

#heading_tagObject



212
213
214
# File 'app/helpers/redmine_extensions/application_helper.rb', line 212

def heading_tag
  (options[:wrapping_heading_element] || (options[:header_tag] || options[:heading_tag])).presence || 'h3'
end

#renderObject



249
250
251
# File 'app/helpers/redmine_extensions/application_helper.rb', line 249

def render
  view.render({partial: 'common/collapsible_module_layout', locals: {renderer: self, content: content}} )
end

#saving_state_enabled?Boolean

Returns:

  • (Boolean)


208
209
210
# File 'app/helpers/redmine_extensions/application_helper.rb', line 208

def saving_state_enabled?
  collapsible? && (options[:remember].nil? || !!options[:remember])
end