* 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...?
|
//these routes don't work with constraints in mono...?
|
||||||
routes.MapSmartRoute("quote-edit", "quote/edit/{id}", new { controller = "Quote", action = "Edit" });
|
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-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("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" });
|
routes.MapSmartRoute("default", "", new { controller = "Home", action = "Index" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,8 +146,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% var editModel = Model as EditQuoteModel; if (editModel != null && editModel.QuoteId > 0) { %>
|
<% 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">
|
<div id="quote-flags-container">
|
||||||
|
<%= Html.Hidden("QuoteId", editModel.QuoteId, new { id = "quote-id" })%>
|
||||||
<% foreach (var flag in editModel.Flags) { %>
|
<% foreach (var flag in editModel.Flags) { %>
|
||||||
<div class="quote-flag">
|
<div class="quote-flag">
|
||||||
<input type="hidden" class="quote-flag-id" value="<%= flag.Id %>" />
|
<input type="hidden" class="quote-flag-id" value="<%= flag.Id %>" />
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
<asp:Content runat="server" ID="Main" ContentPlaceHolderID="MainContent">
|
<asp:Content runat="server" ID="Main" ContentPlaceHolderID="MainContent">
|
||||||
<p>
|
<p>
|
||||||
It appears you’re trying to look at some video game quotes. Unfortunately, we don’t have any.
|
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>
|
</p>
|
||||||
</asp:Content>
|
</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 flagId = $container.find(".quote-flag-id").val();
|
||||||
var quoteId = $("#quote-id").val();
|
var quoteId = $("#quote-id").val();
|
||||||
|
|
||||||
$.ajax("/dismiss-flag", {
|
$.ajax("/quote/dismiss-flag", {
|
||||||
type: "POST",
|
type: "POST",
|
||||||
data: { quoteId: quoteId, flagId : flagId },
|
data: { quoteId: quoteId, flagId : flagId },
|
||||||
success: function(data, status, $xhr) {
|
success: function(data, status, $xhr) {
|
||||||
|
Loading…
Reference in New Issue
Block a user