Skip to content
Snippets Groups Projects
Commit 9443c668 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

theme switcher

parent 581c3640
No related branches found
No related tags found
No related merge requests found
......@@ -26,11 +26,11 @@ $font-family-sans-serif: "Basier Square", sans-serif
$grid-gutter-width: 64px
$border-radius: 0
$border-radius-sm: 0
$border-radius-lg: 0
$border-radius-xl: 0
$border-radius-2xl: 0
$border-radius: 2px
$border-radius-sm: $border-radius
$border-radius-lg: $border-radius
$border-radius-xl: $border-radius
$border-radius-2xl: $border-radius
$card-border-width: 0
$card-cap-bg: $color-background-alt
......
......@@ -3,6 +3,11 @@ class Admin::ApplicationController < ApplicationController
before_action :load_filters, only: :index
def set_theme
current_user.update_column :admin_theme, params[:theme]
redirect_to admin_root_path
end
protected
def breadcrumb
......
......@@ -4,6 +4,19 @@
<div class="row mb-5">
<div class="col-md-6 pb-4">
<%= panel title: t('hello', name: current_user.first_name) do %>
<% if current_admin_theme == 'appstack' %>
<p>
Osuny a un nouveau thème pour l'administration, "Pure". <br>
Voulez-vous l'essayer ?
</p>
<%= link_to 'Changer de thème', admin_set_theme_path(theme: 'pure'), method: :put, class: button_classes %>
<% else %>
<p>
Vous utilisez le thème "Pure" pour l'administration. <br>
Voulez-vous revenir au thème "Appstack" ?
</p>
<%= link_to 'Changer de thème', admin_set_theme_path(theme: 'appstack'), method: :put, class: button_classes %>
<% end %>
<div class="text-end">
<% if current_university.logo.attached? %>
<%= image_tag current_university.logo, width: 120 %>
......
......@@ -23,6 +23,7 @@ Rails.application.routes.draw do
post 'resend_confirmation_email' => 'users#resend_confirmation_email', on: :member
patch 'unlock' => 'users#unlock', on: :member
end
put 'theme' => 'application#set_theme', as: :set_theme
draw 'admin/administration'
draw 'admin/communication'
draw 'admin/education'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment