Skip to content

Commit

Permalink
Merge pull request #17212 from eduardoj/fix/issue_16234
Browse files Browse the repository at this point in the history
Show multibuild flavor in Repository State pages
  • Loading branch information
danidoni authored Dec 18, 2024
2 parents 59a7603 + cdad8ac commit 47c0be2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ol.breadcrumb {
& li {
font-size: 0.9rem;

&.active {
.active, &.active {
color: var(--breadcrumbs-item-text-color);
font-weight: bold;
}
Expand All @@ -13,4 +13,4 @@ ol.breadcrumb {
color: var(--breadcrumbs-item-text-color);
}
}
}
}
5 changes: 5 additions & 0 deletions src/api/app/controllers/webui/packages/binaries_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class BinariesController < Webui::WebuiController

before_action :set_project
before_action :set_package
before_action :set_multibuild_flavor
before_action :set_repository
before_action :set_architecture, only: %i[show dependency filelist]
before_action :set_dependant_project, only: :dependency
Expand Down Expand Up @@ -117,6 +118,10 @@ def set_filename
@filename = File.basename(params[:binary_filename] || params[:filename])
end

def set_multibuild_flavor
@multibuild_flavor = @package_name.gsub(/.*:/, '') if @package_name.present? && @package_name.include?(':')
end

# Get an URL to a binary produced by the build.
# In the published repo for everyone, in the backend directly only for logged in users.
def download_url_for_binary(architecture_name:, file_name:)
Expand Down
6 changes: 5 additions & 1 deletion src/api/app/views/webui/package/_breadcrumb_items.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
- else
%li.breadcrumb-item.text-word-break-all
%i.fa.fa-archive
= link_to(@package, package_show_path(@project, @package))
= precede link_to(@package, package_show_path(@project, @package)) do
- if @multibuild_flavor.present?
%span.active :#{@multibuild_flavor}
- else
= nil
- if current_page?(package_view_revisions_path(@project, @package))
%li.breadcrumb-item.active{ 'aria-current' => 'page' }
Revisions
Expand Down

0 comments on commit 47c0be2

Please sign in to comment.