İç Sayfa (Anto Tarım)

Kategori

@inherits System.Web.Mvc.WebViewPage<IEnumerable<Discus.Models.Post>>
@using System.Web.Helpers;
@using System.Web.Mvc;
@using Discus.Models;
@using Discus.Controllers;
@{
    string lang = ViewBag.LanguageShortName;
    Category category = ViewBag.Category as Category;

    int ustID = category.RefCategoryID ?? 0;
    Category ustCategory = Partial.Category(ustID);

    int Categorysay = Partial.CategorySubID(category.CategoryID).Count();
    int Postsay = ViewData.Model.Count();

    DateTime sontarih = DateTime.Now;
    foreach (Post tarih in ViewData.Model.OrderByDescending(m => m.PostUpdateDate).Skip(0).Take(1))
    {
        sontarih = tarih.PostUpdateDate;
    }

    string duvardakiresmine = "";

    if (!String.IsNullOrEmpty(category.CategoryImage))
    {
        duvardakiresmine = category.CategoryImage;
    }
    else if (ustCategory != null && !String.IsNullOrEmpty(ustCategory.CategoryImage))

    {
        duvardakiresmine = ustCategory.CategoryImage;
    }
    else
    {
        duvardakiresmine = "/Upload/File/placeholder.jpg";
    }
}

<div class="baslikicin" style="background-image: url('/Resim/Upload/header-bg.jpg');">
    <div class="tablolastir makaleplace">
        <div class="hucrelestir" style="background-color:#faed25;padding-left:0px !important;">
            
            <span class="baslikarka" style="display:inline-block;background:url('http://demo7.karayeltasarim.com/Upload/File/2020/2/26/h1-bg.jpg') center right no-repeat #308045;padding-right:100px;">
                    <span style="color:white;font-weight: 700;font-size:36px;line-height: 90px; text-align:center;">@category.CategoryTitle.HtmlEncode()</span>
                    @*<span class="breadcrumbs">
            <a href="/@dilk">@Partial.Translate("Anasayfa", dilk)</a><span>→</span>
            @foreach (MakaleKategori kat in Partial.BreadcrumbKategori(isim.MakaleKategoriID))
            {
                <a href="@Partial.KategoriLink(kat.MakaleKategoriID)">@kat.MakaleKategoriAdi.Replace("<br />", " ").HtmlEncode()</a><span class="musterlersevinsin">→</span>
            }
        </span>*@
            </span>



        </div>
    </div>
</div>

