diff --git a/src/api/app/helpers/webui/webui_helper.rb b/src/api/app/helpers/webui/webui_helper.rb index 621e471c767..abfda3bae36 100644 --- a/src/api/app/helpers/webui/webui_helper.rb +++ b/src/api/app/helpers/webui/webui_helper.rb @@ -132,6 +132,13 @@ def repo_status_icon(status, details = nil) sprite_tag icon, title: description end + def webui2_repository_status_icon(status:, details: nil, html_class: '') + icon = webui2_repo_status_icon(status) + description = webui2_repo_status_description(status, details) + content_tag(:i, '', class: "#{html_class} #{webui2_repo_status_icon(status)}", + data: { content: description, placement: 'top', toggle: 'popover' }) + end + def webui2_repo_status_description(status, details) description_preface = '' if /^outdated_/.match?(status) diff --git a/src/api/app/views/webui2/webui/package/_buildstatus.html.haml b/src/api/app/views/webui2/webui/package/_buildstatus.html.haml index 24c93f6dce5..1361e0e074b 100644 --- a/src/api/app/views/webui2/webui/package/_buildstatus.html.haml +++ b/src/api/app/views/webui2/webui/package/_buildstatus.html.haml @@ -25,10 +25,7 @@ - if !(repository && repository.architectures.pluck(:name).include?(result.architecture)) %i.fas.fa-clock.text-warning{ title: 'This result is outdated' } - else - :ruby - icon = webui2_repo_status_icon(result.state) - description = webui2_repo_status_description(result.state, result.details) - %i{ class: icon, data: { content: description, placement: 'top', toggle: 'popover' } } + = webui2_repository_status_icon(status: result.state, details: result.details) %span.ml-1 = result.architecture .col-6.col-sm-5.buildstatus.text-nowrap diff --git a/src/api/app/views/webui2/webui/package/binaries.html.haml b/src/api/app/views/webui2/webui/package/binaries.html.haml index 6e213afa461..3241d742f63 100644 --- a/src/api/app/views/webui2/webui/package/binaries.html.haml +++ b/src/api/app/views/webui2/webui/package/binaries.html.haml @@ -15,7 +15,7 @@ - @buildresults.each do |result| %h5.bg-light.p-2.mb-0 - %i{ class: "#{webui2_repo_status_icon(result[:repocode])} fa-xs" } + = webui2_repository_status_icon(status: result[:repocode].to_s, html_class: 'fa-xs') = result[:arch] - if result[:binaries].empty? %p.pl-2 diff --git a/src/api/app/views/webui2/webui/project/_buildstatus.html.haml b/src/api/app/views/webui2/webui/project/_buildstatus.html.haml index a2580414460..3ffb1f8472b 100644 --- a/src/api/app/views/webui2/webui/project/_buildstatus.html.haml +++ b/src/api/app/views/webui2/webui/project/_buildstatus.html.haml @@ -24,10 +24,7 @@ - build_results.sort_by(&:architecture).each do |build_result| .row.py-1 .col-4.col-sm-3.offset-2.offset-sm-4.text-nowrap{ title: "#{repository} summary" } - :ruby - icon = webui2_repo_status_icon(build_result.state) - description = webui2_repo_status_description(build_result.state, build_result.details) - %i{ class: icon, data: { content: description, placement: 'top', toggle: 'popover' } } + = webui2_repository_status_icon(status: build_result.state, details: build_result.details) %span.ml-1 = link_to(build_result.architecture, { action: :monitor, "#{valid_xml_id('repo_' + repository)}": 1, diff --git a/src/api/app/views/webui2/webui/project/monitor.html.haml b/src/api/app/views/webui2/webui/project/monitor.html.haml index 7c46e0697c4..53445ff775e 100644 --- a/src/api/app/views/webui2/webui/project/monitor.html.haml +++ b/src/api/app/views/webui2/webui/project/monitor.html.haml @@ -24,7 +24,7 @@ - @repohash.sort.each do |repo, archlist| - archlist.sort.each do |arch| %th.text-center - %i.fa-xs.mr-1{ class: webui2_repo_status_icon(@repostatushash[repo][arch]) } + = webui2_repository_status_icon(status: @repostatushash[repo][arch], html_class: 'fa-xs mr-1') = arch %tbody - @packagenames.each do |packname|