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



154
155
156
157
158
159
160
# File 'app/helpers/redmine_extensions/application_helper.rb', line 154

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.



152
153
154
# File 'app/helpers/redmine_extensions/application_helper.rb', line 152

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.



150
151
152
# File 'app/helpers/redmine_extensions/application_helper.rb', line 150

def content_class=(value)
  @content_class = value
end


195
196
197
198
199
200
201
# File 'app/helpers/redmine_extensions/application_helper.rb', line 195

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



148
149
150
# File 'app/helpers/redmine_extensions/application_helper.rb', line 148

def heading
  @heading
end

#heading_classObject



170
171
172
# File 'app/helpers/redmine_extensions/application_helper.rb', line 170

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


178
179
180
181
182
183
184
# File 'app/helpers/redmine_extensions/application_helper.rb', line 178

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

#iconObject



174
175
176
# File 'app/helpers/redmine_extensions/application_helper.rb', line 174

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

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



148
149
150
# File 'app/helpers/redmine_extensions/application_helper.rb', line 148

def id
  @id
end

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



148
149
150
# File 'app/helpers/redmine_extensions/application_helper.rb', line 148

def options
  @options
end

#viewObject

Returns the value of attribute view

Returns:

  • (Object)

    the current value of view



148
149
150
# File 'app/helpers/redmine_extensions/application_helper.rb', line 148

def view
  @view
end

Instance Method Details

#collapsed?Boolean

Returns:

  • (Boolean)


191
192
193
# File 'app/helpers/redmine_extensions/application_helper.rb', line 191

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

#collapsible?Boolean

Returns:

  • (Boolean)


186
187
188
189
# File 'app/helpers/redmine_extensions/application_helper.rb', line 186

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

#heading_tagObject



166
167
168
# File 'app/helpers/redmine_extensions/application_helper.rb', line 166

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

#renderObject



203
204
205
# File 'app/helpers/redmine_extensions/application_helper.rb', line 203

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

#saving_state_enabled?Boolean

Returns:

  • (Boolean)


162
163
164
# File 'app/helpers/redmine_extensions/application_helper.rb', line 162

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