Skip to content

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

Add box padding to public toggle

Aaron Contreras9596bbcdf2fb
diff --git a/app/components/shares/project_queries/public_flag_component.html.erb b/app/components/shares/project_queries/public_flag_component.html.erb
index ca74841f1a3..3f5ca816b7a 100644
--- a/app/components/shares/project_queries/public_flag_component.html.erb
+++ b/app/components/shares/project_queries/public_flag_component.html.erb
@@ -1,16 +1,21 @@
<%=
container.with_row do
- content_tag(:div, class: tooltip_wrapper_classes, data: { tooltip: tooltip_message }) do
- render(Primer::Forms::ToggleSwitchForm.new(
- name: "publish_project_query",
- label: t("sharing.project_queries.public_flag.label", instance_name: Setting.app_title),
- caption: t("sharing.project_queries.public_flag.caption"),
- src: toggle_public_flag_link,
- csrf_token: form_authenticity_token,
- status_label_position: :start,
- checked: published?,
- enabled: can_publish?
- ))
+ render(Primer::Box.new(border: true,
+ border_radius: BOX_BORDER_RADIUS,
+ p: BOX_PADDING)) do
+ content_tag(:div, class: tooltip_wrapper_classes, data: { tooltip: tooltip_message }) do
+ render(Primer::Forms::ToggleSwitchForm.new(
+ name: "publish_project_query",
+ label: t("sharing.project_queries.public_flag.label", instance_name: Setting.app_title),
+ caption: t("sharing.project_queries.public_flag.caption"),
+ src: toggle_public_flag_link,
+ csrf_token: form_authenticity_token,
+ status_label_position: :start,
+ checked: published?,
+ enabled: can_publish?
+ ))
+ end
+ end
end
end
%>
diff --git a/app/components/shares/project_queries/public_flag_component.rb b/app/components/shares/project_queries/public_flag_component.rb
index c02fb76bc45..91f926be4b2 100644
--- a/app/components/shares/project_queries/public_flag_component.rb
+++ b/app/components/shares/project_queries/public_flag_component.rb
@@ -31,6 +31,8 @@
module Shares
module ProjectQueries
class PublicFlagComponent < ApplicationComponent # rubocop:disable OpenProject/AddPreviewForViewComponent
+ BOX_PADDING = 3
+ BOX_BORDER_RADIUS = 2
include OpTurbo::Streamable
include OpPrimer::ComponentHelpers