zeus.ugent.be/layouts/eventpost.erb
2018-04-23 13:08:20 +02:00

106 lines
3.6 KiB
Text

<% content_for :head do %>
<% if item[:image] %>
<meta property="og:image" content="<%= item[:image] %>" />
<% end %>
<meta property="og:title" content="<%= item[:title] %>" />
<meta property="og:type" content="article" />
<meta property="og:url" content="<%= url_for(item) %>" />
<meta property="og:description" content="<%= item[:description] %>" />
<meta property="og:site_name" content="Zeus WPI" />
<meta name="twitter:label1" value="Time" />
<meta name="twitter:data1" value="<%= item[:time].strftime '%A %d %B %Y %H:%M' %>" />
<meta name="twitter:label2" value="Place" />
<meta name="twitter:data2" value="<%= item[:location] %>" />
<meta name="twitter:card" content="summary_large_image" />
<% end %>
<% if item[:banner] %>
<section class="hero is-medium is-primary is-bold" style="background-image:url('<%= item[:banner] %>');background-position:center;">
<% elsif item[:color] %>
<% gradient = if item[:gradient].nil? || item[:gradient]
'linear-gradient(141deg,rgba(255,255,255,0),rgba(0,0,0,.60))'
else
'none'
end %>
<section class="hero is-medium is-primary is-bold" style="background-image: <%= gradient %>; background-color:<%= item[:color] %>;">
<% else %>
<section class="hero is-medium is-primary is-bold">
<% end %>
<div class="hero-head">
<%= render '/partials/_navbar.*', zeus_logo_color: :white, transparent_nav: true %>
</div>
<div class="hero-body">
<div class="container">
<div class="columns">
<div class="column has-vertical-center">
<div class="header-text <%= item[:header_text_background] ? 'light-background' : '' %>">
<p class="title is-1-responsive event-title">
<b>
<%= item[:title] %>
</b>
<span class="event-social-icons">
<% if item[:facebook] %>
<a href="<%= item[:facebook] %>">
<%= fa :facebook %>
</a>
<% end %>
<a href="<%= item.path rep: :ical %>">
<%= fa :calendar %>
</a>
</span>
</p>
<p class="subtitle is-3-responsive">
<%= item[:description] %>
</p>
<ul class="fa-ul is-4-responsive">
<li><%= fa 'clock-o', li: true %><%= item[:time].strftime '%A %d %B %Y %H:%M' %></li>
<li><%= fa 'map-marker', li: true %><%= item[:location] %></li>
</ul>
</div>
</div>
<% if item[:image] %>
<div class="is-narrow column banner-image">
<img src="<%= item[:image] %>" alt="banner">
</div>
<% end %>
</div>
</div>
</div>
</section>
<section class="section">
<div class="columns">
<div class="column is-8 is-offset-2">
<div class="content has-text-justified is-medium-responsive">
<%= yield %>
</div>
<!-- GOOGLE MAPS -->
<div class="map-wrapper box">
<iframe height="400" style="width:100%" src="<%= locationlink item[:locationlink] %>" allowfullscreen> </iframe>
</div>
<!-- END GOOGLE MAPS -->
</div>
</div>
</section>
<!-- SPONSORED BY -->
<% if item[:sponsors] %>
<section class="section">
<div class="columns">
<div class="column is-8 is-offset-2">
<h1 class="title is-1 has-text-centered">Sponsored by</h1>
<div class="sponsors">
<% @item[:sponsors].each do |sp| %>
<a href="<%= sp[:url] %>" target="_blank">
<img src="<%= sp[:img] %>" alt="<%= sp[:name] %>">
</a>
<% end %>
</div>
</div>
</div>
</section>
<% end %>
<!-- END SPONSORED BY -->