Guest User

Untitled

a guest
Jul 17th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.12 KB | None | 0 0
  1. <div style="float:left; width:45%; margin-right:25px">
  2. <h1><%= object.line_item.order.user.email %></h1>
  3. <h2><%= object.line_item.product.name %></h2>
  4. <h2><%= object.line_item.order.id %></h2>
  5. <% object.associated_requests.each do |request| %>
  6. <p>Request on <%= request.created_at.to_date %> and approved on <%= request.approval_date.to_date %></p>
  7. <table class="index">
  8. <tr>
  9. <th>Contest Name</th>
  10. <th>Host name</th>
  11. <th>City</th>
  12. <th>State</th>
  13. <th style="width:120px;">Date of Competition</th>
  14. <th style="width:40px;">Add</th>
  15. </tr>
  16. <% request.associated_sites.each do |sites| %>
  17. <tr>
  18. <td><%= sites.name %></td>
  19. <td><%= sites.host_name %></td>
  20. <td><%= sites.city %></td>
  21. <td><%= sites.state.abbr %></td>
  22. <td><%= sites.competition_date ? sites.competition_date.to_date : "No Date Given" %></td>
  23. <td>
  24. <% form_for @approval, :url => { edit_admin_approval_path(@approval) } do |f| -%>
  25. <%# hidden_field_tag :site_id, sites.id %>
  26. <% f.fields_for :sites do |site| -%>
  27. <%= site.check_box sites.id, :is_confirmed %>
  28. <% end -%>
  29. <%= f.submit "Confirm Site", :disable_with => 'Confirming...' %>
  30. <% end -%>
  31. </td>
  32. </tr>
  33. <% end %>
  34. </table>
  35. <% end %>
  36. </div>
  37. <div style="width:45%; float:right; margin-right:25px">
  38. <h1>Approved Sites</h1>
  39. <table class="index">
  40. <tr>
  41. <th>Contest Name</th>
  42. <th>Host name</th>
  43. <th>City</th>
  44. <th>State</th>
  45. <th style="width:120px;">Date of Competition</th>
  46. <th style="width:40px;">Edit</th>
  47. </tr>
  48. <% @approved_sites.each do |site| %>
  49. <!-- Filter only sites that contain the same show. -->
  50. <!-- Removed because we want to see sites that don't contain that show, so we can watch for duplicate sites. -->
  51. <!-- A more useful filter is the javascript state filter. -->
  52. <%# next if site.line_items.select { |line_item| line_item.id == object.line_item_id }.size == 0 %>
  53. <tr>
  54. <td><%= site.name %></td>
  55. <td><%= site.host_name %></td>
  56. <td><%= site.city %></td>
  57. <td><%= site.state.abbr %></td>
  58. <td><%= site.competition_date ? site.competition_date.to_date : "No Date Given" %></td>
  59. <td><%= site.is_confirmed.inspect %></td>
  60. </tr>
  61. <% site.line_items.each do |line_item| %>
  62. <tr>
  63. <td><%= line_item.order.id %></td>
  64. <td colspan="5"><%= line_item.product.name %></td>
  65. </tr>
  66. <% end %>
  67. <tr>
  68. <td colspan="6">
  69. <% unless site.line_items.select { |line_item| line_item.id == object.line_item_id }.size > 0 %>
  70. <% form_for object_path, :url => { :controller => "approvals", :action => "update" }, :html => {:method => "put"} do |f| -%>
  71. <%= hidden_field_tag :site_id, site.id %>
  72. <%= f.submit "Add #{object.line_item.product.name} to this site", :disable_with => 'Adding...' %>
  73. <% end -%>
  74. <% end %>
  75. </td>
  76. </tr>
  77. <% end %>
  78. </table>
  79. </div>
Add Comment
Please, Sign In to add comment