Commit deb56f21 authored by Luke "Jared" Bennett's avatar Luke "Jared" Bennett

[ci skip] Use favicon full path

parent 9daf4f64
......@@ -364,9 +364,9 @@
});
};
w.gl.utils.setFavicon = (iconName) => {
if (faviconEl && iconName) {
faviconEl.setAttribute('href', `/assets/${iconName}.ico`);
w.gl.utils.setFavicon = (faviconPath) => {
if (faviconEl && faviconPath) {
faviconEl.setAttribute('href', faviconPath);
}
};
......@@ -382,7 +382,7 @@
dataType: 'json',
success: function(data) {
if (data && data.icon) {
gl.utils.setFavicon(`ci_favicons/${data.icon}`);
gl.utils.setFavicon(data.favicon);
} else {
gl.utils.resetFavicon();
}
......
......@@ -121,4 +121,8 @@ module CiStatusHelper
status.respond_to?(:label) &&
status.respond_to?(:icon)
end
def ci_status_favicon_path(favicon_name)
ActionController::Base.helpers.image_path(File.join('ci_favicons', "#{favicon_name}.ico"))
end
end
class StatusEntity < Grape::Entity
include RequestAwareEntity
include CiStatusHelper
expose :icon, :favicon, :text, :label, :group
format_with(:status_favicon_path) do |favicon_name|
ci_status_favicon_path(favicon_name)
end
expose :icon, :text, :label, :group
expose :has_details?, as: :has_details
expose :details_path
expose :favicon, format_with: :status_favicon_path
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment