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
139 140 141 142 143 144 145 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 139 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.
137 138 139 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 137 def content @content end |
#content_class=(value) ⇒ Object (writeonly)
Sets the attribute content_class
135 136 137 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 135 def content_class=(value) @content_class = value end |
#footer ⇒ Object
180 181 182 183 184 185 186 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 180 def if block_given? = view.capture { yield } else .to_s.html_safe end end |
#heading ⇒ Object
Returns the value of attribute heading
133 134 135 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 133 def heading @heading end |
#heading_class ⇒ Object
155 156 157 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 155 def heading_class (@heading_class || css_classes[:heading]).to_s end |
#heading_links ⇒ Object
163 164 165 166 167 168 169 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 163 def heading_links if block_given? @heading_links = view.capture { yield } else @heading_links.to_s.html_safe end end |
#icon ⇒ Object
159 160 161 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 159 def icon @icon ||= [:icon] && " icon #{options[:icon]}" end |
#id ⇒ Object
Returns the value of attribute id
133 134 135 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 133 def id @id end |
#options ⇒ Object
Returns the value of attribute options
133 134 135 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 133 def end |
#view ⇒ Object
Returns the value of attribute view
133 134 135 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 133 def view @view end |
Instance Method Details
#collapsed? ⇒ Boolean
176 177 178 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 176 def collapsed? !![:default] || !![:collapsed] || !![:default_button_state] end |
#collapsible? ⇒ Boolean
171 172 173 174 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 171 def collapsible? return @collapsible unless @collapsible.nil? @collapsible ||= !![:toggle] && ([:collapsible].nil? || !![:collapsible]) end |
#heading_tag ⇒ Object
151 152 153 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 151 def heading_tag ([:wrapping_heading_element] || ([:header_tag] || [:heading_tag])).presence || 'h3' end |
#render ⇒ Object
188 189 190 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 188 def render view.render({partial: 'common/collapsible_module_layout', locals: {renderer: self, content: content}} ) end |
#saving_state_enabled? ⇒ Boolean
147 148 149 |
# File 'app/helpers/redmine_extensions/application_helper.rb', line 147 def saving_state_enabled? collapsible? && ([:remember].nil? || !![:remember]) end |