Guest User

Untitled

a guest
Oct 16th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.56 KB | None | 0 0
  1. #profile_photos
  2. .media-items.edit.clearfix
  3. .photo-container.edit
  4. .media-head
  5. %h4><
  6. Add Photo
  7. %span.small
  8. *Supported image types are GIF, PNG and JPEG.
  9. .image-uploader.clearfix
  10. - photo_form_attrs = { id: "add_profile_photo_form", class: "edit_profile_points", data: {type:"json"}, multipart: true}
  11. = form_for ProfilePhoto.new, url: business_users_profile_photos_path(@profile), builder: AppFormBuilder, method: :post, html: photo_form_attrs do |photo|
  12. = hidden_field_tag :tab, params[:tab]
  13. = hidden_field_tag :numeric_profile_id, @profile.id
  14. = hidden_field_tag :from, "admin"
  15.  
  16. - if photo.object.new_record?
  17. .form
  18. = photo.file_field :image
  19. = photo.text_field :title, placeholder: "A short caption for the photo"
  20. = photo.submit "Add", id: "add-photo-btn"
  21. %dl{id: "photos", data: {profile: @profile.id}}
  22. - @profile.photos.each do |photo|
  23. - unless photo.new_record?
  24. .media-item{:data => {id: photo.id, title: photo.title, url: photo.image.url, profile: @profile.id, type: "photo"}}
  25. %dd
  26. %a{href: business_users_profile_photo_path(photo), method: :delete, title: "Delete photo", class: 'ui-icon ui-icon-closethick remove-media-item'}
  27. %a{href: "#{photo.image.url}", rel: "images", data: { :"ga-action"=> "View", :"ga-location"=>"Tab-Photos", action: "showModal", update_action: "delete"}}
  28. %img{src: photo.image(:thumb), alt: photo.title}
  29. %dt
  30. = photo.title || "Caption"
  31. = content_tag :p, "No photos to display. Add one now!", :class => 'empty-container-text' unless @profile.has_photos?
  32.  
  33.  
  34. #profile_videos
  35. .media-items.edit.clearfix
  36. .video-container.edit
  37. .media-head
  38. %h4><
  39. Add Video
  40. %span.small
  41. * Supported video sources are YouTube and Vimeo.
  42. .image-uploader.clearfix
  43. - video_form_attrs = { id: "add_profile_video_form", class: "edit_profile_points", data: {type:"json"}}
  44. = form_for ProfileVideo.new, url: business_users_profile_videos_path(@profile), builder: AppFormBuilder, method: :post, html: video_form_attrs do |video|
  45. = hidden_field_tag :tab, params[:tab]
  46. = hidden_field_tag :numeric_profile_id, @profile.id
  47. = hidden_field_tag :from, "admin"
  48.  
  49. - if video.object.new_record?
  50. .form
  51. = video.text_field :url, placeholder: "A URL pointing to the video", class: "fake-loader"
  52. = video.text_field :title, placeholder: "A short description of the video"
  53. = video.submit "Add", id: "add-video-btn"
  54. %dl{id: "videos", data: {profile: @profile.id}}
  55. - @profile.videos.each do |video|
  56. - unless video.new_record?
  57. .media-item{:data => {id: video.id, title: video.title, url: video.url, profile: @profile.id, type: "video"}}
  58. %dd
  59. %a{:title => "Delete video", :class => 'ui-icon ui-icon-closethick remove-media-item'}
  60.  
  61. %a{href: business_users_profile_video_path(@profile, video), rel: "images", data: { :"ga-action"=> "View", :"ga-location"=>"Tab-Photos", action: "showModal", update_action: "delete"}}
  62. = image_tag "video_sources/#{video.source}.png", alt: video.title
  63. %dt<>
  64. = video.title || "Caption"
  65. = content_tag :p, "No videos to display. Link one now!", :class => 'empty-container-text' unless @profile.has_videos?
Add Comment
Please, Sign In to add comment