Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @model IEnumerable<Multimedia.Domain.Entities.Link>
- <style>
- .noBull {
- list-style-type: none;
- padding-left: 0;
- }
- </style>
- <div class="row ">
- <div class="large-12 columns">
- @{ViewBag.Title = "List";
- List<string> CategoryList = Model.Select(c => c.Category.Description.ToString()).Distinct().ToList();
- List<int> categoryid = Model.Select(c => c.Category.Id).Distinct().ToList();
- var catdictionary = categoryid.Zip(CategoryList, (k, v) => new { Key = k, Value = v }).ToDictionary(x => x.Key, x => x.Value);
- Multimedia.Web.Models.AddEdit MModel = new Multimedia.Web.Models.AddEdit();
- Layout = "~/Views/Shared/_UhaulNetMasterPage.cshtml";
- }
- <script type="text/javascript" defer="defer">
- var updateCat = '@Url.Content("~/Admin/UpdateCategory")';
- </script>
- @{
- var guid = WebTeam.Packages.SystemMemberInfo.Current.PermanentGuid.ToString();
- WebTeam.Packages.SystemMemberInfo memberInfo = new WebTeam.Packages.SystemMemberInfo(guid, WebTeam.Packages.SystemMemberInfo.IDType.HRPermanentGuid);
- var isAdmin = Multimedia.Web.Managers.RoleManager.HasRole(memberInfo.PermanentGuid, memberInfo.JobGroup, memberInfo.EntityNumber);
- }
- @if (isAdmin)
- {
- <ul class="subnav">
- <li>@Html.ActionLink("Add Videos", "Add", "Admin")</li>
- <li>@Html.ActionLink("Show Inactive", "Inactive", "Admin")</li>
- <li class="last"><a href="#" id="showNewCatDiv">Add Category</a></li>
- </ul>
- <div id="addcatdiv" class="custom form">
- <h5>Create New Category</h5>
- <div class="row">
- <div class="large-12 columns">
- <label>
- Category Name:<input type="text" name="test" id="ncatTxtbx" />
- <small id="catError"></small>
- </label>
- <div class="loading">
- <i class="fa fa-spinner fa-spin right fa-2x"></i>
- </div>
- <button id="newctBtn" class="button right" type="button">Submit</button>
- <button id="closeNewCat" class="button right cancel" type="reset">Cancel</button>
- </div>
- </div>
- </div>
- }
- <p class="">In order to properly view the movies you must have <a href="/tools/software/">Quicktime 5 or higher</a>. Feel free to give us <a href="/contact/feedback_form.aspx">feedback</a> on what you would like to see in the future.</p>
- <div class="category-section-container">
- <div class="row">
- <div id="mainCategoryList" class="medium-8 columns">
- <div class="row">
- @foreach (var category in MModel.MainCategoryList)
- {
- IEnumerable<Multimedia.Domain.Entities.Link> categoryLinks = Model.OrderBy(i => i.PagePosition).Where(l => l.CategoryId == category.Id).Where(l => l.SubcategoryId == 0);
- IEnumerable<Multimedia.Domain.Entities.Subcategory> subCategories = MModel.SubcategoryList.Where(s => s.parentCategoryId.Equals(category.Id));
- if (category.IsActive == 1)
- {
- <div class="category-container medium-6 columns @category.HtmlClasses">
- <h3>@category.Description</h3>
- <ul>
- @foreach (var link in categoryLinks)
- {
- if (link.IsActive == 1)
- {
- <li class="noBull">
- @if (isAdmin && link.IsImage == 0)
- {
- <a href="@Url.Action("GetLinkInfo", "Admin", new { id = @link.Id })">
- <i class="fa fa-pencil-square-o" id="@link.Id" alt="Edit"></i>
- </a>
- }
- @Html.Raw(HttpUtility.HtmlDecode(@link.Html))
- </li>
- }
- }
- </ul>
- @foreach (var sub in subCategories)
- {
- if (sub.IsActive == 1)
- {
- IEnumerable<Multimedia.Domain.Entities.Link>
- subcategoryLinks = Model.OrderBy(i => i.PagePosition).Where(l => l.SubcategoryId == sub.Id);
- <div class="subcategory-container">
- <h5>@sub.name</h5>
- <ul>
- @foreach (var link in subcategoryLinks)
- {
- if (link.IsActive == 1)
- {
- <li class="noBull">
- @if (isAdmin && link.IsImage == 0)
- {
- <a href="@Url.Action("GetLinkInfo", "Admin", new { id = @link.Id })">
- <i class="fa fa-pencil-square-o" id="@link.Id" alt="Edit"></i>
- </a>
- }
- @Html.Raw(HttpUtility.HtmlDecode(@link.Html))
- </li>
- }
- }
- </ul>
- </div>
- }
- }
- </div>
- }
- else
- {
- //We are not an active category
- }
- }
- </div>
- </div>
- <div id="sideCategoryList" class="medium-offset-1 medium-3 columns">
- <div class="row">
- @foreach (var category in MModel.SideCategoryList)
- {
- IEnumerable<Multimedia.Domain.Entities.Link> categoryLinks = Model.OrderBy(i => i.PagePosition).Where(l => l.CategoryId == category.Id).Where(l => l.SubcategoryId == 0);
- IEnumerable<Multimedia.Domain.Entities.Subcategory> subCategories = MModel.SubcategoryList.Where(s => s.parentCategoryId.Equals(category.Id));
- if (category.IsActive == 1)
- {
- <div class="category-container medium-12 columns @category.HtmlClasses">
- <h3>@category.Description</h3>
- <ul>
- @foreach (var link in categoryLinks)
- {
- if (link.IsActive == 1)
- {
- <li class="noBull">
- @if (isAdmin && link.IsImage == 0)
- {
- <a href="@Url.Action("GetLinkInfo", "Admin", new { id = @link.Id })">
- <i class="fa fa-pencil-square-o" id="@link.Id" alt="Edit"></i>
- </a>
- }
- @Html.Raw(HttpUtility.HtmlDecode(@link.Html))
- </li>
- }
- }
- </ul>
- @foreach (var sub in subCategories)
- {
- if (sub.IsActive == 1)
- {
- IEnumerable<Multimedia.Domain.Entities.Link>
- subcategoryLinks = Model.OrderBy(i => i.PagePosition).Where(l => l.SubcategoryId == sub.Id);
- <div class="subcategory-container">
- <h5>@sub.name</h5>
- <ul>
- @foreach (var link in subcategoryLinks)
- {
- if (link.IsActive == 1)
- {
- <li class="noBull">
- @if (isAdmin && link.IsImage == 0)
- {
- <a href="@Url.Action("GetLinkInfo", "Admin", new { id = @link.Id })">
- <i class="fa fa-pencil-square-o" id="@link.Id" alt="Edit"></i>
- </a>
- }
- @Html.Raw(HttpUtility.HtmlDecode(@link.Html))
- </li>
- }
- }
- </ul>
- </div>
- }
- }
- </div>
- }
- else
- {
- //We are not an active category
- }
- }
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- @section Scripts{
- <script type="text/javascript" src="@Url.Content("~/Scripts/MultiAdmin.js")"></script>
- <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")"></script>
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement