-
Notifications
You must be signed in to change notification settings - Fork 5.1k
/
Index.cshtml
54 lines (52 loc) · 1.34 KB
/
Index.cshtml
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
@page
@model IndexModel
@{
ViewData["Title"] = "Home page";
}
<h2>Simple Feed Reader</h2>
<hr />
<div class="row">
<div>
<form method="get">
<div class="form-group">
<label>
Enter a feed URL:
<input name="FeedUrl" id="FeedUrl" class="form-control" value="@Request.Query["feedurl"]" />
</label>
</div>
<div class="form-group">
<input type="submit" value="Retrieve Feed" class="btn btn-default" />
</div>
</form>
</div>
@if (!string.IsNullOrEmpty(Model.ErrorText))
{
<div>
<h3 class="text-danger">@Model.ErrorText</h3>
</div>
}
@if (Model.NewsItems?.Count > 0)
{
<table class="table">
<thead>
<tr>
<th>Title</th>
<th>Published</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.NewsItems)
{
<tr>
<td>
<a href="@item.Uri" target="_blank">@item.Title</a>
</td>
<td>
@item.Published.ToString("MMM dd, yyyy HH:mm:ss")
</td>
</tr>
}
</tbody>
</table>
}
</div>