Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

design update #2831

Merged
merged 5 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 7 additions & 21 deletions app/Domain/Menu/Js/menuController.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,19 @@ import jQuery from 'jquery';
import { appUrl } from 'js/app/core/instance-info.module';
import { updateUserMenuSettings } from './menuRepository';

export const toggleSubmenu = function (submenuName) {

export const toggleSubmenu = function (submenuName, submenuDisplay) {
if (submenuName === "") {
return;
}

var submenuDisplay = jQuery('#submenu-' + submenuName).css('display');
var submenuState = '';

if (submenuDisplay == 'none') {
jQuery('#submenu-' + submenuName).css('display', 'block');
jQuery('#submenu-icon-' + submenuName).removeClass('fa-angle-right');
jQuery('#submenu-icon-' + submenuName).addClass('fa-angle-down');
submenuState = 'open';
} else {
jQuery('#submenu-' + submenuName).css('display', 'none');
jQuery('#submenu-icon-' + submenuName).removeClass('fa-angle-down');
jQuery('#submenu-icon-' + submenuName).addClass('fa-angle-right');
submenuState = 'closed';
}
const submenuState = (submenuDisplay === 'none' || submenuDisplay === '' || submenuDisplay === 'closed') ? 'open' : 'closed';

jQuery.ajax({
type : 'PATCH',
url : appUrl + '/api/submenu',
data : {
submenu : submenuName,
state : submenuState
type: 'PATCH',
url: appUrl + '/api/submenu',
data: {
submenu: submenuName,
state: submenuState
}
});
}
Expand Down
48 changes: 26 additions & 22 deletions app/Domain/Menu/Templates/partials/leftnav/submenu.blade.php
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
@if(!isset($menuItem['role']) || $login::userIsAtLeast($menuItem['role'] ?? 'editor'))

<li class="submenuToggle">
<a href="javascript:void(0);"
@if ( $menuItem['visual'] !== 'always' )
onclick="leantime.menuController.toggleSubmenu('{{ $menuItem['id'] }}')"
@endif
>
<i class="submenuCaret fa fa-angle-{{ $menuItem['visual'] == 'closed' ? 'right' : 'down' }}"
id="submenu-icon-{{ $menuItem['id'] }}"></i>
<li>
<details {{ $menuItem['visual'] === 'closed' ? '' : 'open' }}>
<summary onclick="leantime.menuController.toggleSubmenu('{{ $menuItem['id'] }}', this.parentNode.open ? 'open' : 'closed')">
<strong>{!! __($menuItem['title']) !!}</strong>
</a>
</li>
<ul id="submenu-{{ $menuItem['id'] }}" class="submenu {{ $menuItem['visual'] == 'closed' ? 'closed' : 'open' }}">
@foreach ($menuItem['submenu'] as $subkey => $submenuItem)
@switch ($submenuItem['type'])
@case('header')
@include("menu::partials.leftnav.header", ["menuItem" => $submenuItem, "module" => $module, "action" => $action])
</summary>
<ul id="submenu-{{ $menuItem['id'] }}" class="">
@foreach ($menuItem['submenu'] as $subkey => $submenuItem)
@switch ($submenuItem['type'])
@case('header')
@include('menu::partials.leftnav.header', [
'menuItem' => $submenuItem,
'module' => $module,
'action' => $action,
])
@break
@case('item')
@include("menu::partials.leftnav.item", ["menuItem" => $submenuItem, "module" => $module, "action" => $action])
@endswitch
@endforeach
</ul>

@endif

@case('item')
@include('menu::partials.leftnav.item', [
'menuItem' => $submenuItem,
'module' => $module,
'action' => $action,
])
@break
@endswitch
@endforeach
</ul>
</details>
</li>
@endif
4 changes: 4 additions & 0 deletions app/Domain/Tickets/Templates/partials/showTicket.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
@php
use Leantime\Core\Support\EditorTypeEnum;
@endphp

<x-global::content.modal.modal-buttons>

@if (isset($ticket->date))
Expand Down
Loading