mirror of
https://github.com/lempamo/Project-Unite.git
synced 2025-01-22 17:22:15 +00:00
Add wiki category view
This commit is contained in:
parent
687d62912c
commit
34d659efbc
3 changed files with 40 additions and 1 deletions
|
@ -146,6 +146,8 @@ public ActionResult AddWikiCategory()
|
|||
if (!ACL.Granted(User.Identity.Name, "CanAccessDevCP"))
|
||||
return new HttpStatusCodeResult(403);
|
||||
|
||||
ViewBag.Developer = true;
|
||||
|
||||
var mdl = new AddWikiCategoryViewModel();
|
||||
return View(mdl);
|
||||
|
||||
|
@ -157,7 +159,7 @@ public ActionResult AddWikiCategory(AddWikiCategoryViewModel model)
|
|||
{
|
||||
if (!ACL.Granted(User.Identity.Name, "CanAccessDevCP"))
|
||||
return new HttpStatusCodeResult(403);
|
||||
|
||||
ViewBag.Developer = true;
|
||||
if (!ModelState.IsValid)
|
||||
return View(model);
|
||||
|
||||
|
|
|
@ -544,6 +544,7 @@
|
|||
<Content Include="Views\Download\ViewRelease.cshtml" />
|
||||
<Content Include="Views\Home\Discord.cshtml" />
|
||||
<Content Include="Views\Developer\Wiki.cshtml" />
|
||||
<Content Include="Views\Developer\AddWikiCategory.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
|
|
36
Project-Unite/Views/Developer/AddWikiCategory.cshtml
Normal file
36
Project-Unite/Views/Developer/AddWikiCategory.cshtml
Normal file
|
@ -0,0 +1,36 @@
|
|||
@model Project_Unite.Models.AddWikiCategoryViewModel
|
||||
@{
|
||||
ViewBag.Title = "Add wiki category";
|
||||
}
|
||||
|
||||
<h2>Add wiki category</h2>
|
||||
|
||||
<p>Please fill the form to add a new category.</p>
|
||||
|
||||
@using (Html.BeginForm())
|
||||
{
|
||||
<div class="panel panel-danger">
|
||||
<div class="panel-body">
|
||||
@Html.ValidationSummary()
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td>Category name:</td>
|
||||
<td>
|
||||
@Html.TextBoxFor(Model=>Model.Name, new { @class="form-control"})
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Parent category:</td>
|
||||
<td>
|
||||
@Html.DropDownListFor(Model => Model.ParentId, Model.Parents, new { @class = "form-control" })
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="submit" value="Add!" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
}
|
Loading…
Reference in a new issue