showing entries of timeline instead of a json blob, tweaking other UI bits

This commit is contained in:
Dan Buch 2011-07-31 22:38:00 -04:00
parent 15c0345c79
commit 168b2d24eb
4 changed files with 22 additions and 5 deletions

1
.gitignore vendored
View File

@ -8,3 +8,4 @@
TwitterPractice/TwitterPractice/bin TwitterPractice/TwitterPractice/bin
TwitterPractice/bin/EntityFramework.xml TwitterPractice/bin/EntityFramework.xml
App_Data

View File

@ -20,6 +20,7 @@ namespace TwitterPractice.Controllers
public ActionResult Index() public ActionResult Index()
{ {
ViewBag.HasQsVars = (Request.QueryString.Keys.Count > 0);
ViewBag.QueryString = Request.QueryString; ViewBag.QueryString = Request.QueryString;
ViewBag.Message = title; ViewBag.Message = title;
string username = Request.QueryString["username"]; string username = Request.QueryString["username"];

View File

@ -1,14 +1,29 @@
@{ViewBag.Title = "Home Page";} @using Newtonsoft.Json.Linq;
@{ViewBag.Title = "Home Page";}
<h2>@ViewBag.Message</h2> <h2>@ViewBag.Message</h2>
@if (ViewBag.HasQsVars)
{
<h3>Request Variables:</h3> <h3>Request Variables:</h3>
<ul> <ul>
@foreach(string key in ViewBag.QueryString) { @foreach (string key in ViewBag.QueryString)
{
<li>@key = @ViewBag.QueryString[key]</li> <li>@key = @ViewBag.QueryString[key]</li>
} }
</ul> </ul>
}
<div id="user-timeline"> <div id="user-timeline">
<h4>user timeline for @ViewBag.Username</h4> <h4>user timeline for @ViewBag.Username</h4>
<pre>@ViewBag.UserTimeline</pre>
<ul id="timeline-entries">
@foreach (JObject entry in ViewBag.UserTimeline)
{
<li class="timeline-entry">
@entry["text"]
</li>
}
</ul>
<!-- @ViewBag.UserTimeline -->
</div> </div>

View File

@ -11,7 +11,7 @@
<div class="page"> <div class="page">
<header> <header>
<div id="title"> <div id="title">
<h1>Twitter Practice</h1> <h1>@ViewBag.Title</h1>
</div> </div>
<div id="logindisplay"> <div id="logindisplay">
@Html.Partial("_LogOnPartial") @Html.Partial("_LogOnPartial")