Created
April 18, 2013 15:37
-
-
Save nfriend21/5413720 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_for [@website, @billboard], :html => { :multipart => true } do |f| %> | |
<div class="row_margin_bottom"> | |
<%= f.label :name %> | |
<%= f.text_field :name %> | |
</div> | |
<div class="form_row"> | |
<%= label_tag :photos %> | |
<div class="billboard-container"> | |
<% if @billboard.photos.empty? %> | |
<div class="billboard-empty"><span> No Photos Uploaded </span></div> | |
<% else %> | |
<ul class="sortable-billboard" data-url="/websites/<%= @website.id %>/billboards/<%= @billboard.id %>/update_photo_positions/"> | |
<% @billboard.photos.each do |photo| %> | |
<li id="photo_<%=photo.id %>" style="position: relative;"> | |
<div class="image-controls"> | |
<%= link_to 'edit', edit_website_photo_path(@website, photo, :source_page_id => @source_page.id, :billboard_id => @billboard.id), {id: "edit_#{photo.image_file_name.split('.')[0]}", style: "display: inline;"} %> | |
<%= link_to 'resize', edit_website_photo_path(@website, photo, :source_page_id => @source_page.id, :billboard_id => @billboard.id, :resize => true), {remote: true, id: "resize_#{photo.image_file_name.split('.')[0]}", style: "display: inline;", class: 'resize-reposition'} %> | |
<%= link_to 'delete', website_photo_path(@website, photo, :source_page_id => @source_page.id), method: :delete, data: { confirm: "are you sure?"}, style: "display: inline;", id: "delete_billboard_photo_#{photo.id}" %><br/> | |
</div> | |
<%= image_tag photo.image.url(:gallery), class: 'billboard-image' %> | |
</li> | |
<% end %> | |
</ul> | |
<% end %> | |
</div> | |
</div> | |
<%= fields_for :photo do |p| %> | |
<div class="form_row"> | |
<%= p.label :upload_photos %> | |
<%= p.file_field :image %> | |
</div> | |
<% end %> | |
<% if params[:action] == 'edit' %> | |
<div class="form_row" id="advanced_options_label"> | |
<%= check_box_tag 'advanced_options_checkbox', 'Advanced Options' %> | |
<%= label_tag :advanced_options %> | |
</div> | |
<div id="advanced_options"> | |
<div class="form_row"> | |
<%= label_tag :dimensions %> | |
<div style="padding-left: 20px;"> | |
<%= f.label :width %> | |
<%= f.text_field :width %> | |
<%= f.label :height %> | |
<%= f.text_field :height %> | |
</div> | |
</div> | |
<div class="form_row"> | |
<%= f.label :display_previous_and_next_buttons %> | |
<%= f.radio_button :display_prev_next_btns, "true" %> Yes <br /> | |
<%= f.radio_button :display_prev_next_btns, "false" %> No | |
</div> | |
<div class="form_row"> | |
<%= f.label :display_caption_text %> | |
<%= f.radio_button :display_caption, "true" %> Yes <br /> | |
<%= f.radio_button :display_caption, "false" %> No | |
</div> | |
</div> | |
<% end %> | |
<%= fields_for :page do |page| %> | |
<%= page.hidden_field :source_page_id, :value => @page_id %> | |
<% end %> | |
<div class="form_row"> | |
<%= dynamic_form_buttons(f, params[:controller], params[:action], @user) %> | |
</div> | |
<% end %> | |
<% @billboard.photos.each do |photo| %> | |
<div class="modal-container" style="display: none;"> | |
<div class="modal-form"> | |
<%= render :partial => 'photos/form', :locals => {:resize => 'true', :photo => photo} %> | |
</div> | |
</div> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment