add mobile settings navigation

master^2
Alex Turchyn 2 weeks ago committed by Pete Matsyburka
parent 2d510081be
commit cbbbfdda80

@ -0,0 +1,7 @@
# frozen_string_literal: true
class SettingsIndexController < ApplicationController
skip_authorization_check
def index; end
end

@ -1,6 +1,6 @@
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0"> <div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0">
<%= render 'shared/settings_nav' %> <%= render 'shared/settings_nav' %>
<div class="flex-grow max-w-xl mx-auto"> <div class="flex-grow md:max-w-xl md:mx-auto">
<h1 class="text-4xl font-bold mb-4"> <h1 class="text-4xl font-bold mb-4">
<%= t('account') %> <%= t('account') %>
</h1> </h1>

@ -1,6 +1,6 @@
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0"> <div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0">
<%= render 'shared/settings_nav' %> <%= render 'shared/settings_nav' %>
<div class="flex-grow max-w-xl mx-auto min-w-0"> <div class="flex-grow md:max-w-xl md:mx-auto min-w-0">
<h1 class="text-4xl font-bold mb-4">Email SMTP</h1> <h1 class="text-4xl font-bold mb-4">Email SMTP</h1>
<% value = @encrypted_config.value || {} %> <% value = @encrypted_config.value || {} %>
<%= form_for @encrypted_config, url: settings_email_index_path, method: :post, html: { autocomplete: 'off', class: 'space-y-4' } do |f| %> <%= form_for @encrypted_config, url: settings_email_index_path, method: :post, html: { autocomplete: 'off', class: 'space-y-4' } do |f| %>

@ -1,6 +1,6 @@
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0"> <div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0">
<%= render 'shared/settings_nav' %> <%= render 'shared/settings_nav' %>
<div class="flex-grow max-w-xl mx-auto"> <div class="flex-grow md:max-w-xl md:mx-auto">
<h1 class="text-4xl font-bold mb-4"> <h1 class="text-4xl font-bold mb-4">
<%= t('email_notifications') %> <%= t('email_notifications') %>
</h1> </h1>

@ -1,6 +1,6 @@
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0"> <div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0">
<%= render 'shared/settings_nav' %> <%= render 'shared/settings_nav' %>
<div class="flex-grow max-w-xl mx-auto"> <div class="flex-grow md:max-w-xl md:mx-auto">
<p class="text-4xl font-bold mb-4"> <p class="text-4xl font-bold mb-4">
<%= t('email_templates') %> <%= t('email_templates') %>
</p> </p>

@ -1,6 +1,6 @@
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0"> <div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0">
<%= render 'shared/settings_nav' %> <%= render 'shared/settings_nav' %>
<div class="flex-grow max-w-xl mx-auto"> <div class="flex-grow md:max-w-xl md:mx-auto">
<h1 class="text-4xl font-bold mb-4"> <h1 class="text-4xl font-bold mb-4">
<%= t('profile') %> <%= t('profile') %>
</h1> </h1>

@ -0,0 +1,7 @@
<div class="mb-2 w-full">
<a href="<%= root_path %>" class="flex items-center space-x-0.5 font-medium">
<%= svg_icon('arrow_left', class: 'w-4 h-4 stroke-2') %>
<span><%= t('back') %></span>
</a>
</div>
<%= render 'shared/settings_nav', expanded: true %>

@ -28,7 +28,13 @@
<span class="text-sm align-text-top"><%= current_user.initials %></span> <span class="text-sm align-text-top"><%= current_user.initials %></span>
</label> </label>
<ul tabindex="0" class="z-10 dropdown-content p-2 mt-2 shadow menu text-base bg-base-100 rounded-box min-w-[160px] text-right"> <ul tabindex="0" class="z-10 dropdown-content p-2 mt-2 shadow menu text-base bg-base-100 rounded-box min-w-[160px] text-right">
<li> <li class="md:hidden">
<%= link_to settings_index_path, class: 'flex items-center' do %>
<%= svg_icon('settings', class: 'w-5 h-5 flex-shrink-0 stroke-2') %>
<span class="mr-1"><%= t('settings') %></span>
<% end %>
</li>
<li class="max-md:hidden">
<%= link_to settings_profile_index_path, class: 'flex items-center' do %> <%= link_to settings_profile_index_path, class: 'flex items-center' do %>
<%= svg_icon('adjustments', class: 'w-5 h-5 flex-shrink-0 stroke-2') %> <%= svg_icon('adjustments', class: 'w-5 h-5 flex-shrink-0 stroke-2') %>
<span class="mr-1"><%= t('profile') %></span> <span class="mr-1"><%= t('profile') %></span>

