mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-23 23:38:23 -04:00
Most post like into a wrapper in the html
This commit is contained in:
1 parent
80429f935a
commit
7d1f9c5a3a
2 files changed
+5
-4
No files matched your search
@@ -19,9 +19,9 @@ $(document).ready(function() {
|
||||
$('.photo-like').show();
|
||||
|
||||
$('.photo-like').on('ajax:success', function(event, data) {
|
||||
var likeControl = $('.photo-like');
|
||||
|
||||
$('.like-count').text(data.description);
|
||||
var likeControl = $('#photo-'+ data.id + ' .photo-like');
|
||||
console.log(data);
|
||||
$('#photo-' + data.id + ' .like-count').text(data.description);
|
||||
if (data.liked_by_member) {
|
||||
likeControl.data('method', 'delete');
|
||||
likeControl.attr('href', data.url);
|
||||
|
||||
@@ -11,12 +11,13 @@
|
||||
%li.breadcrumb-item= link_to 'Photos', photos_path
|
||||
%li.breadcrumb-item.active= link_to @photo, @photo
|
||||
|
||||
.row
|
||||
.row{id: "photo-#{@photo.id}"}
|
||||
.col-md-8
|
||||
%h1.text-center.ellipsis=@photo.title
|
||||
%p.text-center
|
||||
= image_tag(@photo.fullsize_url, alt: @photo.title, class: 'rounded img-fluid shadow-sm')
|
||||
.col-md-4
|
||||
|
||||
%p.text-center{ id: "photo-#{@photo.id}" }
|
||||
= render 'photos/actions', photo: @photo
|
||||
= link_to "View on Flickr", @photo.link_url, class: 'btn'
|
||||
|
||||
Reference in new issue
Block a user