<div class="sidebar">
    <div class="menu-wrap @if ($active) menu-active @endif">
        <a href="/main" class="sidebar-logo">
            <img src="/static/images/logo-new.png" alt="Sylvia" width="100px">
        </a>
        <nav class="menu-nav @if ($active) menu-item-active @endif">
            <ul>
{{--                <li><a href="/index">主页</a></li>--}}
                @foreach ($foldersTree as $tree)
                <li class="menu-nav-item">
                    <a @if (empty($tree['children']) == false) href="javascript:void(0)" @else href="#" onclick="changeIframeSrc('/gallery?fid={{ $tree['id'] }}')" @endif>{{ $tree['title'] }}</a>
                    @if (isset($tree['children']))
                    <ul class="menu-nav-son"  @if ($loop->first) style="display: block;" @else style="display: none;"@endif>
                        @foreach ($tree['children'] as $child)
                        <li class="menu-nav-son-li">
                            <a @if (empty($child['children']) == false) href="javascript:void(0)" @else href="#" onclick="changeIframeSrc('/gallery?fid={{ $child['id'] }}')" @endif>{{ $child['title'] }}</a>
                            @if (isset($child['children']))
                            <ul class="menu-nav-son2">
                                @foreach ($child['children'] as $grandchild)
                                <li>
                                    <a href="#" onclick="changeIframeSrc('/gallery?fid={{ $grandchild['id'] }}')">{{ $grandchild['title'] }}</a>
                                </li>
                                @endforeach
                            </ul>
                            @endif
                        </li>
                        @endforeach
                    </ul>
                    @endif
                </li>
                @endforeach
            </ul>

{{--            <div class="menu-contacts">--}}

{{--                <a href="#" class="menu-contacts__item">--}}
{{--					<span class="menu-contacts__icon">--}}
{{--						<i class="fa fa-envelope"></i>--}}
{{--					</span>--}}
{{--                    <p>Marketing@mietubl.com</p>--}}
{{--                </a>--}}
{{--            </div>--}}
            <div class="menu-close__wrap">
                <a href="javascript:void(0)" class="menu-close"><img style="transform: rotate(180deg);" src="/static/images/arrow-right.svg" alt=""></a>
            </div>

            <div class="menu-login-out">
                <a href="javascript:void(0)" onclick="logout()" class="">退出登录</a>
            </div>
        </nav>
    </div>

    <a href="/main" class="logo">
        <img src="/static/images/logo.png" alt="">
    </a>

    <a href="#" class="hamburger-button">
        <span></span>
        <span></span>
        <span></span>
    </a>
</div>
