diff --git a/app/views/photos/_thumbnail.html.haml b/app/views/photos/_thumbnail.html.haml index 5efd7fdbd..03a1f0c4c 100644 --- a/app/views/photos/_thumbnail.html.haml +++ b/app/views/photos/_thumbnail.html.haml @@ -1,5 +1,5 @@ .thumbnail.photo-thumbnail - = link_to image_tag(photo.thumbnail_url, :alt => photo.title, :class => 'img img-responsive'), photo + = link_to image_tag(photo.thumbnail_url, alt: photo.title, class: 'img img-responsive'), photo .text %p = link_to photo.title, photo diff --git a/app/views/photos/index.html.haml b/app/views/photos/index.html.haml index f7791cdc0..1e95a1ec5 100644 --- a/app/views/photos/index.html.haml +++ b/app/views/photos/index.html.haml @@ -2,21 +2,21 @@ %p Most recent photos added to #{ENV['GROWSTUFF_SITE_NAME']}. -%div.pagination +.pagination = page_entries_info @photos = will_paginate @photos .row - @photos.each do |p| .col-md-2.six-across - .thumbnail(style='height: 220px') - = link_to image_tag(p.thumbnail_url, :alt => p.title, :class => 'img'), p + .thumbnail{ style: 'height: 220px' } + = link_to image_tag(p.thumbnail_url, alt: p.title, class: 'img'), p %p = link_to p.title, p by = link_to p.owner, p.owner -%div.pagination +.pagination = page_entries_info @photos = will_paginate @photos diff --git a/app/views/photos/new.html.haml b/app/views/photos/new.html.haml index 6c8a525b6..41dc57586 100644 --- a/app/views/photos/new.html.haml +++ b/app/views/photos/new.html.haml @@ -7,32 +7,34 @@ = link_to @flickr_auth.name, "http://flickr.com/photos/#{@flickr_auth.uid}" Please select a photo from your recent uploads. - - if @sets and @current_set + - if @sets && @current_set %h2= @sets.key(@current_set) - - if @sets and @sets.size > 0 + - if @sets && !@sets.empty? %p - = form_tag(new_photo_path, :method => :get, :class => 'form-inline') do - = label_tag :set, "Choose a photo album:", :class => 'control-label' - = select_tag :set, options_for_select(@sets, @current_set), :class => 'input-large' + = form_tag(new_photo_path, method: :get, class: 'form-inline') do + = label_tag :set, "Choose a photo album:", class: 'control-label' + = select_tag :set, options_for_select(@sets, @current_set), class: 'input-large' = hidden_field_tag :type, @type = hidden_field_tag :id, @id - = submit_tag "Search", :class => 'btn btn-primary' + = submit_tag "Search", class: 'btn btn-primary' - %div.pagination + .pagination = page_entries_info @photos = will_paginate @photos .row - @photos.each do |p| .col-md-2.six-across - .thumbnail(style='height: 220px') - = link_to image_tag(FlickRaw.url_q(p), :alt => '', :class => 'img'), photos_path(:photo => { :flickr_photo_id => p.id }, :type => @type, :id => @id), :method => :post + .thumbnail{ style: 'height: 220px' } + = link_to image_tag(FlickRaw.url_q(p), alt: '', class: 'img'), + photos_path(photo: { flickr_photo_id: p.id }, type: @type, id: @id), + method: :post %p - =p.title + = p.title - else .alert You must - =link_to "connect your account to Flickr", '/auth/flickr' + = link_to "connect your account to Flickr", '/auth/flickr' to add photos. diff --git a/app/views/photos/show.html.haml b/app/views/photos/show.html.haml index c3bdf967b..11fde30b7 100644 --- a/app/views/photos/show.html.haml +++ b/app/views/photos/show.html.haml @@ -23,7 +23,11 @@ = link_to "View on Flickr", @photo.link_url - if can? :destroy, @photo - %p= link_to 'Delete Photo', @photo, method: :delete, data: { confirm: 'Are you sure?' }, :class => 'btn btn-default btn-xs' + %p= link_to 'Delete Photo', + @photo, + method: :delete, + data: { confirm: 'Are you sure?' }, + class: 'btn btn-default btn-xs' .col-md-6 - unless @photo.plantings.empty? && @photo.harvests.empty? && @photo.gardens.empty? && @photo.seeds.empty? @@ -40,5 +44,5 @@ .row .col-md-12 - %p= image_tag(@photo.fullsize_url, :alt => @photo.title, :class => 'img') + %p= image_tag(@photo.fullsize_url, alt: @photo.title, class: 'img')