OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Use background image for banner
Oliver Günthera92a91d644ca
diff --git a/app/assets/images/enterprise/exact-time-tracking.png b/app/assets/images/enterprise/exact-time-tracking.pngnew file mode 100644index 00000000000..7ba58341f8dBinary files /dev/null and b/app/assets/images/enterprise/exact-time-tracking.png differdiff --git a/app/components/enterprise_edition/banner_component.html.erb b/app/components/enterprise_edition/banner_component.html.erbindex 37c77f2f067..db2499efcb8 100644--- a/app/components/enterprise_edition/banner_component.html.erb+++ b/app/components/enterprise_edition/banner_component.html.erb@@ -46,13 +46,6 @@endend- if medium?- grid.with_area(:graphic) do- image_tag @image,- class: "op-enterprise-banner--image"- end- end-if @dismissablegrid.with_area(:dismiss) doclasses = medium? ? "op-enterprise-banner--close-icon_hovering" : ""diff --git a/app/components/enterprise_edition/banner_component.rb b/app/components/enterprise_edition/banner_component.rbindex 81be2a00859..b95589ec9dd 100644--- a/app/components/enterprise_edition/banner_component.rb+++ b/app/components/enterprise_edition/banner_component.rb@@ -35,6 +35,7 @@ module EnterpriseEditionclass BannerComponent < ApplicationComponentinclude Primer::FetchOrFallbackHelperinclude Primer::ClassNameHelper+ include Primer::JoinStyleArgumentsHelperinclude OpPrimer::ComponentHelpersinclude OpTurbo::Streamableinclude PlanForFeature@@ -87,6 +88,13 @@ module EnterpriseEditionsuperend+ def before_render+ @system_arguments[:style] = join_style_arguments(+ @system_arguments[:style],+ medium? ? "background-image: url(#{helpers.image_path(@image)})" : nil+ )+ end+def medium?@variant == :mediumenddiff --git a/app/components/enterprise_edition/banner_component.sass b/app/components/enterprise_edition/banner_component.sassindex 52935f0df9c..ad3799c3cd2 100644--- a/app/components/enterprise_edition/banner_component.sass+++ b/app/components/enterprise_edition/banner_component.sass@@ -40,12 +40,16 @@ $op-enterprise-banner-fixed-height: 220pxborder-radius: var(--borderRadius-medium)background: var(--body-background)padding: var(--base-size-8)+ overflow: hidden&_mediumpadding: 0grid-template-areas: "content graphic"- grid-template-columns: 1fr 1fr+ grid-template-columns: 2fr 1frheight: $op-enterprise-banner-fixed-height+ background-size: contain+ background-repeat: no-repeat+ background-position: center right&_medium &padding: 0@@ -56,9 +60,6 @@ $op-enterprise-banner-fixed-height: 220pxalign-self: centerpadding: var(--base-size-16)- &--graphic- height: $op-enterprise-banner-fixed-height-&--imagewidth: 100%height: 100%diff --git a/modules/costs/app/views/admin/costs_settings/show.html.erb b/modules/costs/app/views/admin/costs_settings/show.html.erbindex ab34f601b16..df8384eea0c 100644--- a/modules/costs/app/views/admin/costs_settings/show.html.erb+++ b/modules/costs/app/views/admin/costs_settings/show.html.erb@@ -42,32 +42,36 @@ See COPYRIGHT and LICENSE files for more details.end%>-<%=-render(Primer::Alpha::TabPanels.new(label: I18n.t(:project_module_costs))) do |component|- component.with_tab(selected: true, id: "tab-time") do |tab|- tab.with_text { I18n.t(:label_time) }- tab.with_panel do- admin_settings_primer_form_with(scope: :settings, action: :update, method: :patch) do |time_form|- render_inline_settings_form(time_form) do |form|- form.html_content do- render(Primer::Beta::Subhead.new(hide_border: true)) do |subhead|- subhead.with_heading(size: :medium) { I18n.t(:label_mandatory_fields) }- subhead.with_description { I18n.t(:description_time_settings) }+<%= render(Primer::Alpha::TabPanels.new(label: I18n.t(:project_module_costs))) do |component| %>+ <%= component.with_tab(selected: true, id: "tab-time") do |tab| %>+ <%= tab.with_text { I18n.t(:label_time) } %>+ <%= tab.with_panel do %>+ <%=+ render(::EnterpriseEdition::BannerComponent.new(:time_entry_time_restrictions,+ variant: :medium,+ image: "enterprise/exact-time-tracking.png",+ dismissable: false))+ %>+ <%=+ admin_settings_primer_form_with(scope: :settings, action: :update, method: :patch) do |time_form|+ render_inline_settings_form(time_form) do |form|+ form.html_content do+ render(Primer::Beta::Subhead.new(hide_border: true)) do |subhead|+ subhead.with_heading(size: :medium) { I18n.t(:label_mandatory_fields) }+ subhead.with_description { I18n.t(:description_time_settings) }+ endend- end-- form.html_content do- render(::EnterpriseEdition::BannerComponent.new(:time_entry_time_restrictions, dismissable: false))- end- form.check_box(name: :allow_tracking_start_and_end_times)- form.check_box(name: :enforce_tracking_start_and_end_times, disabled: !EnterpriseToken.allows_to?(:time_entry_time_restrictions))+ form.check_box(name: :allow_tracking_start_and_end_times)+ form.check_box(name: :enforce_tracking_start_and_end_times, disabled: !EnterpriseToken.allows_to?(:time_entry_time_restrictions))- form.submit+ form.submit+ endend- end- end- end+ %>+ <% end %>+ <% end %>+<%component.with_tab(id: "tab-costs") do |tab|tab.with_text { I18n.t(:label_costs) }@@ -88,5 +92,5 @@ render(Primer::Alpha::TabPanels.new(label: I18n.t(:project_module_costs))) do |cendendend-end+ end%>