summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/content/_banner.html.erb13
-rw-r--r--app/views/content/_banner_body.html.erb5
2 files changed, 18 insertions, 0 deletions
diff --git a/app/views/content/_banner.html.erb b/app/views/content/_banner.html.erb
new file mode 100644
index 00000000..134bb961
--- /dev/null
+++ b/app/views/content/_banner.html.erb
@@ -0,0 +1,13 @@
1<% target = banner.head.link_target %>
2<% image = banner.head.headline_asset %>
3
4<div class="banner">
5 <% if target %>
6 <%= link_to(target.internal? ? content_path(target.node.unique_name) : target.url,
7 target.internal? ? {} : { :target => "_blank", :rel => "noopener" }) do %>
8 <%= render "content/banner_body", :banner => banner, :image => image %>
9 <% end %>
10 <% else %>
11 <%= render "content/banner_body", :banner => banner, :image => image %>
12 <% end %>
13</div>
diff --git a/app/views/content/_banner_body.html.erb b/app/views/content/_banner_body.html.erb
new file mode 100644
index 00000000..b1d57d04
--- /dev/null
+++ b/app/views/content/_banner_body.html.erb
@@ -0,0 +1,5 @@
1<% if image %>
2 <%= image_tag image.upload.url(:large), :alt => banner.head.title.to_s, :class => "banner_image" %>
3<% else %>
4 <span class="banner_title"><%= banner.head.title %></span>
5<% end %>