Class: RedmineExtensions::ApplicationHelper::EasyBoxRenderer
- Defined in:
- app/helpers/redmine_extensions/application_helper.rb
Instance Attribute Summary collapse
- #container_class ⇒ Object
-
#content ⇒ Object
Returns the value of attribute content.
-
#content_class ⇒ Object
writeonly
Sets the attribute content_class.
- #footer ⇒ Object
-
#heading ⇒ Object
Returns the value of attribute heading.
- #heading_class ⇒ Object
- #heading_links ⇒ Object
- #icon ⇒ Object
-
#id ⇒ Object
Returns the value of attribute id.
-
#options ⇒ Object
Returns the value of attribute options.
-
#view ⇒ Object
Returns the value of attribute view.
Instance Method Summary collapse
- #collapsed? ⇒ Boolean
- #collapsible? ⇒ Boolean
- #heading_tag ⇒ Object
- #render ⇒ Object
- #saving_state_enabled? ⇒ Boolean
Instance Attribute Details
#container_class ⇒ Object
190 191 192 193 194 195 196 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 190 def container_class s = (@container_class.presence || css_classes[:container]).to_s s += ' collapsible' if collapsible? s += ' collapsed' if collapsed? s end |
#content ⇒ Object
Returns the value of attribute content.
188 189 190 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 188 def content @content end |
#content_class=(value) ⇒ Object (writeonly)
Sets the attribute content_class
186 187 188 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 186 def content_class=(value) @content_class = value end |
#footer ⇒ Object
231 232 233 234 235 236 237 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 231 def if block_given? @footer = view.capture { yield } else @footer.to_s.html_safe end end |
#heading ⇒ Object
Returns the value of attribute heading
184 185 186 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 184 def heading @heading end |
#heading_class ⇒ Object
206 207 208 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 206 def heading_class (@heading_class || css_classes[:heading]).to_s end |
#heading_links ⇒ Object
214 215 216 217 218 219 220 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 214 def heading_links if block_given? @heading_links = view.capture { yield } else @heading_links.to_s.html_safe end end |
#icon ⇒ Object
210 211 212 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 210 def icon @icon ||= [:icon] && " icon #{[:icon]}" end |
#id ⇒ Object
Returns the value of attribute id
184 185 186 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 184 def id @id end |
#options ⇒ Object
Returns the value of attribute options
184 185 186 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 184 def @options end |
#view ⇒ Object
Returns the value of attribute view
184 185 186 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 184 def view @view end |
Instance Method Details
#collapsed? ⇒ Boolean
227 228 229 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 227 def collapsed? !![:default] || !![:collapsed] || !![:default_button_state] end |
#collapsible? ⇒ Boolean
222 223 224 225 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 222 def collapsible? return @collapsible unless @collapsible.nil? @collapsible ||= !![:toggle] && ([:collapsible].nil? || !![:collapsible]) end |
#heading_tag ⇒ Object
202 203 204 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 202 def heading_tag ([:wrapping_heading_element] || ([:header_tag] || [:heading_tag])).presence || 'h3' end |
#render ⇒ Object
239 240 241 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 239 def render view.render({ partial: 'common/collapsible_module_layout', locals: { renderer: self, content: content } }) end |
#saving_state_enabled? ⇒ Boolean
198 199 200 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 198 def saving_state_enabled? collapsible? && ([:remember].nil? || !![:remember]) end |