<div class="dropdown">
<button
{% if site_code is defined and site_code == constant("App\\Entity\\Content::SITE_AAR") %}
class="hdr-btn hdr-btn-3 dropdown-toggle"
style="padding:6px 15px 7px;border:0px;"
{% else %}
class="btn btn-secondary dropdown-toggle"
{% endif %}
type="button"
{#id="dropdownMenuButton"#}
class="dropdownMenuButton"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
><i class="fa fa-user"></i> {{ app.user.getUsername() }}</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton" style="right: 0; left: auto;">
{% if app.user.isAdmin() %}
<a class="dropdown-item rcs-dropdown-item" href="/admin/"><i class="fa fa-cogs"></i> Admin</a>
{% endif %}
{% if content is defined %}
{% if content is not empty %} {# and content.getType() == 1 #}
{% if content.getType() == 1 %}
{% set type = "page" %}
{% elseif content.getType() == 2 %}
{% set type = "post" %}
{% elseif content.getType() == 3 %}
{% set type = "classified" %}
{% elseif content.getType() == 4 %}
{% set type = "directory" %}
{% elseif content.getType() == 5 %}
{% set type = "gallery" %}
{% set category = content.getCategory() %}
{% if category is not null and category.getSlug() == "partner-galleries" %}
{% set type = "partnergallery" %}
{% endif %}
{% elseif content.getType() == 6 %}
{% set type = "landingpage" %}
{% elseif content.getType() == 7 %}
{% set type = "event" %}
{% elseif content.getType() == 8 %}
{% set type = "webinar" %}
{% set category = content.getCategory() %}
{% if category is not null and category.getSlug() == "partner-webinar" %}
{% set type = "partnerwebinar" %}
{% endif %}
{% elseif content.getType() == 9 %}
{% set type = "forum" %}
{% elseif content.getType() == 10 %}
{% set type = "forumtopic" %}
{% elseif content.getType() == 11 %}
{% set type = "forumreply" %}
{% elseif content.getType() == 14 %}
{% set type = "promosrebates" %}
{% elseif content.getType() == 15 %}
{% set type = "thehub" %}
{% elseif content.getType() == 18 %}
{% set type = "podcast" %}
{% set category = content.getCategory() %}
{% if category is not null and category.getSlug() == "partner-podcast" %}
{% set type = "partnerpodcast" %}
{% endif %}
{% elseif content.getType() == 19 %}
{% set type = "ebook" %}
{% elseif content.getType() == 20 %}
{% set type = "contestsgames" %}
{% elseif content.getType() == 25 %}
{% set type = "award" %}
{% elseif content.getType() == 26 %}
{% set type = "video" %}
{% elseif content.getType() == 27 %}
{% set type = "rclubperk" %}
{% elseif content.getType() == 28 %}
{% set type = "scholarship" %}
{% else %}
{% set type = "content" %}
{% endif %}
{% if app.user.isAdmin() %}
{% if type == "directory" and customer is defined %}
<a target="_blank" class="dropdown-item rcs-dropdown-item" href="/admin/app/customer/{{ customer.getId() }}/edit"><i class="fa fa-pencil"></i> Edit Content</a>
{% elseif type == "forumtopic" or type == "forumreply" %}
{# don't display a link #}
{% else %}
{# TODO: Handle switching sites when editing. #}
{# /edit?site={{content.getSite()}} #}
<a target="_blank" class="dropdown-item rcs-dropdown-item" href="/admin/{{ type }}/{{ content.getId() }}/edit"><i class="fa fa-pencil"></i> Edit Content</a>
{% endif %}
{% endif %}
{% endif %}
{% endif %}
{% if site_code is not defined or site_code == constant("App\\Entity\\Content::SITE_RCS") or site_code == constant("App\\Entity\\Content::SITE_MCS") %}
<a class="dropdown-item rcs-dropdown-item" href="/account"><i class="fa fa-user"></i> Your Account</a>
{% endif %}
{% if site_code is not defined or site_code == constant("App\\Entity\\Content::SITE_RCS") %}
<a class="dropdown-item rcs-dropdown-item" href="/cart"><i class="fa fa-shopping-cart"></i> Your Cart</a>
{% endif %}
<a class="dropdown-item rcs-dropdown-item" href="/sign-out"><i class="fa fa-sign-out"></i> Sign Out</a>
</div>
</div>
{#
<ul>
<li><a href="/account" class="display-inline-block mr-2"><i class="fa fa-user"></i> {{ app.user.getUsername() }}</a>
<ul>
{# <li><a href="/admin/?entity=Content2&action=edit&id="><i class="fa fa-pencil"></i> Edit Page</a></li> # }
<li><a href="/sign-out"><i class="fa fa-sign-out"></i> Sign Out</a></li>
</ul>
</li>
</ul>
#}