src/Bidcoz/Bundle/CoreBundle/Resources/views/Layout/Blocks/menu/user.html.twig line 1

Open in your IDE?
  1. {% if is_logged_in() %}
  2.     {% set orgAccess = user_organization_access(app.user) %}
  3.     <li class="notifications has-icon" id="step7">
  4.         <div class="tooltip-container">
  5.             <a href="#" id="alert-notification" class="notifications-link tooltip-trigger">
  6.                 {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'bell-outline', h: '1.5rem', w: '1.5rem' } %}
  7.                 {% if (beforeAlertsContent is defined and beforeAlertsContent) or (alertsContent is defined and alertsContent) or (afterAlertsContent is defined and afterAlertsContent) %}
  8.                     <div class="bubble notifications-bubble"></div>
  9.                 {% endif %}
  10.             </a>
  11.             <div class="tooltip tooltip-below tooltip-center font-weight-bold">Notifications</div>
  12.         </div>
  13.     </li>
  14.     {% if is_granted('ROLE_SUPER_ADMIN') or orgAccess|length or (campaign is defined and is_granted('MANAGE', campaign)) %}
  15.         <li id="settings" class="has-icon">
  16.             <div class="tooltip-container">
  17.                 <a href="#" class="d-flex align-items-center tooltip-trigger">
  18.                     {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'cog-outline', h: '1.5rem', w: '1.5rem' } %}
  19.                 </a>
  20.                 <div class="tooltip tooltip-below tooltip-center font-weight-bold">Settings</div>
  21.             </div>
  22.             <ul class="menu">
  23.                 {% if campaign is defined and campaign is not null and (is_granted('MANAGE', campaign) or is_granted('ROLE_SUPER_ADMIN')) %}
  24.                     <li>
  25.                         <a href="{{ path('campaign_manage_summary', {orgSlug: campaign.organization.slug, campaignSlug: campaign.slug}) }}">Manage Flight</a>
  26.                     </li>
  27.                 {% endif %}
  28.                 {% if orgAccess|length %}
  29.                     {# organization icon for mobile #}
  30.                     {% if orgAccess|length == 1 %}
  31.                         {% set theOrg = orgAccess|first %}
  32.                         <li>
  33.                             <a href="{{ path('organization_manage_dashboard', {orgSlug: theOrg.slug}) }}" title="{{ theOrg.name }}"> Fundraising Admin</a>
  34.                         </li>
  35.                     {% else %}
  36.                         <li class="dropdown">
  37.                             <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  38.                                 Accounts
  39.                             </a>
  40.                             <ul class="dropdown-menu menu" role="menu">
  41.                                 {% for theOrg in orgAccess %}
  42.                                     <li>
  43.                                         <a href="{{ path('organization_manage_dashboard', {orgSlug: theOrg.slug}) }}">{{ theOrg.name }}</a>
  44.                                     </li>
  45.                                 {% endfor %}
  46.                             </ul>
  47.                         </li>
  48.                     {% endif %}
  49.                 {% elseif organization is not defined %}
  50.                     <li>
  51.                         <a href="{{ path('organization_register') }}">Setup Account</a>
  52.                     </li>
  53.                 {% endif %}
  54.                 {% if is_granted('ROLE_SUPER_ADMIN') %}
  55.                     <li class="super-admin"><a href="{{ path('admin_index') }}">Super Admin</a></li>
  56.                 {% endif %}
  57.                 {% if not campaign is defined and app.session.has('viewed_campaign') and orgAccess|length == 0 %}
  58.                     {% set campaignData = app.session.get('viewed_campaign') %}
  59.                     <li>
  60.                         <a href="{{ path('campaign_home', {orgSlug: campaignData.organization.slug, campaignSlug: campaignData.slug}) }}">
  61.                             Return to {{ campaignData.name }}
  62.                         </a>
  63.                     </li>
  64.                 {% elseif not organization is defined and app.session.has('viewed_organization') and orgAccess|length == 0 %}
  65.                     {% set orgData = app.session.get('viewed_organization') %}
  66.                     <li>
  67.                         <a href="{{ path('organization_home', {orgSlug: orgData.slug}) }}">
  68.                             Return to {{ orgData.name }}
  69.                         </a>
  70.                     </li>
  71.                 {% endif %}
  72.                 {# {% if campaign is defined and is_granted('FULL', campaign) %}
  73.                     <li>
  74.                         <a href="{{ path('campaign_manage_permissions', campaignParams) }}">User Permissions</a>
  75.                     </li>
  76.                 {% endif %} #}
  77.                 {% if organization is not defined or is_granted('REGISTRATION', organization) %}
  78.                     {% set registrations = user_registrations(app.user) %}
  79.                     {% if registrations|length %}
  80.                         {% set campaign_registrations = campaign is defined and campaign is not null ? user_campaign_registrations(app.user, campaign) : {} %}
  81.                         {% if campaign_registrations|length %}
  82.                             <li>
  83.                                 <a href="{{ path('account_campaign_registrations', {orgSlug: organization.slug, campaignSlug: campaign.slug}) }}">
  84.                                     Registrations
  85.                                     <span class="badge">{{ campaign_registrations|length }}</span>
  86.                                 </a>
  87.                             </li>
  88.                         {% endif %}
  89.                     {% endif %}
  90.                 {% endif %}
  91.                 {% if organization is defined and is_granted('DONATION', organization) %}
  92.                     {% set donations = campaign is defined and campaign is not null ? user_campaign_stripe_donations(app.user, campaign, 'fund-drive') : {} %}
  93.                     {% if donations|length %}
  94.                             <li>
  95.                                 <a href="{{ path('account_campaign_donations', {orgSlug: organization.slug, campaignSlug: campaign.slug}) }}">
  96.                                     Donations
  97.                                     <span class="badge">{{ donations|length }}</span>
  98.                                 </a>
  99.                             </li>
  100.                     {% endif %}
  101.                 {% endif %}
  102.                 {% if organization is defined and is_granted('MEMBERSHIP', organization) %}
  103.                     {% set memberships = campaign is defined and campaign is not null ? user_campaign_stripe_donations(app.user, campaign, 'membership') : {} %}
  104.                     {% if memberships|length %}
  105.                         <li>
  106.                             <a href="{{ path('account_campaign_memberships', {orgSlug: organization.slug, campaignSlug: campaign.slug}) }}">
  107.                                 Memberships
  108.                                 <span class="badge">{{ memberships|length }}</span>
  109.                             </a>
  110.                         </li>
  111.                     {% endif %}
  112.                 {% endif %}
  113.             </ul>
  114.         </li>
  115.     {% endif %}
  116.     {% set tickets = user_tickets(app.user) %}
  117.     {% set ticket_groups = user_ticket_groups(app.user) %}
  118.     {% if tickets|length or ticket_groups|length %}
  119.         {% set campaign_tickets = campaign is defined and campaign is not null ? user_campaign_tickets(app.user, campaign) : {} %}
  120.         {% set campaign_ticket_groups = campaign is defined and campaign is not null ? user_campaign_ticket_groups(app.user, campaign) : {} %}
  121.         {# ticket icon for mobile #}
  122.         {% if organization is defined and is_granted('TICKET', organization) and (campaign_tickets|length or campaign_ticket_groups|length) %}
  123.             {% set numTickets = campaign_tickets|length > 0 ? campaign_tickets|length : campaign_ticket_groups|length %}
  124.             <li id="tickets" class="has-icon">
  125.                 <div class="tooltip-container">
  126.                     <a href="{{ path('account_campaign_tickets', {orgSlug: organization.slug, campaignSlug: campaign.slug}) }}" class="d-flex align-items-center tooltip-trigger">
  127.                         {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'ticket-outline', h: '1.5rem', w: '1.5rem' } %}
  128.                         <span class="badge">{{ numTickets }}</span>
  129.                     </a>
  130.                     <div class="tooltip tooltip-below tooltip-center font-weight-bold">Tickets</div>
  131.                 </div>
  132.             </li>
  133.         {% else %}
  134.             <li id="tickets" class="has-icon">
  135.                 <div class="tooltip-container">
  136.                     <a href="{{ path('account_tickets') }}" class="tooltip-trigger">
  137.                         {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'ticket-outline', h: '1.5rem', w: '1.5rem' } %}
  138.                     </a>
  139.                     <div class="tooltip tooltip-below tooltip-center font-weight-bold">Tickets</div>
  140.                 </div>
  141.             </li>
  142.         {% endif %}
  143.     {% endif %}
  144.     {% set purchases = user_purchases(app.user) %}
  145.     {% set campaign_purchases = campaign is defined and campaign is not null ? user_campaign_purchases(app.user, campaign) : {} %}
  146.     {% if purchases|length and campaign_purchases|length %}
  147.         {# cart icon for mobile #}
  148.         <li id="cart" class="has-icon">
  149.             <div class="tooltip-container">
  150.                 <a class="user-nav-cart d-flex align-items-center tooltip-trigger" href="{{ path('account_campaign_purchases', {orgSlug: organization.slug, campaignSlug: campaign.slug}) }}">
  151.                     {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'cart-outline', h: '1.5rem', w: '1.5rem' } %}
  152.                     <div class="bubble bubble-cart">{{ campaign_purchases|length }}</div>
  153.                 </a>
  154.                 <div class="tooltip tooltip-below tooltip-center font-weight-bold">Cart</div>
  155.             </div>
  156.         </li>
  157.     {% endif %}
  158.     {# account icon for mobile with drop down of my account and logout #}
  159.     <li id="account" class="has-icon">
  160.         <div class="tooltip-container">
  161.             <a href="#" class="d-flex align-items-center tooltip-trigger">
  162.                 {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'user-fill', h: '1.5rem', w: '1.5rem' } %}
  163.             </a>
  164.             <div class="tooltip tooltip-below tooltip-center font-weight-bold">Account</div>
  165.         </div>
  166.         <ul class="menu">
  167.             <li class="py-2 px-3">
  168.                 <div class="name text-nowrap">
  169.                     <strong>{{ app.user.firstName }} {{ app.user.lastName }}</strong>
  170.                 </div>
  171.                 <div class="email" style="font-size: 11px;">{{ app.user.email }}</div>
  172.             </li>
  173.             <li>
  174.                 <a href="{{ path('fos_user_profile_edit') }}">Account</a>
  175.             </li>
  176.             <li>
  177.                 <a href="{{ path('account_purchases') }}">My Purchases</a>
  178.             </li>
  179.             <li>
  180.                 <a href="{{ path('fos_user_security_logout') }}">Logout</a>
  181.             </li>
  182.         </ul>
  183.     </li>
  184. {% else %}
  185.     {% set currentRoute = app.request.attributes.get('_route') %}
  186.     <li class="has-icon">
  187.         <div class="tooltip-container">
  188.             <a href="#" class="tooltip-trigger">
  189.                 {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'user-fill', h: '1.5rem', w: '1.5rem' } %}
  190.             </a>
  191.             <div class="tooltip tooltip-below tooltip-center font-weight-bold">Account</div>
  192.         </div>
  193.         <ul class="menu">
  194.             {% if campaign is defined %}
  195.                 {% set params = {orgSlug: organization.slug, campaignSlug: campaign.slug } %}
  196.                 <li>
  197.                     <a class="trigger-login" href="{{ path('campaign_login_user', params) }}">
  198.                         SIGN IN
  199.                     </a>
  200.                 </li>
  201.                 {% if currentRoute != 'campaign_register_user' %}
  202.                     <li>
  203.                         <a class="trigger-registration" href="{{ path('campaign_register_user', params) }}">
  204.                             CREATE ACCOUNT
  205.                         </a>
  206.                     </li>
  207.                 {% endif %}
  208.             {% elseif organization is defined %}
  209.                 {% set params = {orgSlug: organization.slug } %}
  210.                 <li>
  211.                     <a class="trigger-login" href="{{ path('organization_login_user', params) }}">
  212.                         SIGN IN
  213.                     </a>
  214.                 </li>
  215.                 <li>
  216.                     <a class="trigger-registration" href="{{ path('organization_register_user', params) }}">
  217.                         CREATE ACCOUNT
  218.                     </a>
  219.                 </li>
  220.             {% else %}
  221.                 <li>
  222.                     <a class="trigger-registration" href="{{ path('fos_user_registration_register') }}">
  223.                         GET STARTED
  224.                     </a>
  225.                 </li>
  226.                 <li>
  227.                     <a class="trigger-login" href="{{ path('fos_user_security_login') }}">
  228.                         SIGN IN
  229.                     </a>
  230.                 </li>
  231.             {% endif %}
  232.         </ul>
  233.     </li>
  234. {% endif %}