diff --git a/app/javascript/application.js b/app/javascript/application.js index b4db160c..c92af94a 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -6,6 +6,7 @@ import ToggleVisible from './elements/toggle_visible' import DisableHidden from './elements/disable_hidden' import TurboModal from './elements/turbo_modal' import FileDropzone from './elements/file_dropzone' +import MenuActive from './elements/menu_active' import FlowBuilder from './flow_builder/builder' @@ -17,6 +18,7 @@ window.customElements.define('toggle-visible', ToggleVisible) window.customElements.define('disable-hidden', DisableHidden) window.customElements.define('turbo-modal', TurboModal) window.customElements.define('file-dropzone', FileDropzone) +window.customElements.define('menu-active', MenuActive) window.customElements.define('flow-builder', class extends HTMLElement { connectedCallback () { diff --git a/app/javascript/elements/menu_active.js b/app/javascript/elements/menu_active.js new file mode 100644 index 00000000..e9c434d2 --- /dev/null +++ b/app/javascript/elements/menu_active.js @@ -0,0 +1,9 @@ +export default class extends HTMLElement { + connectedCallback () { + this.querySelectorAll('a').forEach((link) => { + if (document.location.pathname.startsWith(link.pathname)) { + link.classList.add('bg-base-300') + } + }) + } +} diff --git a/app/views/email_settings/index.html.erb b/app/views/email_settings/index.html.erb index 59ff27ca..3d18d874 100644 --- a/app/views/email_settings/index.html.erb +++ b/app/views/email_settings/index.html.erb @@ -1,27 +1,34 @@ -Email settings -<% value = @encrypted_config.value || {} %> -<%= form_for @encrypted_config, url: settings_email_index_path, method: :post, html: { autocomplete: 'off' } do |f| %> - <%= f.fields_for :value do |ff| %> -
| + User + | ++ Role + | ++ Last session + | ++ | +
|---|---|---|---|
|
+ <%= user.full_name %> + <%= user.email %> + |
+ + <%= user.role %> + | ++ <%= user.last_sign_in_at ? l(user.last_sign_in_at) : '-' %> + | ++ <%= link_to 'Edit', edit_user_path(user), data: { turbo_frame: 'modal' } %> + <%= button_to 'Remove', user_path(user), method: :delete, data: { turbo_confirm: 'Are you sure?' } %> + | +
| - User - | -- Role - | -- Last session - | -- | -
|---|---|---|---|
|
- <%= user.full_name %> - <%= user.email %> - |
- - <%= user.role %> - | -- <%= user.last_sign_in_at ? l(user.last_sign_in_at) : '-' %> - | -- <%= link_to 'Edit', edit_user_path(user), data: { turbo_frame: 'modal' } %> - <%= button_to 'Remove', user_path(user), method: :delete, data: { turbo_confirm: 'Are you sure?' } %> - | -