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



173
174
175
176
177
178
179
# File 'app/helpers/redmine_extensions/application_helper.rb', line 173

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.



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

def content
  @content
end

#content_class=(value) ⇒ Object (writeonly)

Sets the attribute content_class



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

def content_class=(value)
  @content_class = value
end


214
215
216
217
218
219
220
# File 'app/helpers/redmine_extensions/application_helper.rb', line 214

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

#headingObject

Returns the value of attribute heading



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

def heading
  @heading
end

#heading_classObject



189
190
191
# File 'app/helpers/redmine_extensions/application_helper.rb', line 189

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


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

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

#iconObject



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

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

#idObject

Returns the value of attribute id



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

def id
  @id
end

#optionsObject

Returns the value of attribute options



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

def options
  @options
end

#viewObject

Returns the value of attribute view



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

def view
  @view
end

Instance Method Details

#collapsed?Boolean



210
211
212
# File 'app/helpers/redmine_extensions/application_helper.rb', line 210

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

#collapsible?Boolean



205
206
207
208
# File 'app/helpers/redmine_extensions/application_helper.rb', line 205

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

#heading_tagObject



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

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

#renderObject



222
223
224
# File 'app/helpers/redmine_extensions/application_helper.rb', line 222

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

#saving_state_enabled?Boolean



181
182
183
# File 'app/helpers/redmine_extensions/application_helper.rb', line 181

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