* fixed validation error in EditQuoteForm
* dismissing a flag now works
This commit is contained in:
parent
ed868b244c
commit
b04f474605
@ -77,9 +77,10 @@ namespace VideoGameQuotes.Web {
|
||||
//these routes don't work with constraints in mono...?
|
||||
routes.MapSmartRoute("quote-edit", "quote/edit/{id}", new { controller = "Quote", action = "Edit" });
|
||||
routes.MapSmartRoute("quote-delete", "quote/delete", new { controller = "Quote", action = "Delete" });
|
||||
routes.MapSmartRoute("quote-dismiss-flag", "quote/dismiss-flag", new { controller = "Quote", action = "DismissFlag" });
|
||||
routes.MapSmartRoute("single-quote", "quote/{id}/{*text}", new { controller = "Quote", action = "Quote" });
|
||||
|
||||
routes.MapSmartRoute("dismiss-flag", "dismiss-flag", new { controller = "Quote", action = "DismissFlag" });
|
||||
//routes.MapSmartRoute("dismiss-flag", "dismiss-flag", new { controller = "Quote", action = "FooBar" });
|
||||
routes.MapSmartRoute("default", "", new { controller = "Home", action = "Index" });
|
||||
}
|
||||
}
|
||||
|
@ -146,8 +146,9 @@
|
||||
</div>
|
||||
|
||||
<% 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">
|
||||
<%= Html.Hidden("QuoteId", editModel.QuoteId, new { id = "quote-id" })%>
|
||||
<% foreach (var flag in editModel.Flags) { %>
|
||||
<div class="quote-flag">
|
||||
<input type="hidden" class="quote-flag-id" value="<%= flag.Id %>" />
|
||||
|
@ -3,6 +3,6 @@
|
||||
<asp:Content runat="server" ID="Main" ContentPlaceHolderID="MainContent">
|
||||
<p>
|
||||
It appears you’re trying to look at some video game quotes. Unfortunately, we don’t have any.
|
||||
You can fix that by <%= Html.ActionLink("adding some", "Submit", "Quote") %>.
|
||||
You can fix that by <%= Html.ActionLink("adding some", "submit", "Quote") %>.
|
||||
</p>
|
||||
</asp:Content>
|
File diff suppressed because one or more lines are too long
@ -516,7 +516,7 @@
|
||||
var flagId = $container.find(".quote-flag-id").val();
|
||||
var quoteId = $("#quote-id").val();
|
||||
|
||||
$.ajax("/dismiss-flag", {
|
||||
$.ajax("/quote/dismiss-flag", {
|
||||
type: "POST",
|
||||
data: { quoteId: quoteId, flagId : flagId },
|
||||
success: function(data, status, $xhr) {
|
||||
|
Loading…
Reference in New Issue
Block a user