Advertisement
Guest User

Untitled

a guest
Jul 14th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.95 KB | None | 0 0
  1. @inherits GlassView<DescriptionModule>
  2. @{
  3. var siteSettings = SiteSettings.GetSiteSettings();
  4. }
  5.  
  6. @if (Model.IsValid() && Model.HasContent())
  7. {
  8. <div class="description @(Model.HasMedia().IfFalse("description--noMedia")) @Model.CenterText.IfTrue("u-alignCenter") @Model.GetBackgroundClass("description") @Model.GetPaddingCss()" id="@Model.Id.ToString()">
  9. <div class="container">
  10. @if (Model.Title.HasValue())
  11. {
  12. @Editable(Model, x => string.Format("<h2 class='description-title u-alignCenter'>{0}</h2>", x.Title.ReplaceNewLines()))
  13. }
  14. <div class="row">
  15. @if (Model.HasMedia())
  16. {
  17. <div class="description-media-column col-md-6 @Model.LeftImage.IfFalse("col-md-push-6") col-md-offset-0 col-xs-8 col-xs-offset-2">
  18. @if (Model.VideoId.HasValue())
  19. {
  20. <a href="#" class="video-placeholder">
  21. @if (IsInEditingMode || (Model.VideoPlaceholderImage != null && Model.VideoPlaceholderImage.Src.HasValue()))
  22. {
  23. @(Editable<DescriptionModule>(Model, x => x.GetVideoPlaceHolder(), x => string.Format("<img src='{0}' class='video-placeholder-photo' alt='{1}'>", x.GetVideoPlaceHolder(), x.VideoPlaceholderImage.Alt)))
  24. }
  25. else
  26. {
  27. <img src="@Model.GetVideoPlaceHolder()" class="video-placeholder-photo" alt="@Model.Title.GetValue()">
  28. }
  29. <span class="video-placeholder-icon"><i class="material-icons">&#xE038;</i></span>
  30. </a>
  31.  
  32. <div class="video-player" style="display: none; position: relative; max-width: 100%;">
  33. <div style="padding-top: 56.25%;">
  34. @if (Model.VideoType.ToLower().Trim() == "brightcove")
  35. {
  36. <video id="@("video" + Model.VideoId)" data-account="@siteSettings.BrightcoveAccount" data-player="@siteSettings.BrightcovePlayerID" data-embed="default" data-video-id="@Model.VideoId" data-video-service="@Model.VideoType.ToLower()" class="video-js" controls></video>
  37. }
  38. else
  39. {
  40. <iframe id="@("video" + Model.VideoId)" src="@("https://www.youtube.com/embed/" + Model.VideoId + "?html5=true&showinfo=0&enablejsapi=1")" data-video-service="@Model.VideoType.ToLower()" class="video-youtube" frameborder="0" allowfullscreen></iframe>
  41. }
  42. </div>
  43. </div>
  44.  
  45. if (Model.VideoDescription.HasValue())
  46. {
  47. @Editable(x => x.VideoDescription, x => string.Format("<span class='description-photo-caption'>{0}</span>", x.VideoDescription))
  48. }
  49. }
  50. else if (Model.Image != null)
  51. {
  52. @(Editable<DescriptionModule>(Model, x => x.Image, x => string.Format("<img src='{0}' class='description-photo' alt='{1}'>", x.Image.Src, x.Image.Alt)))
  53.  
  54. if (Model.ImageDescription != null)
  55. {
  56. @Editable(x => x.ImageDescription, x => string.Format("<span class='description-photo-caption'>{0}</span>", x.ImageDescription))
  57. }
  58. }
  59. </div>
  60. }
  61. <div class="description-text-column @Model.HasMedia().IfTrue("col-md-6" + Model.LeftImage.IfFalse(" col-md-pull-6")) col-xs-12">
  62. @if (Model.SubTitle.HasValue())
  63. {
  64. @Editable(Model, x => string.Format("<h4 class='description-subtitle'>{0}</h4>", x.SubTitle))
  65. }
  66. @if (Model.Description.HasValue())
  67. {
  68. <div class="description-content">
  69. @Editable(Model, x => x.Description)
  70. </div>
  71. }
  72.  
  73. @if (Model.CtaTarget != null && Model.CtaTarget.Url.HasValue())
  74. {
  75. @RenderLink(x => x.CtaTarget, new NameValueCollection { { "class", "description-cta " + (Model.CtaPlainText ? "arrow-link" : "btn btn--primary") } }, isEditable: true, contents: Model.GetCTAContent())
  76. }
  77.  
  78. @if (Model.SecondaryCtaTarget.HasUrl())
  79. {
  80. @RenderLink(x => x.SecondaryCtaTarget, new NameValueCollection { { "class", "description-cta " + (Model.CtaPlainText ? "arrow-link" : "btn btn--primary") } }, isEditable: true, contents: Model.SecondaryCtaText)
  81. }
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement