Polishing gallery ui

This commit is contained in:
Andrew Brown 2017-02-18 00:36:16 +00:00
parent ee13d748f3
commit 1cf19aea75
2 changed files with 10 additions and 5 deletions

View File

@ -7,7 +7,9 @@ class ImageUpload < ActiveRecord::Base
thumb: '100x100>',
small: '190x190#',
square: '280x280#',
medium: '300x300>'
medium: '300x300>',
large: '600x600>',
hero: '800x800>'
},
filename_cleaner: -> (filename) {
[

View File

@ -1,8 +1,11 @@
<%# todo: some smart resizing for 1-3+ images %>
<%# todo: lightbox on click %>
<% content.image_uploads.each do |image| %>
<%= link_to image.src(:original), class: 'z-depth-1 hoverable', target: '_new' do %>
<%= image_tag image.src(:square) %>
<div class="center">
<% images = content.image_uploads %>
<% images.each do |image| %>
<%= link_to image.src(:original), class: 'z-depth-1 hoverable', target: '_new' do %>
<%= image_tag image.src(images.count == 1 ? :hero : :medium) %>
<% end %>
<% end %>
<% end %>
</div>