Fixes the blog post removal
This commit is contained in:
@ -245,6 +245,10 @@ namespace Yavsc.Controllers
|
||||
[Authorize]
|
||||
public ActionResult RemovePost (string user, string title, string returnUrl, bool confirm=false)
|
||||
{
|
||||
if (returnUrl == null)
|
||||
if (Request.UrlReferrer!=null)
|
||||
returnUrl = Request.UrlReferrer.AbsoluteUri;
|
||||
ViewData["returnUrl"]=returnUrl;
|
||||
if (!confirm)
|
||||
return View ("RemovePost");
|
||||
HttpStatusCodeResult res = BlogsApiController.RemovePost (user,title);
|
||||
|
@ -18,7 +18,7 @@
|
||||
if (Membership.GetUser().UserName==e.UserName)
|
||||
{ %>
|
||||
<%= Html.ActionLink("Editer","Edit", new { user = e.UserName, title = e.Title }, new { @class="actionlink" }) %>
|
||||
<%= Html.ActionLink("Supprimer","Remove", new { user = e.UserName, title = e.Title }, new { @class="actionlink" } ) %>
|
||||
<%= Html.ActionLink("Supprimer","RemovePost", new { user = e.UserName, title = e.Title }, new { @class="actionlink" } ) %>
|
||||
<% } %>
|
||||
|
||||
</div>
|
||||
|
@ -9,20 +9,22 @@
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
<form runat="server">
|
||||
|
||||
<%= Html.ValidationSummary() %>
|
||||
<% using (Html.BeginForm("Remove","Blogs")) { %>
|
||||
suivant :
|
||||
<%= Html.LabelFor(model => model.Title) %>:<br/>
|
||||
<% using (Html.BeginForm("RemovePost","Blogs")) { %>
|
||||
|
||||
<%= Html.LabelFor(model => model.Title) %> :
|
||||
<%= Html.TextBox( "Title" ) %>
|
||||
<%= Html.ValidationMessage("Title", "*") %>
|
||||
<%= Html.ValidationMessage("Title", "*") %><br/>
|
||||
|
||||
<label for="confirm">supprimer le billet</label>
|
||||
<input type="checkbox" name="confirm" />
|
||||
<%= Html.CheckBox( "confirm" ) %>
|
||||
<%= Html.ValidationMessage("AgreeToRemove", "*") %>
|
||||
|
||||
<%= Html.Hidden("returnUrl") %>
|
||||
<input type="submit"/>
|
||||
<% } %>
|
||||
</form>
|
||||
|
||||
</asp:Content>
|
||||
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
if (Membership.GetUser().UserName==Model.UserName)
|
||||
{ %>
|
||||
<%= Html.ActionLink("Editer","Edit", new { user=Model.UserName, title = Model.Title }, new { @class="actionlink" }) %>
|
||||
<%= Html.ActionLink("Supprimer","Remove", new { user=Model.UserName, title = Model.Title }, new { @class="actionlink" } ) %>
|
||||
<%= Html.ActionLink("Supprimer","RemovePost", new { user=Model.UserName, title = Model.Title }, new { @class="actionlink" } ) %>
|
||||
<% } %>
|
||||
</div>
|
||||
</asp:Content>
|
||||
|
@ -21,7 +21,7 @@
|
||||
if (Membership.GetUser().UserName==e.UserName)
|
||||
{ %>
|
||||
<%= Html.ActionLink("Editer","Edit", new { user = e.UserName, title = e.Title }, new { @class="actionlink" }) %>
|
||||
<%= Html.ActionLink("Supprimer","Remove", new { user = e.UserName, title = e.Title }, new { @class="actionlink" } ) %>
|
||||
<%= Html.ActionLink("Supprimer","RemovePost", new { user = e.UserName, title = e.Title }, new { @class="actionlink" } ) %>
|
||||
<% } %>
|
||||
</div>
|
||||
<% } %>
|
||||
|
Reference in New Issue
Block a user