Skip to content

Commit

Permalink
Show multibuild flavor in Repository State pages
Browse files Browse the repository at this point in the history
Add the multibuild flavor to the breadcrumbs as text.
  • Loading branch information
eduardoj committed Dec 18, 2024
1 parent 56bb21a commit cdad8ac
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 cdad8ac

Please sign in to comment.