<div class="container p-5">
    <div class="row">
                @*<div class="row headrow">
                        <div class="col-md-6 center-mobile">
                            <p><i class="fa fa-eye"></i> <b>@Partial.Translate("MakaleSayisi", dilk) : </b>@makalesay / <b>@Partial.Translate("AltKategoriSayisi", dilk): </b>@kategorisay</p>
                        </div>
                        <div class="col-md-6 text-right center-mobile">
                            <p><i class="fa fa-calendar"></i> <b>@Partial.Translate("GuncellenmeTarihi", dilk) : </b>@sontarih.ToShortDateString()</p>
                        </div>
                    </div>*@
                @if (!string.IsNullOrEmpty(category.CategoryContent.Trim()))
                {
                    <div class="row">
                        <div class="col-md-12">
                            @MvcHtmlString.Create(category.CategoryContent)
                        </div>
                    </div>
                }
                <div class="row">
                    <div class="col-md-12">
                        @{
                            IEnumerable<Category> Categoryler = Partial.CategorySubID(category.CategoryID);
                            int Categorydon = Convert.ToInt32(Math.Ceiling(Categoryler.Count() / Convert.ToDouble(4)));
                            for (int i = 0; i < Categorydon; i++)
                            {
                                <div class="row galerirow">
                                    @foreach (Category Categorym in Categoryler.Skip(i * 4).Take(4))
                                    {
                                        <div class="col-lg-4 col-sm-4 center-tablet-portrait mt-5">
                                            <div class="iconic">
                                                <a href="@Partial.CategoryLink(Categorym.CategoryID))">
                                                    <div class="resimstandart" style="background-image: url(@Categorym.CategoryThumbnail);">
                                                    </div>
                                                </a>
                                                <div class="indexbas">
                                                    <div class="coverme tip-tablo">
                                                        <a class="hucre hucre-ortala fancybox"
                                                           href="@Partial.CategoryLink(Categorym.CategoryID)">
                                                            <h5>@Categorym.CategoryTitle.HtmlEncode()</h5>
                                                        </a>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    }
                                </div>
                            }
                            <hr/>
                            IEnumerable<Post> Postler = ViewData.Model;
                            int Postdon = Convert.ToInt32(Math.Ceiling(Postler.Count() / Convert.ToDouble(4)));

                            for (int i = 0; i < Postdon; i++)
                            {
                                <div class="row galerirow">
                                    @foreach (Post Postm in Postler.Skip(i * 4).Take(4))
                                    {
                                        string Postkapak = "";
                                        if (!String.IsNullOrEmpty(Postm.PostThumbnail))
                                        {
                                            Postkapak = Postm.PostThumbnail;
                                        }
                                        else
                                        {
                                            Postkapak = "/Upload/File/placeholder.jpg";
                                        }
                                        <div class="col-lg-4 col-sm-4 center-tablet-portrait mt-5">
                                            <div class="iconic">
                                                <a href="@Partial.PostLink(Postm.PostID)">
                                                    <div class="resimstandart" style="background-image: url(@Postm.PostImage);">
                                                    </div>
                                                </a>
                                                <div class="indexbas">
                                                    <div class="coverme tip-tablo">
                                                        <a class="hucre hucre-ortala fancybox"
                                                           href="@Partial.PostLink(Postm.PostID)">
                                                            <h5>@Postm.PostTitle.HtmlEncode()</h5>
                                                        </a>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    }
                                </div>
                            }
                        }
                    </div>
                </div>
                @{
                    int bulunduguSayfa = Convert.ToInt32(ViewBag.BulunduguSayfa);
                    int ogeAdedi = Convert.ToInt32(ViewBag.OgeAdedi);
                    int sayfadaGosterilecekUrunSayisi = Convert.ToInt32(Partial.OptionGetValue("PostCount"));
                    if (ogeAdedi / sayfadaGosterilecekUrunSayisi > 1)
                    {
                        <div class="container">
                            <div class="footrow">
                                <nav>
                                    <ul class="pagination">
                                        @{
                                            string link = Partial.CategoryLink(category.CategoryID);
                                            if (ViewBag.CategoryID > 0)
                                            {
                                                @Function.Paging(link, bulunduguSayfa, ogeAdedi, sayfadaGosterilecekUrunSayisi, true, "", "page", "active", false, false, 5, "/" + ViewBag.CategoryID + "&sID=", "<<", "<", ">", ">>")
                                            }
                                            else
                                            {
                                                @Function.Paging(link, bulunduguSayfa, ogeAdedi, Convert.ToInt32(Partial.OptionGetValue("PostCount")), true, "", "page", "active", false, false, 5, "/", "<<", "<", ">", ">>")
                                            }
                                        }
                                    </ul>
                                </nav>
                            </div>
                        </div>

                    }

                }
    </div>
</div>

Css

<style>
    .resimstandart {
        width: 100%;
        height: 230px;
        background-size: cover;
        background-repeat: no-repeat;
        background-position: center center;
    }
    .iconic {
        border-radius: 0px 25px 0px 25px !important;
        border: 0px !important;
    }

    .iconic {
        width:330px;
        max-width: 100%;
        border: 5px solid #fff;
        background-color: #fff;
        box-shadow: 0 0 5px rgba(0, 0, 0, .15);
        -moz-box-shadow: 0 0 5px rgba(0, 0, 0, .15);
        -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .15);
        overflow: hidden;
        min-height: 230px;
    }
    .indexbas {
        position: absolute;
        top: 0;
        background-color: #308045;
        border-bottom: 2px solid #faed25;
    }
        .indexbas::after {
            content: " ";
            height: 44px;
            width: 24px;
            display: block;
            background-image: url(http://demo7.karayeltasarim.com/Upload/File/2020/2/26/box-header-bg.png);
            background-position: center;
            position: absolute;
            top: 0;
            right: 0;
            margin-right: -23px;
        }
    .coverme, .coverme2, .coverme3 {
        min-height: 40px;
        margin: 0 auto;
        padding: 0 10px;
    }
        .coverme h5 {
            font-size: 17px;
            text-transform: uppercase;
            color: #fff;
            margin: 10px 0px;
            font-weight: 600;
        }
    .tip-tablo .hucre-ortala {
        vertical-align: middle;
    }
    .tip-tablo .hucre {
        display: table-cell;
    }
    .galerirow a {
        width: 100%;
        margin: 10px 0;
    }
</style>