Created
December 21, 2011 17:39
-
-
Save msbukkuri/1506914 to your computer and use it in GitHub Desktop.
Simpm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<use namespace="System.Linq" /> | |
<viewdata model="SimpleProjectManagement.Features.DashboardViewModel" /> | |
<content:main> | |
<div class="content"> | |
<div class="page-header"> | |
<h1> | |
Kanban Board! | |
</h1> | |
</div> | |
<div class="span8 offset4"> | |
<button id="createStoryButton" class="btn">Create Story</button> | |
<div id="createStoryModal" style="display:none"> | |
<h3>Create Story</h3> | |
<div class="close">x</div> | |
<div> | |
<form action="" post=""> | |
<div class="clearfix"> | |
<label for="StoryName">STORY NAME</label> | |
<!--${this.LabelFor(m => Model.StoryModel.Name)}--> | |
${ this.InputFor(m => Model.Stories.First().Name) } | |
</div> | |
<div class="clearfix"> | |
<label for="Status">STATUS</label> | |
<!--${this.LabelFor(m => Model.StoryModel.Status)} | |
${this.InputFor(m => Model.StoryModel.Status)}--> | |
</div> | |
<div class="clearfix"> | |
<label for="PointValue">POINT VALUE</label> | |
<!--${this.LabelFor(m => Model.StoryModel.PointValue)} | |
${this.InputFor(m => Model.StoryModel.PointValue)}--> | |
<div class="well"> | |
<a href="#" class="btn small primary">Create</a> | |
<a id="close" href="#" class="btn small default">Cancel</a> | |
</div> | |
</div> | |
</form> | |
</div> | |
</div> | |
</div> | |
<div class="alert-message warning"> | |
<p>Super Test</p> | |
</div> | |
<br/> | |
<table class="zebra-striped"> | |
<thead> | |
<tr> | |
<th>Name</th> | |
<th>Status</th> | |
<th>PointValue</th> | |
</tr> | |
</thead> | |
<tbody> | |
<if condition="Model.Stories.Any()"> | |
<tr each="var story in Model.Stories"> | |
<td>${story.Name}</td> | |
<td>${story.Status}</td> | |
<td>${story.PointValue}</td> | |
</tr> | |
</if> | |
<else> | |
<tr> | |
<td colspan="3" class="alert-message warning"> | |
<p>No stories here.</p> | |
</td> | |
</tr> | |
</else> | |
</tbody> | |
</table> | |
</div> | |
</content:main> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DashboardRequestModel { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DashboardViewModel | |
{ | |
public IEnumerable<Story> Stories { get; set; } | |
public Story StoryModel { get; set; } | |
public DashboardViewModel() | |
{ | |
Stories = new List<Story>(); | |
StoryModel = new Story(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GetHandler | |
{ | |
private readonly IStoryListRepository _storyListRepository; | |
public GetHandler(IStoryListRepository storyListRepository) | |
{ | |
_storyListRepository = storyListRepository; | |
} | |
public DashboardViewModel Execute(DashboardRequestModel requestModel) | |
{ | |
return new DashboardViewModel() | |
{ | |
Stories = _storyListRepository.GetAll(), | |
StoryModel = new Story() | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment