Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show multibuild flavor in Repository State pages #17212

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading