summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-08-21 20:53:12 +0200
committererdgeist <erdgeist@erdgeist.org>2026-08-21 20:53:12 +0200
commitd75d8cc3e6e772a00b92c050e8dd3ee0b0dbcb94 (patch)
tree2738ae9053ea73f8c9ef561a1e93f6a0189054d4 /app/views
parenta986b1f2b5676624f02373cb54eb3b81b18f3f79 (diff)
Add banner partials
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 %>