Advertisement
Guest User

awbg

a guest
Nov 20th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. <%= stylesheet_link_tag "main" %>
  2.  
  3. <div id="main">
  4.  
  5.  
  6.  
  7. <div id="AlertDiv"><h1>Задачи</h1></div>
  8.  
  9. <div id="ab">
  10. <% @proj.each do |product| %>
  11. <div id="showTodos">
  12. <h3><%= product.title %></h3>
  13. <div id="line">
  14. </div>
  15. <dl>
  16. <% @todos.where(id_project: product.id).each do |td| %>
  17. <%= link_to getForm_url, remote: true,:class => 'specific_service',
  18. :data => {:id => td.id},:onclick =>
  19. " var id = $(this).data('id');
  20.  
  21. alert(id);
  22. var thisInput = $(this).find('input[type=checkbox]');
  23. var checked = thisInput.is(':checked');
  24. thisInput[0].checked = (checked) ? false : true;
  25. var latDisplay = document.getElementById('id_todo');
  26. latDisplay.value = id;
  27. var latDisplay = document.getElementById('todo_completed');
  28. latDisplay.value = checked;
  29. $('#form_post_id').submit();" do %>
  30. <div id="my-div">
  31. <%= form_for :article, url: postForm_url,:method=> 'post',remote:true, :html => {:id=>'form_post_id'}, class: "nifty_form" do |f| %>
  32. <%=hidden_field_tag :id_todo %>
  33. <%=hidden_field_tag :todo_completed %>
  34. <dd>
  35.  
  36. <div class="row"><input type="checkbox" value="<%=td.id %>> <span id="span"><%= td.text %></span></div>
  37. </dd>
  38. <script type="application/javascript">
  39. var isCompleted = <%=td.isCompleted%>;
  40. var thisInput = $(187).find('input[type=checkbox]');
  41. var id = thisInput.attr('value');
  42. alert(id);
  43.  
  44. </script>
  45. <% end %>
  46. </div>
  47. <% end %>
  48. <% end %>
  49. </dl>
  50.  
  51. </div>
  52.  
  53. <% end %>
  54. </div>
  55.  
  56.  
  57.  
  58. <h3>Новая задача</h3>
  59. <%= link_to new_post_path,remote:true,id:"new_link2" do %>
  60. <%= image_tag "addTodoIcon.png", class: "some css class here" %>
  61. <% end %>
  62.  
  63.  
  64. <div id="without_button" style="display: none">
  65. <%= form_for :post1, url: posts_path,:method=> 'post', :html => {:id=>'form_id'} do |f| %>
  66. <p><%= f.text_field :text, placeholder: "Название задачи.." %></p>
  67. <%= f.collection_select :category, Project.all, :id, :title, id: "1234" %>
  68. <p>
  69. <%= link_to "ОТМЕНА",posts_path, remote: true, id:"new_link" %>
  70. <%= link_to 'ОК', "#", :onclick => "$('#form_id').submit()" %>
  71. </p>
  72. </div>
  73. <% end %>
  74. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement