summaryrefslogtreecommitdiff
path: root/Project-Unite/Views/Shared/_LoginPartial.cshtml
blob: 7c1bfb3a5308d25f2e6cd7a0b0befe0caba7467b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
@using Microsoft.AspNet.Identity



@if (Request.IsAuthenticated)
{
    using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" }))
    {
    @Html.AntiForgeryToken()

    <ul class="nav navbar-nav navbar-right"  style="margin-right:15px;">
        <li>@Html.NewestUser()</li>
        <li><a href="@Url.Action("ViewUnread", "Forum")"><span class="glyphicon glyphicon-star-empty"></span> @ACL.UnreadPostsCount(User.Identity.Name) unread posts</a></li>
        <li class="dropdown"><a href="#" data-toggle="dropdown" class="dropdown-toggle"><span class="glyphicon glyphicon-bullhorn"></span> @Html.NotificationCount(User.Identity.GetUserId())</a>
            <ul class="dropdown-menu">
                <li class="dropdown-header">Notifications (@Html.NotificationCount(User.Identity.Name) unread)</li>
                @Html.GetLatestUnread(User.Identity.Name)
                <li>@Html.ActionLink("View all", "Notifications", "Manage")</li>
            </ul>
        </li>
        <li class="dropdown"><a href="#" data-toggle="dropdown" class="dropdown-toggle"><span class="glyphicon glyphicon-user"></span> @Html.UserName(User.Identity.GetUserId()) <span class="caret"></span></a>
            <ul class="dropdown-menu">
                <li><a href="@Url.Action("ViewProfile", "Profiles", new { id = ACL.UserNameRaw(User.Identity.GetUserId()) })"><span class="glyphicon glyphicon-user"></span> Profile</a></li>
                <li class="divider"></li>
                <li class="dropdown-header">Settings</li>
                @if(ACL.Granted(User.Identity.Name, "CanAccessAdminCP"))
                {
                    <li><a href="@Url.Action("Index", "Admin")"><span class="glyphicon glyphicon-cog"></span> Admin CP</a></li>
                }
                @if (ACL.Granted(User.Identity.Name, "CanAccessModCP"))
                {
                    <li><a href="@Url.Action("Index", "Moderator")"><span class="glyphicon glyphicon-warning-sign"></span> Mod CP</a></li>
                }
                @if (ACL.Granted(User.Identity.Name, "CanAccessDevCP"))
                {
                    <li><a href="@Url.Action("Index", "Developer")"><span class="glyphicon glyphicon-star"></span> Developer CP</a></li>
                }
                <li><a href="@Url.Action("Index", "Manage")"><span class="glyphicon glyphicon-adjust"></span> Account</a></li>
                <li class="divider"></li>
                <li><a href="javascript:document.getElementById('logoutForm').submit()"><span class="glyphicon glyphicon-log-out"></span> Log off</a></li>
            </ul>
        </li>
    </ul>
    }
}
else
{
    <ul class="nav navbar-nav navbar-right"  style="margin-right:15px;">
        <li>@Html.ActionLink("Register", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })</li>
        <li>@Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })</li>
    </ul>
}
    @using (Html.BeginForm("Search", "Home", FormMethod.Post, new { @class = "navbar-form navbar-right" }))
    {
        <input type="text" name="query" class="form-control navbar-search" />
        <input type="submit" value="Search" class="btn btn-default" />

    }