vgquotes/Src/VideoGameQuotes.Web/Views/Quote/EditQuoteForm.ascx

181 lines
6.9 KiB
Plaintext
Raw Normal View History

2011-02-28 10:34:46 +00:00
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<VideoGameQuotes.Web.Models.EditQuoteModelBase>" %>
<%@ Import Namespace="Portoa.Web.Util" %>
<%@ Import Namespace="VideoGameQuotes.Api" %>
2011-02-28 10:34:46 +00:00
<%@ Import Namespace="VideoGameQuotes.Web.Models" %>
<div id="edit-quote-form">
<% using (Html.BeginForm(Model.ActionName, Model.ControllerName)) { %>
<p id="game-select">
<%= Html.LabelFor(model => model.GameId, new { @class = "label" })%>
<br />
<%= Html.DropDownListFor(model => model.GameId, Model.GetGameList()) %>
<a href="#" id="create-game-link" class="add-icon" title="create new game"></a>
<% if (Model.CurrentUser != null && Model.CurrentUser.Group >= UserGroup.Admin) { %>
<a href="#" id="edit-game-link" class="edit-icon" title="edit currently selected game"></a>
<a href="#" id="delete-game-link" class="delete-icon" title="delete currently selected game"></a>
<% } %>
</p>
<div id="create-game-form" class="subform">
<input type="hidden" value="0" class="edit-mode" />
2011-02-23 21:53:51 +00:00
<input type="hidden" value="0" id="SystemId" />
<fieldset>
<legend>Create new game</legend>
2011-02-24 20:28:35 +00:00
<p class="error-summary"></p>
<p>
<%= Html.Label("Name", "GameName", new { @class = "label" })%>
<br />
<%= Html.TextBox("GameName") %>
</p>
<p>
<%= Html.Label("Website", "GameWebsite", new { @class = "label" })%> <small>(link to Wikipedia page or something)</small>
<br />
<%= Html.TextBox("GameWebsite") %>
</p>
2011-02-24 10:55:08 +00:00
<% if (Model.CurrentUser != null && Model.CurrentUser.Group >= UserGroup.Admin) { %>
<p>
<%= Html.Label("Icon", "GameIcon", new { @class = "label" })%>
<br />
<%= Html.TextBox("GameIcon") %>
</p>
<% } %>
2011-02-24 20:28:35 +00:00
<p><span id="GameRegions" class="label">Regions</span></p>
<%= Model.MakeRegionTable() %>
<div id="system-select">
2011-02-24 20:28:35 +00:00
<p><span id="SystemIds" class="label">Systems</span></p>
<%= Model.MakeSystemTable(Html) %>
<p><a href="#" id="create-system-link" class="add-icon" title="create new system"></a></p>
</div>
<div id="create-system-form" class="subform">
<input type="hidden" value="0" class="edit-mode" />
<fieldset>
<legend>Create new system</legend>
2011-02-24 21:00:22 +00:00
<p class="error-summary"></p>
<p>
<%= Html.Label("Name", "SystemName", new { @class = "label" })%>
<br />
<%= Html.TextBox("SystemName") %>
</p>
<p>
<%= Html.Label("Abbreviation", "SystemAbbreviation", new { @class = "label" })%>
<br />
<%= Html.TextBox("SystemAbbreviation")%>
</p>
<p>
<%= Html.Label("Release Date", "SystemReleaseDate", new { @class = "label" })%>
<br />
2011-02-27 08:47:16 +00:00
<%= Html.TextBox("SystemReleaseDate") %>
</p>
2011-02-27 08:47:16 +00:00
<% if (Model.CurrentUser != null && Model.CurrentUser.Group >= UserGroup.Admin) { %>
<p>
<%= Html.Label("Icon", "SystemIcon", new { @class = "label" })%>
<br />
<%= Html.TextBox("SystemIcon")%>
</p>
<% } %>
2011-02-24 21:00:22 +00:00
<p>
<a href="#" class="button-link" id="create-system-submit" title="save system"><span class="submit-icon"></span>Save System</a>
<a href="#" class="button-link" id="create-system-cancel" title="cancel"><span class="cancel-icon"></span>Cancel</a>
2011-02-24 21:00:22 +00:00
</p>
</fieldset>
</div>
<div id="publisher-select">
2011-02-24 20:28:35 +00:00
<p><span class="label">Publishers</span></p>
<%= Model.MakePublisherTable(Html) %>
<p><a href="#" id="create-publisher-link" class="add-icon" title="create new publisher"></a></p>
</div>
<div id="create-publisher-form" class="subform">
<input type="hidden" value="0" class="edit-mode" />
<fieldset>
<legend>Create new publisher</legend>
2011-02-24 21:00:22 +00:00
<p class="error-summary"></p>
<p>
<%= Html.Label("Name", "PublisherName", new { @class = "label" })%>
<br />
<%= Html.TextBox("PublisherName") %>
</p>
<p>
<%= Html.Label("Website", "PublisherWebsite", new { @class = "label" }) %>
<br />
<%= Html.TextBox("PublisherWebsite") %>
</p>
2011-02-24 22:50:37 +00:00
<p>
<a href="#" class="button-link" id="create-publisher-submit" title="save publisher"><span class="submit-icon"></span>Save Publisher</a>
<a href="#" class="button-link" id="create-publisher-cancel" title="cancel"><span class="cancel-icon"></span>Cancel</a>
2011-02-24 22:50:37 +00:00
</p>
</fieldset>
</div>
2011-02-24 21:00:22 +00:00
<p>
<a href="#" class="button-link" id="create-game-submit" title="save game"><span class="submit-icon"></span>Save Game</a>
<a href="#" class="button-link" id="create-game-cancel" title="cancel"><span class="cancel-icon"></span>Cancel</a>
2011-02-24 21:00:22 +00:00
</p>
</fieldset>
</div>
<p>
<%= Html.LabelFor(model => model.QuoteText, new { @class = "label" })%>
<br />
<%= Html.TextAreaFor(model => model.QuoteText) %>
</p>
<div>
2011-02-24 20:28:35 +00:00
<p><span class="label">Categories</span></p>
<%= Model.MakeCategoryTable(Html) %>
<p><a href="#" id="create-category-link" class="add-icon" title="create new category"></a></p>
</div>
2011-02-28 10:34:46 +00:00
<% var editModel = Model as EditQuoteModel; if (editModel != null && editModel.QuoteId > 0) { %>
<%= Html.Hidden("QuoteId", editModel.QuoteId, new { id = "quote-id" })%>
<div id="quote-flags-container">
2011-02-28 10:34:46 +00:00
<% foreach (var flag in editModel.Flags) { %>
<div class="quote-flag">
<input type="hidden" class="quote-flag-id" value="<%= flag.Id %>" />
<p>
2011-02-28 10:34:46 +00:00
Flagged as <strong><%: flag.Type%></strong> on <em><%= flag.Created%></em> by
<strong><%: flag.User.Username ?? flag.User.IpAddress%></strong>.
</p>
2011-02-28 10:34:46 +00:00
<p><%: flag.Comment%></p>
<p><a href="#" class="dismiss-flag-link">dismiss</a></p>
</div>
<% } %>
</div>
<% } %>
<hr />
2011-02-28 10:34:46 +00:00
<% var submitModel = Model as SubmitQuoteModel; if (submitModel != null) { %>
<input type="hidden" name="HashedCaptchaAnswer" id="HashedCaptchaAnswer" value="<%: submitModel.HashedCaptchaAnswer %>" />
<p>
Are you human? <small style="position: relative"><a href="#" id="captcha-question">[click for correct answer]</a></small>
<br />
<input type="text" name="CaptchaAnswer" id="CaptchaAnswer" value="" />
</p>
<% } %>
<p><%= Html.Submit(editModel != null && editModel.QuoteId > 0 ? "Save" : "Submit Quote") %></p>
<% } %>
</div>