Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #profile_photos
- .media-items.edit.clearfix
- .photo-container.edit
- .media-head
- %h4><
- Add Photo
- %span.small
- *Supported image types are GIF, PNG and JPEG.
- .image-uploader.clearfix
- - photo_form_attrs = { id: "add_profile_photo_form", class: "edit_profile_points", data: {type:"json"}, multipart: true}
- = form_for ProfilePhoto.new, url: business_users_profile_photos_path(@profile), builder: AppFormBuilder, method: :post, html: photo_form_attrs do |photo|
- = hidden_field_tag :tab, params[:tab]
- = hidden_field_tag :numeric_profile_id, @profile.id
- = hidden_field_tag :from, "admin"
- - if photo.object.new_record?
- .form
- = photo.file_field :image
- = photo.text_field :title, placeholder: "A short caption for the photo"
- = photo.submit "Add", id: "add-photo-btn"
- %dl{id: "photos", data: {profile: @profile.id}}
- - @profile.photos.each do |photo|
- - unless photo.new_record?
- .media-item{:data => {id: photo.id, title: photo.title, url: photo.image.url, profile: @profile.id, type: "photo"}}
- %dd
- %a{href: business_users_profile_photo_path(photo), method: :delete, title: "Delete photo", class: 'ui-icon ui-icon-closethick remove-media-item'}
- %a{href: "#{photo.image.url}", rel: "images", data: { :"ga-action"=> "View", :"ga-location"=>"Tab-Photos", action: "showModal", update_action: "delete"}}
- %img{src: photo.image(:thumb), alt: photo.title}
- %dt
- = photo.title || "Caption"
- = content_tag :p, "No photos to display. Add one now!", :class => 'empty-container-text' unless @profile.has_photos?
- #profile_videos
- .media-items.edit.clearfix
- .video-container.edit
- .media-head
- %h4><
- Add Video
- %span.small
- * Supported video sources are YouTube and Vimeo.
- .image-uploader.clearfix
- - video_form_attrs = { id: "add_profile_video_form", class: "edit_profile_points", data: {type:"json"}}
- = form_for ProfileVideo.new, url: business_users_profile_videos_path(@profile), builder: AppFormBuilder, method: :post, html: video_form_attrs do |video|
- = hidden_field_tag :tab, params[:tab]
- = hidden_field_tag :numeric_profile_id, @profile.id
- = hidden_field_tag :from, "admin"
- - if video.object.new_record?
- .form
- = video.text_field :url, placeholder: "A URL pointing to the video", class: "fake-loader"
- = video.text_field :title, placeholder: "A short description of the video"
- = video.submit "Add", id: "add-video-btn"
- %dl{id: "videos", data: {profile: @profile.id}}
- - @profile.videos.each do |video|
- - unless video.new_record?
- .media-item{:data => {id: video.id, title: video.title, url: video.url, profile: @profile.id, type: "video"}}
- %dd
- %a{:title => "Delete video", :class => 'ui-icon ui-icon-closethick remove-media-item'}
- %a{href: business_users_profile_video_path(@profile, video), rel: "images", data: { :"ga-action"=> "View", :"ga-location"=>"Tab-Photos", action: "showModal", update_action: "delete"}}
- = image_tag "video_sources/#{video.source}.png", alt: video.title
- %dt<>
- = video.title || "Caption"
- = 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