@using Orchard.MediaLibrary.Models
@using Orchard.Utility.Extensions;

@{
    if (Model.Title != null)
    {
        Layout.Title = Model.Title;
    }
    
    var contentTypeClassName = ((string)Model.ContentItem.MediaPart.ContentItem.ContentType).HtmlClassify();
    Model.Classes.Add("content-item");
    Model.Classes.Add("content-item-detail");
    Model.Classes.Add("media-item");
    Model.Classes.Add("media-item-detail");
    Model.Classes.Add(contentTypeClassName);
    Model.Classes.Add(contentTypeClassName + "-detail");

    var tag = Tag(Model, "article");
}
@tag.StartElement
@if (Model.Header != null)
{
    <header class="content-item-header">
        @Display(Model.Header)
    </header>
}
@Display(Model.Content)
@if (Model.Meta != null)
{
    <div class="content-item-meta">
        @Display(Model.Meta)
    </div>
}
@if (Model.Footer != null)
{
    <footer class="content-item-footer">
        @Display(Model.Footer)
    </footer>
}
@tag.EndElement