mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-07-15 21:43:27 +08:00
Changing Themes activate and uninstall actions to POST
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4045458
This commit is contained in:
parent
341d2fa817
commit
ba82badc6c
@ -37,6 +37,7 @@ namespace Orchard.Core.Themes.Controllers {
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult Activate(string themeName) {
|
||||
try {
|
||||
if (!_authorizer.Authorize(Permissions.SetSiteTheme, T("Couldn't set the current theme")))
|
||||
@ -54,7 +55,7 @@ namespace Orchard.Core.Themes.Controllers {
|
||||
return View(new AdminViewModel());
|
||||
}
|
||||
|
||||
[AcceptVerbs(HttpVerbs.Post)]
|
||||
[HttpPost]
|
||||
public ActionResult Install(FormCollection input) {
|
||||
try {
|
||||
if (!_authorizer.Authorize(Permissions.InstallUninstallTheme, T("Couldn't install theme")))
|
||||
@ -71,6 +72,7 @@ namespace Orchard.Core.Themes.Controllers {
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult Uninstall(string themeName) {
|
||||
try {
|
||||
if (!_authorizer.Authorize(Permissions.InstallUninstallTheme, T("Couldn't uninstall theme")))
|
||||
|
@ -29,9 +29,20 @@
|
||||
<%=_Encoded("By") %> <%=Html.Encode(theme.Author) %><br />
|
||||
<%=Html.Encode(theme.Version) %><br />
|
||||
<%=Html.Encode(theme.Description) %><br />
|
||||
<%=Html.Encode(theme.HomePage) %><br />
|
||||
<%=Html.ActionLink(T("Activate").ToString(), "Activate", new {themeName = theme.ThemeName}) %> | <%=Html.ActionLink(T("Uninstall").ToString(), "Uninstall", new {themeName = theme.ThemeName}) %>
|
||||
<%=Html.Encode(theme.HomePage) %>
|
||||
</p>
|
||||
<div>
|
||||
<% using(Html.BeginFormAntiForgeryPost(Url.Action("Activate"), FormMethod.Post, new { @class = "inline" })) { %>
|
||||
<fieldset>
|
||||
<button type="submit" title="<%=_Encoded("Activate") %>" name="themeName" value="<%=theme.ThemeName %>"><%=_Encoded("Activate") %></button>
|
||||
</fieldset>
|
||||
<% } %>
|
||||
<% using(Html.BeginFormAntiForgeryPost(Url.Action("Uninstall"), FormMethod.Post, new { @class = "inline" })) { %>
|
||||
<fieldset>
|
||||
<button type="submit" class="remove" title="<%=_Encoded("Uninstall") %>" name="themeName" value="<%=theme.ThemeName %>"><%=_Encoded("Uninstall")%></button>
|
||||
</fieldset>
|
||||
<% } %>
|
||||
</div>
|
||||
</li>
|
||||
<% }
|
||||
} %>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<li class="destruct">
|
||||
<% using (Html.BeginFormAntiForgeryPost(Url.BlogDelete(Model.Item.Slug), FormMethod.Post, new { @class = "inline" })) { %>
|
||||
<fieldset>
|
||||
<button type="submit" src="<%=Html.ThemePath("/styles/images/remove.png") %>" class="ibutton remove" title="<%=_Encoded("Remove Blog") %>"><%=_Encoded("Remove Blog") %></button>
|
||||
<button type="submit" class="ibutton remove" title="<%=_Encoded("Remove Blog") %>"><%=_Encoded("Remove Blog") %></button>
|
||||
</fieldset><%
|
||||
} %>
|
||||
</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
<%-- todo: (heskew) this is waaaaa too verbose. need template helpers for all ibuttons --%>
|
||||
<% using (Html.BeginFormAntiForgeryPost(Url.BlogDelete(Model.Item.Slug), FormMethod.Post, new { @class = "inline" })) { %>
|
||||
<fieldset>
|
||||
<button type="submit" src="<%=Html.ThemePath("/styles/images/remove.png") %>" class="ibutton remove" title="<%=_Encoded("Remove Blog") %>"><%=_Encoded("Remove Blog") %></button>
|
||||
<button type="submit" class="ibutton remove" title="<%=_Encoded("Remove Blog") %>"><%=_Encoded("Remove Blog") %></button>
|
||||
</fieldset><%
|
||||
} %>
|
||||
</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
<li class="destruct">
|
||||
<% using (Html.BeginFormAntiForgeryPost(Url.BlogPostDelete(Model.Item.Blog.Slug, Model.Item.Slug), FormMethod.Post, new { @class = "inline" })) { %>
|
||||
<fieldset>
|
||||
<button type="submit" src="<%=Html.ThemePath("/styles/images/remove.png") %>" class="ibutton remove" title="<%=_Encoded("Remove Post") %>"><%=_Encoded("Remove Post") %></button>
|
||||
<button type="submit" class="ibutton remove" title="<%=_Encoded("Remove Post") %>"><%=_Encoded("Remove Post") %></button>
|
||||
</fieldset><%
|
||||
} %>
|
||||
</li>
|
||||
|
@ -343,6 +343,9 @@ span.message {
|
||||
|
||||
/* Forms
|
||||
----------------------------------------------------------*/
|
||||
form.inline, form.inline fieldset { /* todo: (heskew) need something other than .inline ... */
|
||||
display:inline;
|
||||
}
|
||||
form.inline fieldset {
|
||||
margin:0;
|
||||
}
|
||||
@ -658,6 +661,11 @@ todo: (heskew) pull out into relevant modules where appropriate
|
||||
|
||||
/* Pages
|
||||
----------------------------------------------------------*/
|
||||
.templates li {
|
||||
border-bottom:1px dashed #e4e7dc;
|
||||
margin-bottom:2em;
|
||||
padding-bottom:2em;
|
||||
}
|
||||
.templates fieldset {
|
||||
margin:0 0 .933%;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user