Advertisement
Guest User

Untitled

a guest
Nov 19th, 2015
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 12.39 KB | None | 0 0
  1. @model IEnumerable<Multimedia.Domain.Entities.Link>
  2.     <style>
  3.         .noBull {
  4.             list-style-type: none;
  5.             padding-left: 0;
  6.         }
  7.     </style>
  8.  
  9.     <div class="row ">
  10.         <div class="large-12 columns">
  11.             @{ViewBag.Title = "List";
  12.             List<string> CategoryList = Model.Select(c => c.Category.Description.ToString()).Distinct().ToList();
  13.             List<int> categoryid = Model.Select(c => c.Category.Id).Distinct().ToList();
  14.             var catdictionary = categoryid.Zip(CategoryList, (k, v) => new { Key = k, Value = v }).ToDictionary(x => x.Key, x => x.Value);
  15.             Multimedia.Web.Models.AddEdit MModel = new Multimedia.Web.Models.AddEdit();
  16.             Layout = "~/Views/Shared/_UhaulNetMasterPage.cshtml";
  17.             }
  18.  
  19.             <script type="text/javascript" defer="defer">
  20.                 var updateCat = '@Url.Content("~/Admin/UpdateCategory")';
  21.             </script>
  22.             @{
  23.                 var guid = WebTeam.Packages.SystemMemberInfo.Current.PermanentGuid.ToString();
  24.                 WebTeam.Packages.SystemMemberInfo memberInfo = new WebTeam.Packages.SystemMemberInfo(guid, WebTeam.Packages.SystemMemberInfo.IDType.HRPermanentGuid);
  25.                 var isAdmin = Multimedia.Web.Managers.RoleManager.HasRole(memberInfo.PermanentGuid, memberInfo.JobGroup, memberInfo.EntityNumber);
  26.             }
  27.  
  28.             @if (isAdmin)
  29.             {
  30.                 <ul class="subnav">
  31.                     <li>@Html.ActionLink("Add Videos", "Add", "Admin")</li>
  32.                     <li>@Html.ActionLink("Show Inactive", "Inactive", "Admin")</li>
  33.                     <li class="last"><a href="#" id="showNewCatDiv">Add Category</a></li>
  34.                 </ul>
  35.  
  36.                 <div id="addcatdiv" class="custom form">
  37.  
  38.                     <h5>Create New Category</h5>
  39.  
  40.  
  41.                     <div class="row">
  42.                         <div class="large-12 columns">
  43.                             <label>
  44.                                 Category Name:<input type="text" name="test" id="ncatTxtbx" />
  45.                                 <small id="catError"></small>
  46.                             </label>
  47.                             <div class="loading">
  48.                                 <i class="fa fa-spinner fa-spin right fa-2x"></i>
  49.                             </div>
  50.                             <button id="newctBtn" class="button right" type="button">Submit</button>
  51.                             <button id="closeNewCat" class="button right cancel" type="reset">Cancel</button>
  52.                         </div>
  53.                     </div>
  54.                 </div>
  55.             }
  56.  
  57.             <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>
  58.  
  59.  
  60.  
  61.             <div class="category-section-container">
  62.                 <div class="row">
  63.                     <div id="mainCategoryList" class="medium-8 columns">
  64.                         <div class="row">
  65.                             @foreach (var category in MModel.MainCategoryList)
  66.                             {
  67.                                 IEnumerable<Multimedia.Domain.Entities.Link> categoryLinks = Model.OrderBy(i => i.PagePosition).Where(l => l.CategoryId == category.Id).Where(l => l.SubcategoryId == 0);
  68.                                 IEnumerable<Multimedia.Domain.Entities.Subcategory> subCategories = MModel.SubcategoryList.Where(s => s.parentCategoryId.Equals(category.Id));
  69.  
  70.                                 if (category.IsActive == 1)
  71.                                 {
  72.                                     <div class="category-container medium-6 columns @category.HtmlClasses">
  73.                                         <h3>@category.Description</h3>
  74.                                        
  75.                                         <ul>
  76.                                             @foreach (var link in categoryLinks)
  77.                                             {
  78.                                                 if (link.IsActive == 1)
  79.                                                 {
  80.                                                     <li class="noBull">
  81.                                                     @if (isAdmin && link.IsImage == 0)
  82.                                                    {
  83.                                                        <a href="@Url.Action("GetLinkInfo", "Admin", new { id = @link.Id })">
  84.                                                            <i class="fa fa-pencil-square-o" id="@link.Id" alt="Edit"></i>
  85.                                                        </a>
  86.                                                    }
  87.                                                    @Html.Raw(HttpUtility.HtmlDecode(@link.Html))    
  88.                                                    </li>
  89.                                                }
  90.                                            }
  91.                                        </ul>
  92.  
  93.                                        @foreach (var sub in subCategories)
  94.                                        {
  95.                                            if (sub.IsActive == 1)
  96.                                            {
  97.                                                IEnumerable<Multimedia.Domain.Entities.Link>
  98.                                                subcategoryLinks = Model.OrderBy(i => i.PagePosition).Where(l => l.SubcategoryId == sub.Id);
  99.                                                 <div class="subcategory-container">
  100.                                                     <h5>@sub.name</h5>
  101.                                                     <ul>
  102.                                                         @foreach (var link in subcategoryLinks)
  103.                                                         {
  104.                                                             if (link.IsActive == 1)
  105.                                                             {
  106.                                                                 <li class="noBull">
  107.                                                                 @if (isAdmin && link.IsImage == 0)
  108.                                                                {
  109.                                                                    <a href="@Url.Action("GetLinkInfo", "Admin", new { id = @link.Id })">
  110.                                                                        <i class="fa fa-pencil-square-o" id="@link.Id" alt="Edit"></i>
  111.                                                                    </a>
  112.                                                                }
  113.                                                                @Html.Raw(HttpUtility.HtmlDecode(@link.Html))    
  114.                                                                </li>
  115.                                                            }
  116.                                                        }
  117.                                                    </ul>
  118.                                                </div>
  119.                                            }
  120.                                        }        
  121.                                    </div>
  122.                                }
  123.                                else
  124.                                {
  125.                                    //We are not an active category
  126.                                }
  127.                            }
  128.                        </div>
  129.                    </div>
  130.                    <div id="sideCategoryList" class="medium-offset-1 medium-3 columns">
  131.                        <div class="row">
  132.                            @foreach (var category in MModel.SideCategoryList)
  133.                            {
  134.                                IEnumerable<Multimedia.Domain.Entities.Link> categoryLinks = Model.OrderBy(i => i.PagePosition).Where(l => l.CategoryId == category.Id).Where(l => l.SubcategoryId == 0);
  135.                                 IEnumerable<Multimedia.Domain.Entities.Subcategory> subCategories = MModel.SubcategoryList.Where(s => s.parentCategoryId.Equals(category.Id));
  136.  
  137.                                 if (category.IsActive == 1)
  138.                                 {
  139.                                     <div class="category-container medium-12 columns @category.HtmlClasses">
  140.                                         <h3>@category.Description</h3>
  141.  
  142.  
  143.                                         <ul>
  144.                                             @foreach (var link in categoryLinks)
  145.                                             {
  146.                                                 if (link.IsActive == 1)
  147.                                                 {
  148.                                                     <li class="noBull">
  149.                                                        @if (isAdmin && link.IsImage == 0)
  150.                                                       {
  151.                                                            <a href="@Url.Action("GetLinkInfo", "Admin", new { id = @link.Id })">
  152.                                                                <i class="fa fa-pencil-square-o" id="@link.Id" alt="Edit"></i>
  153.                                                            </a>
  154.                                                       }
  155.                                                        @Html.Raw(HttpUtility.HtmlDecode(@link.Html))
  156.                                                    </li>
  157.                                                }
  158.                                            }
  159.                                        </ul>
  160.  
  161.                                        @foreach (var sub in subCategories)
  162.                                        {
  163.  
  164.                                            if (sub.IsActive == 1)
  165.                                            {
  166.                                                IEnumerable<Multimedia.Domain.Entities.Link>
  167.                                                subcategoryLinks = Model.OrderBy(i => i.PagePosition).Where(l => l.SubcategoryId == sub.Id);
  168.                                                 <div class="subcategory-container">
  169.                                                     <h5>@sub.name</h5>
  170.                                                     <ul>
  171.                                                         @foreach (var link in subcategoryLinks)
  172.                                                         {
  173.                                                             if (link.IsActive == 1)
  174.                                                             {
  175.                                                                 <li class="noBull">
  176.                                                                     @if (isAdmin && link.IsImage == 0)
  177.                                                                    {
  178.                                                                        <a href="@Url.Action("GetLinkInfo", "Admin", new { id = @link.Id })">
  179.                                                                            <i class="fa fa-pencil-square-o" id="@link.Id" alt="Edit"></i>
  180.                                                                        </a>
  181.                                                                    }
  182.                                                                    @Html.Raw(HttpUtility.HtmlDecode(@link.Html))
  183.                                                                </li>
  184.                                                            }
  185.                                                        }
  186.                                                    </ul>
  187.                                                </div>
  188.                                            }
  189.                                        }
  190.                                    </div>
  191.                                    }
  192.                                    else
  193.                                    {
  194.                                        //We are not an active category
  195.                                    }
  196.                                }
  197.                        </div>
  198.                    </div>
  199.                </div>
  200.              
  201.            </div>
  202.  
  203.        </div>
  204.  
  205.    </div>
  206.  
  207.  
  208. @section Scripts{
  209.    <script type="text/javascript" src="@Url.Content("~/Scripts/MultiAdmin.js")"></script>
  210.    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")"></script>
  211. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement