added gradient color if no banner defined

This commit is contained in:
Brecht 2017-02-14 14:57:40 +01:00 committed by Lorin Werthen
parent 018c6d9928
commit fa7bdde3e9
No known key found for this signature in database
GPG key ID: F11FFC921E0E08E0
2 changed files with 11 additions and 4 deletions

View file

@ -14,6 +14,8 @@
<% if item[:banner] %>
<section class="hero is-medium is-primary is-bold" style="background-image:url('<%= item[:banner] %>');background-position:center;">
<% elsif item[:color] %>
<section class="hero is-medium is-primary is-bold" style="background-image: linear-gradient(to top right,rgba(255,255,255,0),rgba(0,0,0,.75)); background-color:<%= item[:color] %>;">
<% else %>
<section class="hero is-medium is-primary is-bold">
<% end %>

View file

@ -1,8 +1,13 @@
<!--<a href="<%= @article.path %>" class="tile is-child box backgroundimg <%= @htmlclass %>"
style="background-image:url('<%= @article[:banner] %>');">-->
<% if @article[:banner] %>
<a href="<%= @article.path %>" class="tile is-child box backgroundimg <%= @htmlclass %>"
style="background-image:url('<%= @article[:banner] %>');">
<% elsif @article[:color] %>
<a href="<%= @article.path %>" class="tile is-child box backgroundimg highlighted"
style="background-color:<%= @article[:color] %>;">
<div class="content" >
style="background-image: linear-gradient(to top right,rgba(255,255,255,0),rgba(0,0,0,.75)); background-color:<%= @article[:color] %>;">
<% else %>
<a href="<%= @article.path %>" class="tile is-child box backgroundimg">
<% end %>
<div class="content">
<div class="columns">
<div class="column">
<h2>