Remove theme preview route and logic

This commit is contained in:
Andreas Nedbal 2020-05-04 17:26:38 +02:00
parent 582f8606b0
commit e7c5b1a4a3
2 changed files with 0 additions and 24 deletions

View File

@ -110,29 +110,6 @@ class UserController < ApplicationController
redirect_to edit_user_profile_path redirect_to edit_user_profile_path
end end
# NOTE: Yes, I am storing and transmitting values as 3 byte numbers because false sense of security.
def preview_theme
attrib = params.permit([
:primary_color, :primary_text,
:danger_color, :danger_text,
:success_color, :success_text,
:warning_color, :warning_text,
:info_color, :info_text,
:default_color, :default_text,
:panel_color, :panel_text,
:link_color, :background_color,
:background_text, :background_muted,
:input_color, :input_text,
:outline_color
])
attrib.each do |k ,v|
attrib[k] = v.to_i
end
render plain: render_theme_with_context(attrib)
end
def update_theme def update_theme
update_attributes = params.require(:theme).permit([ update_attributes = params.require(:theme).permit([
:primary_color, :primary_text, :primary_color, :primary_text,

View File

@ -65,7 +65,6 @@ Rails.application.routes.draw do
match '/settings/theme', to: 'user#edit_theme', via: 'get', as: :edit_user_theme match '/settings/theme', to: 'user#edit_theme', via: 'get', as: :edit_user_theme
match '/settings/theme', to: 'user#update_theme', via: 'patch', as: :update_user_theme match '/settings/theme', to: 'user#update_theme', via: 'patch', as: :update_user_theme
match '/settings/theme/preview.css', to: 'user#preview_theme', via: 'post', as: :preview_user_theme
match '/settings/theme/delete', to: 'user#delete_theme', via: 'delete', as: :delete_user_theme match '/settings/theme/delete', to: 'user#delete_theme', via: 'delete', as: :delete_user_theme
# resources :services, only: [:index, :destroy] # resources :services, only: [:index, :destroy]