Class: Components::StatusBadges

Inherits:
Base
  • Object
show all
Defined in:
app/components/status_badges.rb

Instance Method Summary collapse

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

Returns:

  • (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