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
fix rubocup warning and some spacing
Behrokh Satarnejade1bfea1eb16e
diff --git a/app/controllers/custom_styles_controller.rb b/app/controllers/custom_styles_controller.rbindex 984cb9094a6..78d2e836bf5 100644--- a/app/controllers/custom_styles_controller.rb+++ b/app/controllers/custom_styles_controller.rb@@ -47,10 +47,12 @@ class CustomStylesController < ApplicationControllerdef default_url_optionssuper.merge(tab: params[:tab])end+def show@custom_style = CustomStyle.current || CustomStyle.new@current_theme = @custom_style.theme@theme_options = options_for_theme_select+if params[:tab].blank?redirect_to tab: "interface"end@@ -141,11 +143,9 @@ class CustomStylesController < ApplicationControllerenddef update_themes- theme = OpenProject::CustomStyles::ColorThemes.themes.find { |t| t[:theme] == params[:theme] }-call = ::Design::UpdateDesignService- .new(theme)- .call+ .new(theme_from_params)+ .callcall.on_success doflash[:notice] = I18n.t(:notice_successful_update)@@ -154,11 +154,16 @@ class CustomStylesController < ApplicationControllercall.on_failure doflash[:error] = call.messageend+redirect_to custom_style_pathendprivate+ def theme_from_params+ OpenProject::CustomStyles::ColorThemes.themes.find { |t| t[:theme] == params[:theme] }+ end+def options_for_theme_selectoptions = OpenProject::CustomStyles::ColorThemes.themes.pluck(:theme)unless @current_theme.present?diff --git a/app/views/custom_styles/show.html.erb b/app/views/custom_styles/show.html.erbindex 6884e2487de..633b5a612d4 100644--- a/app/views/custom_styles/show.html.erb+++ b/app/views/custom_styles/show.html.erb@@ -27,12 +27,7 @@ See COPYRIGHT and LICENSE files for more details.++#%>-<% tabs = design_tabs %>-<%=- render(Admin::DesignHeaderComponent.new(- tabs: design_tabs,- ))-%>+<%= render(Admin::DesignHeaderComponent.new(tabs: design_tabs)) %><%= error_messages_for 'custom_style' %><%= form_tag update_design_themes_path, method: :post, class: "form" do %>