summaryrefslogtreecommitdiff
path: root/app/views/content
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/content')
-rw-r--r--app/views/content/_asset_credits.html.erb12
-rw-r--r--app/views/content/_headline_image.html.erb36
2 files changed, 36 insertions, 12 deletions
diff --git a/app/views/content/_asset_credits.html.erb b/app/views/content/_asset_credits.html.erb
new file mode 100644
index 00000000..85739d09
--- /dev/null
+++ b/app/views/content/_asset_credits.html.erb
@@ -0,0 +1,12 @@
1<% if @page.assets.images.any? %>
2 <div id="asset_credits">
3 <% @page.assets.images.each do |image| %>
4 <% credit = asset_credit(image) %>
5 <% next unless credit %>
6 <div id="credit_for_asset_<%= image.id %>"
7 class="glightbox-desc<%= " headline_credit" if image == @headline_asset %>">
8 <%= credit %>
9 </div>
10 <% end %>
11 </div>
12<% end %>
diff --git a/app/views/content/_headline_image.html.erb b/app/views/content/_headline_image.html.erb
index 243be408..c764d22d 100644
--- a/app/views/content/_headline_image.html.erb
+++ b/app/views/content/_headline_image.html.erb
@@ -1,16 +1,28 @@
1<%= link_to( 1<% gallery_images = @page.assets.images %>
2 image_tag(@images[0].upload.url(:headline)),
3 @images[0].upload.url,
4 :class => "glightbox",
5 :data => { :gallery => "page-#{@page.node.id}" }
6) %>
7 2
8<% if 1 < @images.length %> 3<% if @headline_asset %>
9 <div class="right"> 4 <%= link_to(
10 <%= "#{@images.length} #{t(:images)}" %> 5 image_tag(@headline_asset.upload.url(:headline)),
11 </div> 6 @headline_asset.upload.url,
7 :class => "glightbox",
8 :data => { :gallery => "page-#{@page.node.id}", :title => @headline_asset.name,
9 :description => "#credit_for_asset_#{@headline_asset.id}" }
10 ) %>
11 <% if gallery_images.size > 1 %>
12 <div class="right"><%= "#{gallery_images.size} #{t(:images)}" %></div>
13 <% end %>
14<% elsif gallery_images.any? %>
15 <%= link_to "#{gallery_images.size} #{t(:images)}, #{t(:open_gallery)}",
16 gallery_images.first.upload.url,
17 :class => "glightbox right",
18 :data => { :gallery => "page-#{@page.node.id}", :title => gallery_images.first.name,
19 :description => "#credit_for_asset_#{gallery_images.first.id}" } %>
12<% end %> 20<% end %>
13 21
14<% @images[1..-1].each do |image| %> 22<% gallery_images.each do |image| %>
15 <%= link_to "", image.upload.url, :class => "glightbox", :style => "display: none", :data => { :gallery => "page-#{@page.node.id}" } %> 23 <% next if image == @headline_asset %>
24 <% next if !@headline_asset && image == gallery_images.first %>
25 <%= link_to "", image.upload.url, :class => "glightbox", :style => "display: none",
26 :data => { :gallery => "page-#{@page.node.id}", :title => image.name,
27 :description => "#credit_for_asset_#{image.id}" } %>
16<% end %> 28<% end %>