Index.cshtml
2.79 KB
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
@using CWA.CpoOnline.Models
@{
ViewBag.Title = "Home Page";
var userSectors = ViewBag.UserSectors as List<SectorViewModel>;
var userSymbols = ViewBag.UserSymbols as List<SymbolViewModel>;
}
<div class="mt-3">
<h1>@WebConfig.AppName</h1>
</div>
@if (userSectors.Any())
{
<div class="row mb-3">
<div class="col">
<h4><i class="fa fa-folder"></i> Sectors</h4>
<div class="list-group">
@foreach (var sector in userSectors)
{
string RowID = sector.Id;
<a class="list-group-item list-group-item-action" data-toggle="collapse" href="#@RowID">
<div class="row">
<div class="col">@sector.Name <div class="float-right btn btn-light">View Symbols</div></div>
</div>
</a>
<div class="collapse" id="@RowID">
@foreach (var symbol in sector.Symbols.Where((s) => userSymbols.Contains(s)))
{
var menu_item = symbol.Name;
if (symbol.Symbol == "spy")
{
menu_item = "SPDR S&P 500";
}
else if (symbol.Symbol == "qqq")
{
menu_item = "Invesco QQQ Trust";
}
<a href="@Url.Action("Display", "Chart", new { symbol = symbol.Symbol })" class="list-group-item list-group-item-action">
<div class="row">
<div class="col">
@symbol.Symbol.ToUpper() - @menu_item <div class="float-right btn btn-light">Display Charts</div>
</div>
</div>
</a>
}
</div>
}
</div>
</div>
</div>
}
else
{
<h1>You do not have access to any symbols</h1>
}
@if (CurrentUser.IsAdmin)
{
<div class="row mt-5">
<div class="col">
<div class="list-group">
<a class="list-group-item list-group-item-action list-group-item-secondary" href="@Url.Action("admin", "home")"><i class="fa fa-lock"></i> Admin Options</a>
</div>
</div>
</div>
}
@helper ShowStatus(int status)
{
if (status < 0)
{
<i class="fa fa-arrow-down text-danger"></i>
}
else if (status > 0)
{
<i class="fa fa-arrow-up text-success"></i>
}
else
{
<i class="fa fa-minus text-secondary"></i>
}
}