@ -1,7 +1,23 @@
<div class="block w-full md:w-52 flex-none"> <% expanded = local_assigns[:expanded] %>
<% unless expanded %>
<div class="md:hidden w-full">
<a href="<%= settings_index_path %>" class="flex items-center space-x-0.5 font-medium">
<%= svg_icon('arrow_left', class: 'w-4 h-4 stroke-2') %>
<span><%= t('settings') %></span>
</a>
</div>
<% end %>
<div class="<%= expanded ? 'block max-md:-mx-3' : 'hidden md:block w-full md:w-52 flex-none' %>">
<menu-active> <menu-active>
<ul id="account_settings_menu" class="menu px-0"> <ul id="account_settings_menu" class="menu px-0">
<li class="menu-title py-0 !bg-transparent mb-3 -mt-5"><a href="<%= '/' %>" class="!bg-transparent !text-neutral font-medium flex items-center space-x-0.5"><%= svg_icon('arrow_left', class: 'w-4 h-4 stroke-2') %><span><%= t('back') %></span></a></li> <% unless expanded %>
<li class="menu-title py-0 !bg-transparent mb-3 -mt-5">
<a href="<%= root_path %>" class="!bg-transparent !text-neutral font-medium flex items-center space-x-0.5">
<%= svg_icon('arrow_left', class: 'w-4 h-4 stroke-2') %>
<span><%= t('back') %></span>
</a>
</li>
<% end %>
<li class="menu-title py-0 !bg-transparent"> <li class="menu-title py-0 !bg-transparent">
<span class="!bg-transparent"><%= t('settings') %></span> <span class="!bg-transparent"><%= t('settings') %></span>
</li> </li>
@ -114,7 +130,7 @@
</ul> </ul>
</menu-active> </menu-active>
<% if Docuseal.multitenant? || cannot?(:manage, :tenants) %> <% if Docuseal.multitenant? || cannot?(:manage, :tenants) %>
<div id="support_channels" class="mx-4 border-t border-base-300 hidden md:block"> <div id="support_channels" class="mx-4 border-t border-base-300 <%= 'hidden md:block' unless expanded %>">
<div class="text-sm mt-3"> <div class="text-sm mt-3">
<%= t('need_help_ask_a_question_') %> <%= t('need_help_ask_a_question_') %>
</div> </div>

@ -1,6 +1,6 @@
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0"> <div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0">
<%= render 'shared/settings_nav' %> <%= render 'shared/settings_nav' %>
<div class="flex-grow max-w-xl mx-auto"> <div class="flex-grow md:max-w-xl md:mx-auto">
<h1 class="text-4xl font-bold mb-4">SMS</h1> <h1 class="text-4xl font-bold mb-4">SMS</h1>
<%= render 'placeholder' %> <%= render 'placeholder' %>
</div> </div>

@ -1,6 +1,6 @@
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0"> <div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0">
<%= render 'shared/settings_nav' %> <%= render 'shared/settings_nav' %>
<div class="flex-grow max-w-xl mx-auto"> <div class="flex-grow md:max-w-xl md:mx-auto">
<h1 class="text-4xl font-bold mb-4">SAML SSO</h1> <h1 class="text-4xl font-bold mb-4">SAML SSO</h1>
<%= render 'placeholder' %> <%= render 'placeholder' %>
</div> </div>

@ -1,6 +1,6 @@
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0"> <div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0">
<%= render 'shared/settings_nav' %> <%= render 'shared/settings_nav' %>
<div class="flex-grow max-w-xl mx-auto"> <div class="flex-grow md:max-w-xl md:mx-auto">
<h1 class="text-4xl font-bold mb-4"> <h1 class="text-4xl font-bold mb-4">
<%= t('storage') %> <%= t('storage') %>
</h1> </h1>

@ -178,6 +178,8 @@ Rails.application.routes.draw do
resources :send_email, only: %i[create], controller: 'submitters_send_email' resources :send_email, only: %i[create], controller: 'submitters_send_email'
end end
get 'settings' => 'settings_index#index', as: :settings_index
scope '/settings', as: :settings do scope '/settings', as: :settings do
unless Docuseal.multitenant? unless Docuseal.multitenant?
resources :storage, only: %i[index create], controller: 'storage_settings' resources :storage, only: %i[index create], controller: 'storage_settings'

Loading…
Cancel
Save