Class: Components::StatusBadges
- Inherits:
-
Base
- Object
- Base
- Components::StatusBadges
- Defined in:
- app/components/status_badges.rb
Instance Method Summary collapse
-
#initialize(model:) ⇒ StatusBadges
constructor
A new instance of StatusBadges.
- #render? ⇒ Boolean
- #view_template ⇒ Object
Constructor Details
#initialize(model:) ⇒ StatusBadges
Returns a new instance of StatusBadges.
9 10 11 |
# File 'app/components/status_badges.rb', line 9 def initialize(model:) @model = model end |
Instance Method Details
#render? ⇒ Boolean
13 14 15 |
# File 'app/components/status_badges.rb', line 13 def render? @model.present? end |
#view_template ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/components/status_badges.rb', line 17 def view_template span class: "status-badges" do if @model.new? span class: "text-warning" do Icon(icon: "stars", label: t("general.new")) end whitespace end problem_icon_tag(problems_including_files(@model).visible(problem_settings)) if policy(Problem).show? end end |