summaryrefslogtreecommitdiff
path: root/Project-Unite/Views/Shared/_Layout.cshtml
blob: 14f3c69ed9c81f74860899a1ea98d6acfaeb2efa (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<!DOCTYPE html>
@{
    string style = "";
    if (ViewBag.Banner != null)
    {
        style = "background: url(\"" + ViewBag.Banner + "\") center center fixed;background-size:cover;";
    }
}

<html style="background-color:black;@style">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title &bull; Project: Unite</title>
    @Styles.Render("~/Content/css")
    @Styles.Render("~/Content/bootstrap-theme.css")
    @Styles.Render("~/Content/Site.css")


    @Scripts.Render("~/bundles/modernizr")
    
</head>
<body style="background:rgba(0,0,0,0.25);">
    @Scripts.Render("~/Scripts/highlight.js")
    <div class="navbar navbar-default navbar-fixed-top">
        <div> <!--Let's just add some padding there so the page doesn't look fucked.-->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                @Html.ActionLink("ShiftOS", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
            </div>
            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li>@Html.ActionLink("Home", "Index", "Home")</li>
                    <li>@Html.ActionLink("Download", "Index", "Download")</li>
                    <li>@Html.ActionLink("Customize", "Index", "Skins")</li>
                    <li class="dropdown"><a href="#" data-toggle="dropdown" class="dropdown-toggle">Community <span class="caret"></span></a>
                            <ul class="dropdown-menu">
                                <li>@Html.ActionLink("Discord", "Discord", "Home")</li>
                                <li>@Html.ActionLink("Forum", "Index", "Forum")</li>
                                <li>@Html.ActionLink("Wiki", "Index", "Wiki")</li>
                                <li>@Html.ActionLink("Developer blog", "Index", "Blog")</li>
                                <li>@Html.ActionLink("Bug tracker", "Index", "Bugs")</li>
                                <li><a href="http://github.com/shiftos-game/ShiftOS">GitHub</a></li>
                            </ul>
                        </li>
                </ul>
                @Html.Partial("_LoginPartial")
            </div>
        </div>
    </div>

    @if (ViewBag.Modals != null)
    {

        foreach (var id in ViewBag.Modals)
        {
            <div id="[email protected]" class="modal fade" role="dialog">
                <div class="modal-dialog">

                    <!-- Modal content-->
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal">&times;</button>
                            <h4 class="modal-title">Are you sure?</h4>
                        </div>
                        <div class="modal-body">
                            <p>Deleting this category will delete all child categories and topics associated with it. This <strong>cannot</strong> be undone.</p>
                        </div>
                        <div class="modal-footer">
                            <a href="@id.Value" class="btn btn-primary">Yes</a>
                            <button type="button" class="btn btn-default" data-dismiss="modal">Nope.</button>
                        </div>
                    </div>

                </div>
            </div>

        }

    }

    <div class="container clearfix body-content">
        <div class="panel panel-success">
            <div class="panel-body">
                <p><span class="glyphicon glyphicon-exclamation-sign"></span> <strong>Welcome to Project: Unite!</strong> Things are a bit barren right now and not a lot of stuff is implemented - but feel free to explore!</p>
            </div>
        </div>
        
        @if (!ACL.UserEmailConfirmed(User.Identity.Name))
        {
            <div class="panel panel-warning">
                <div class="panel-body">
                    <span class="glyphicon glyphicon-info-sign"></span> <strong>Email address not confirmed!</strong> Hi! It appears that your email has not been confirmed. Please check your email. @Html.ActionLink("Resend confirmation link", "ResendConf", "Account")
                </div>
            </div>
        }

        @if (ViewBag.Moderator == true)
        {
            <ul class="nav nav-tabs">
                <li>@Html.ActionLink("Home", "Index", "Moderator")</li>
                @if (ACL.Granted(User.Identity.Name, "CanIssueBan"))
                {
                    <li>@Html.ActionLink("Bans", "Bans", "Moderator")</li>
                }
                @if (ACL.Granted(User.Identity.Name, "CanEditProfiles"))
                {
                    <li>@Html.ActionLink("Users", "Users", "Moderator")</li>
                }
                <li>@Html.ActionLink("Audit logs", "Logs", "Moderator")</li>
            </ul>
                @RenderBody();
        }
        else if (ACL.Granted(User.Identity.Name, ViewBag.ACLRule))
        {
		if (ViewBag.Admin == true)
        {
            if (ACL.Granted(User.Identity.Name, "CanAccessAdminCP"))
            {
				<ul class="nav nav-tabs">
					<li>@Html.ActionLink("Home", "Index", "Admin")</li>
					@if (ACL.Granted(User.Identity.Name, "CanEditRoles"))
                    {
						<li>@Html.ActionLink("Roles", "Roles", "Admin")</li>
                        <li>@Html.ActionLink("Access Control", "AccessControl", "Admin")</li>

                    }
					@if (ACL.Granted(User.Identity.Name, "CanEditProfiles"))
                    {
						<li>@Html.ActionLink("Users", "Users", "Admin")</li>
                    }
                    @if (ACL.Granted(User.Identity.Name, "CanEditForumCategories"))
                    {
                        <li>@Html.ActionLink("Forum Categories", "Forums", "Admin")</li>
                    }
                    <li>@Html.ActionLink("Audit logs", "Logs", "Admin")</li>
				</ul>
				@RenderBody();
            }
            else
            {
				<h2>Access denied.</h2>
				<p>You do not have permission to access this page. Contact an admin if this is in error.</p>
            }
        }
        else
        {
			@RenderBody()

        }
        }
        else
        {
            <h2>Access denied.</h2>
                <p>You do not have permission to access this page. Contact an admin if this is in error.</p>

        }<hr />

		<footer>

			<p>&copy; @DateTime.Now.Year Michael VanOverbeek and the ShiftOS Dev Team</p>
			@if (ACL.Granted(User.Identity.Name, "CanAccessAdminCP"))
			{
				<p>@Html.ActionLink("Administrator Control Panel", "Index", "Admin")</p>
			}
        </footer>
    </div>

    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")
    @RenderSection("scripts", required: false)
</body>
</html>