Skip to content

Commit

Permalink
update retired badge to have two state deprecated in orange or retire…
Browse files Browse the repository at this point in the history
…d in red
  • Loading branch information
syphax-bouazzouni committed Nov 27, 2023
1 parent 0e26249 commit 403b38b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions app/assets/stylesheets/components/alert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
padding: 20px;
border-radius: 5px;
}
.alert-container.alert-info-type{
.alert-info-type{
background-color: rgba(59, 130, 246, 0.1);
}
.alert-container.alert-warning-type {
.alert-warning-type {
background-color: rgba(234, 179, 8, 0.1);
}
.alert-container.alert-danger-type {
.alert-danger-type {
background-color: rgba(239, 68, 68, 0.1);
}
.alert-container.alert-success-type {
.alert-success-type {
background-color: rgba(34, 197, 94, 0.1);
}

Expand Down
7 changes: 4 additions & 3 deletions app/helpers/ontologies_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ def ontology_retired?(submission)

def ontology_retired_badge(submission, small: false, clickable: true)
return if submission.nil? || !ontology_retired?(submission)

style = "text-white bg-danger #{small && 'chip_button_small'}"
render ChipButtonComponent.new(class: style, text: "Retired", type: clickable ? 'clickable' : 'static')
text_color = submission[:status].to_s.eql?('retired') ? 'text-danger alert-danger-type' : 'text-warning alert-warning-type'
text_content = submission[:status].to_s.eql?('retired') ? 'Retired' : 'Deprecated'
style = "#{text_color} #{small && 'chip_button_small'}"
render ChipButtonComponent.new(class: style, text: text_content, type: clickable ? 'clickable' : 'static')
end

def private_ontology_icon(is_private)
Expand Down

0 comments on commit 403b38b

Please sign in to comment.