Skip to content

Instantly share code, notes, and snippets.

@msbukkuri
Created December 21, 2011 17:39
Show Gist options
  • Save msbukkuri/1506914 to your computer and use it in GitHub Desktop.
Save msbukkuri/1506914 to your computer and use it in GitHub Desktop.
Simpm
<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>
public class DashboardRequestModel { }
public class DashboardViewModel
{
public IEnumerable<Story> Stories { get; set; }
public Story StoryModel { get; set; }
public DashboardViewModel()
{
Stories = new List<Story>();
StoryModel = new Story();
}
}
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