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

Open colors field per default when a custom theme is selected

Henriette Dinger1e3b5adc617f
diff --git a/app/assets/stylesheets/layout/_colors.sass b/app/assets/stylesheets/layout/_colors.sass
index f96b142b141..93a3bdc59ca 100644
--- a/app/assets/stylesheets/layout/_colors.sass
+++ b/app/assets/stylesheets/layout/_colors.sass
@@ -28,7 +28,6 @@
.color--preview
margin-top: auto
- margin-right: 5px
margin-bottom: auto
border: 1px solid #000
border-radius: 4px
diff --git a/app/views/custom_styles/show.html.erb b/app/views/custom_styles/show.html.erb
index 156c9f8f075..797ac2444de 100644
--- a/app/views/custom_styles/show.html.erb
+++ b/app/views/custom_styles/show.html.erb
@@ -156,22 +156,24 @@ See docs/COPYRIGHT.rdoc for more details.
<%= form_tag update_design_colors_path, method: :post, class: "form" do %>
<section class="form--section">
- <fieldset class="form--fieldset -collapsible collapsed">
+ <fieldset class="form--fieldset -collapsible <%= 'collapsed' unless @current_theme.empty? %> ">
<legend class="form--fieldset-legend"><%= I18n.t(:label_advanced_settings) %></legend>
<% DesignColor.setables.each do |design_color| %>
<div class="form--field -required">
<label class="form--label"><%= I18n.t("admin.custom_styles.colors.#{design_color.variable}") %>:</label>
<span class="form--field-container">
+ <div class="form--field-affix">
+ <%= icon_for_color(OpenStruct.new(variable: design_color.variable,
+ hexcode: design_color.get_hexcode),
+ data: { target: "#design_colors_" + design_color.variable }) %>
+ </div>
<span class="form--text-field-container">
<%= styled_text_field_tag "design_colors[]" + design_color.variable,
design_color.hexcode,
placeholder: DesignColor.defaults[design_color.variable] %>
</span>
</span>
- <%= icon_for_color(OpenStruct.new(variable: design_color.variable,
- hexcode: design_color.get_hexcode),
- data: { target: "#design_colors_" + design_color.variable }) %>
<div class="form--field-instructions">
<% instruction_key = "admin.custom_styles.instructions.#{design_color.variable}" %>
<% if I18n.exists?(instruction_key, :en) %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index fafccaf75f4..b13c79a3836 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -61,7 +61,7 @@ en:
enterprise_notice: "As a special 'Thank you!' for their financial contribution to develop OpenProject, this tiny feature is only available for Enterprise Edition support subscribers."
manage_colors: "Edit color select options"
instructions:
- alternative-color: "Strong accent color, typically used for most the important button on a screen."
+ alternative-color: "Strong accent color, typically used for the most important button on a screen."
content-link-color: "Font color of most of the links."
primary-color: "Main color."
primary-color-dark: "Typically a darker version of the main color used for hover effects."
diff --git a/spec/views/custom_styles/show.html.erb_spec.rb b/spec/views/custom_styles/show.html.erb_spec.rb
index bd435251b71..9a6660f8090 100644
--- a/spec/views/custom_styles/show.html.erb_spec.rb
+++ b/spec/views/custom_styles/show.html.erb_spec.rb
@@ -38,6 +38,7 @@ describe 'custom_styles/show', type: :view do
context "no custom logo yet" do
before do
assign(:custom_style, CustomStyle.new)
+ assign(:current_theme, '')
allow(view).to receive(:options_for_select).and_return('')
render
end
@@ -50,6 +51,7 @@ describe 'custom_styles/show', type: :view do
context "with existing custom logo" do
before do
assign(:custom_style, FactoryBot.build(:custom_style_with_logo))
+ assign(:current_theme, '')
allow(view).to receive(:options_for_select).and_return('')
render
end