Skip to content

Commit

Permalink
layout for smaller tablet
Browse files Browse the repository at this point in the history
  • Loading branch information
digitaltom committed Jun 8, 2018
1 parent 94a97b5 commit 3e5745c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/assets/templates/picture_set_email.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
%p.lead.text-center
Get your picture send to you immediately:
.row
.col-sm-9
.col-sm-10
%form.center-block
.form-group
%input.input-lg.form-control#email{ 'ng-model' => 'emailFormData.email', 'type' => 'email', 'placeholder' => 'Email', 'size' => '20' }
.col-sm-3
.col-sm-2
%a.btn.btn-default.btn-lg{ 'ng-click' => "send_email()" }
%b Send email
.row
Expand Down
4 changes: 3 additions & 1 deletion app/assets/templates/picture_set_gallery.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
.col-lg-3.col-md-4.col-xs-6.thumb
%a.thumbnail{ 'ng-href' => "{{picture_set.path}}/{{picture_set.combined}}" }
%img.img-responsive{ style: 'width:400px;', 'ng-src' => "{{picture_set.path}}/{{picture_set.combined}}", alt: "" }
.row
.row.text-center
%a.btn.btn-default.btn-lg{ 'ng-href' => "#/picture_set/{{picture_set.date}}" }
%b Back
%a.btn.btn-default.btn-lg{ 'ng-href' => "#/picture_set/{{picture_set.date}}/email" }
%b Send per email
7 changes: 4 additions & 3 deletions app/mailers/picture_set_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
class PictureSetMailer < ApplicationMailer

def image_email(email, picture_set)
attachments.inline['animation.gif'] = File.read(File.join(picture_set[:full_path], picture_set[:animation]))
if File.exist?(File.join(picture_set[:full_path], picture_set[:combined]))
attachments.inline['combined.jpg'] = File.read(File.join(picture_set[:full_path], picture_set[:combined]))
image_path = Rails.root.join('public', picture_set[:path])
attachments.inline['animation.gif'] = File.read(File.join(image_path, picture_set[:animation]))
if File.exist?(File.join(image_path, picture_set[:combined]))
attachments.inline['combined.jpg'] = File.read(File.join(image_path, picture_set[:combined]))
end
mail(to: email, subject: "Your Photobox picture from '#{OPTS.image_caption}'")
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/picture_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def find(date)
end

def new(date)
{ path: "picture_sets/#{date}", full_path: Rails.root.join('public', "picture_sets/#{date}"), date: date,
{ path: "picture_sets/#{date}", date: date,
animation: "#{date}#{ANIMATION_SUFFIX}", combined: "#{date}#{COMBINED_SUFFIX}",
pictures: (1..4).map { |i| { polaroid: "#{date}_#{i}#{POLAROID_SUFFIX}", full: "#{date}_#{i}.jpg" } } }
end
Expand Down

0 comments on commit 3e5745c

Please sign in to comment.