vgquotes/Src/VideoGameQuotes.Web/Views/Quote/EditQuoteForm.ascx
tmont b45c82e5fa * quote editing, although not quite finished
* flag dismissal
* fixed some mapping issues by adding inverse="true" to some one-to-many relationships
2011-02-19 09:41:09 +00:00

139 lines
4.1 KiB
Plaintext

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<VideoGameQuotes.Web.Models.EditQuoteModel>" %>
<%@ Import Namespace="Portoa.Web.Util" %>
<div id="edit-quote-form">
<% using (Html.BeginForm(Model.ActionName, Model.ControllerName)) { %>
<%= Html.HiddenFor(model => model.QuoteId, new { id = "quote-id" })%>
<p>
<span id="game-select">
<%= Html.Label("Game", "GameId") %>
<br />
<%= Html.DropDownListFor(model => model.GameId, Model.GetGameList()) %>
</span>
<a href="#" id="create-game-link">Create new game</a>
</p>
<div id="create-game-form">
<fieldset>
<legend>Create new game</legend>
<p>
<%= Html.LabelFor(model => model.GameName) %>
<br />
<%= Html.TextBoxFor(model => model.GameName) %>
</p>
<p>
<%= Html.LabelFor(model => model.GameWebsite) %> <small>(link to Wikipedia page or something)</small>
<br />
<%= Html.TextBoxFor(model => model.GameWebsite) %>
</p>
<p>
<%= Html.LabelFor(model => model.GameRegions) %>
<br />
<%= Model.MakeRegionTable() %>
</p>
<p>
<span id="system-select">
<%= Html.LabelFor(model => model.SystemIds) %>
<br />
<%= Model.MakeSystemTable(Html) %>
</span>
<a href="#" id="create-system-link">Create new system</a>
</p>
<div id="create-system-form">
<fieldset>
<legend>Create new system</legend>
<p>
<%= Html.LabelFor(model => model.SystemName) %>
<br />
<%= Html.TextBoxFor(model => model.SystemName) %>
</p>
<p>
<%= Html.LabelFor(model => model.SystemAbbreviation) %>
<br />
<%= Html.TextBoxFor(model => model.SystemAbbreviation) %>
</p>
<p>
<%= Html.LabelFor(model => model.SystemReleaseDate) %>
<br />
<%= Html.TextBox("SystemReleaseDate", DateTime.UtcNow.ToString("yyyy-MM-dd")) %>
</p>
</fieldset>
</div>
<p>
<span id="publisher-select">
<%= Html.LabelFor(model => model.PublisherIds) %>
<br />
<%= Model.MakePublisherTable(Html) %>
</span>
<a href="#" id="create-publisher-link">Create new publisher</a>
</p>
<div id="create-publisher-form">
<fieldset>
<legend>Create new publisher</legend>
<p>
<%= Html.LabelFor(model => model.PublisherName) %>
<br />
<%= Html.TextBoxFor(model => model.PublisherName) %>
</p>
<p>
<%= Html.LabelFor(model => model.PublisherWebsite) %>
<br />
<%= Html.TextBoxFor(model => model.PublisherWebsite) %>
</p>
</fieldset>
</div>
</fieldset>
</div>
<p>
<%= Html.LabelFor(model => model.QuoteText) %>
<br />
<%= Html.TextAreaFor(model => model.QuoteText) %>
</p>
<div>
<p>
<%= Html.LabelFor(model => model.CategoryIds) %>
</p>
<%= Model.MakeCategoryTable(Html) %>
<a href="#" id="create-category-link">Create new category</a>
</div>
<% if (Model.QuoteId > 0) { %>
<div id="quote-flags-container">
<% foreach (var flag in Model.Flags) { %>
<div class="quote-flag">
<input type="hidden" class="quote-flag-id" value="<%= flag.Id %>" />
<p>
Flagged as <strong><%: flag.Type %></strong> on <em><%= flag.Created %></em> by
<strong><%: flag.User.Username ?? flag.User.IpAddress %></strong>.
</p>
<p><%: flag.Comment %></p>
<p><a href="#" class="dismiss-flag-link">dismiss</a></p>
</div>
<% } %>
</div>
<% } %>
<hr />
<%= Html.Submit(Model.QuoteId > 0 ? "Save" : "Submit Quote") %>
<% } %>
</div>