Looking for changes on website content https://projet-alice-demo.herokuapp.com/diffs/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

144 lines
4.6KB

  1. <div class="tabs js-tabs">
  2. <nav class="tabs-menu">
  3. <a href="#tab-groups" class="tabs-menu-link is-active"><%= t(:groups) %></a>
  4. <a href="#tab-templates" class="tabs-menu-link"><%= t(:templates) %></a>
  5. <a href="#tab-sites" class="tabs-menu-link"><%= t(:sites_without_group) %></a>
  6. </nav>
  7. <div class="tabs-content">
  8. <div id="tab-groups" class="tabs-content-item">
  9. <div class="mbs">
  10. <%= link_to t(:new_group), new_group_path %>
  11. </div>
  12. <ul class="unstyled">
  13. <% @groups.each do |group| %>
  14. <li><%= link_to (group.name||group.id), edit_group_path(group) %>
  15. <% if session[:authenticated] %>
  16. |
  17. <%= link_to :remove, group, method: :delete, data: { confirm: "Are you sure you want to remove this group ("+(group.name||group.id)+") and all related data? This cannot be revert!" } %>
  18. <% end %>
  19. </li>
  20. <% if group.targets %>
  21. <ul>
  22. <li><%= :targets %>:</li>
  23. <ul>
  24. <% group.targets.each do |target| %>
  25. <li><%= :name %>: <%= target.name||target.id %></li>
  26. <% unless target.css.blank? %>
  27. <li class="separator"><%= :css %>: <%= content_tag :code do target.css end %></li>
  28. <% else %>
  29. <li><%= :from %>: <%= content_tag :code do target.from end %></li>
  30. <li class="separator"><%= :to %>: <%= content_tag :code do target.to end %></li>
  31. <% end %>
  32. <% end %>
  33. </ul>
  34. </ul>
  35. <% end %>
  36. <% if group.template %>
  37. <ul>
  38. <li><%= :template %>:</li>
  39. <ul>
  40. <li><%= :template %>: <%= group.template.name||group.template.id %></li>
  41. </ul>
  42. </ul>
  43. <% end %>
  44. <% unless group.sites.empty? %>
  45. <ul class="sites">
  46. <li><%= t(:list_of) %> <%= group.sites.count %> sites: <button>+</button></li>
  47. <ul class="hidden">
  48. <% group.sites.order(:name, :url).each do |site| %>
  49. <li><%= link_to (site.name || site.url), site %></li>
  50. <% end %>
  51. </ul>
  52. </ul>
  53. <% end %>
  54. <% end %>
  55. </ul>
  56. <div class="mts">
  57. <%= link_to t(:new_group), new_group_path %>
  58. </div>
  59. </div>
  60. <div id="tab-templates" class="tabs-content-item">
  61. <div class="mbs">
  62. <%= link_to t(:new_template), new_template_path %>
  63. </div>
  64. <ul class="unstyled">
  65. <% @templates.each do |template| %>
  66. <li>
  67. <%= link_to (template.name||template.id), edit_template_path(template) %>
  68. <% if session[:authenticated] %>
  69. |
  70. <%= link_to :remove, template, method: :delete, data: { confirm: "Are you sure you want to remove this template ("+(template.name||template.id)+") and all related data? This cannot be revert!" } %>
  71. <% end %>
  72. </li>
  73. <% unless template.targets.empty? %>
  74. <ul>
  75. <li><%= :targets %>:</li>
  76. <ul>
  77. <% template.targets.each do |target| %>
  78. <li><%= :name %>: <%= target.name||target.id %></li>
  79. <% unless target.css.blank? %>
  80. <li class="separator"><%= :css %>: <%= content_tag :code do target.css end %></li>
  81. <% else %>
  82. <li><%= :from %>: <%= content_tag :code do target.from end %></li>
  83. <li class="separator"><%= :to %>: <%= content_tag :code do target.to end %></li>
  84. <% end %>
  85. <% end %>
  86. </ul>
  87. </ul>
  88. <% end %>
  89. <% end %>
  90. </ul>
  91. <div class="mts">
  92. <%= link_to t(:new_template), new_template_path %>
  93. </div>
  94. </div>
  95. <div id="tab-sites" class="tabs-content-item">
  96. <div class="mbs">
  97. <%= link_to t(:new_site), new_site_path %>
  98. </div>
  99. <ul class="unstyled">
  100. <% @sites.each do |site| %>
  101. <li>
  102. <%= link_to (site.name||site.url), edit_site_path(site) %> |
  103. <%= link_to :show, site %>
  104. <% if session[:authenticated] %>
  105. |
  106. <%= link_to :remove, site, method: :delete, data: { confirm: "Are you sure you want to remove this site ("+(site.name||site.id)+") and all related data? This cannot be revert!" } %>
  107. <% end %>
  108. </li>
  109. <% unless site.targets.empty? %>
  110. <ul>
  111. <li><%= :targets %>:</li>
  112. <ul>
  113. <% site.targets.each do |target| %>
  114. <li><%= :name %>: <%= target.name||target.id %></li>
  115. <% unless target.css.blank? %>
  116. <li><%= :css %>: <%= content_tag :code do target.css end %></li>
  117. <% else %>
  118. <li><%= :from %>: <%= content_tag :code do target.from end %></li>
  119. <li><%= :to %>: <%= content_tag :code do target.to end %></li>
  120. <% end %>
  121. <% end %>
  122. </ul>
  123. </ul>
  124. <% end %>
  125. <% if site.template %>
  126. <ul>
  127. <li><%= :template %>: <%= site.template.name||site.template.id %></li>
  128. </ul>
  129. <% end %>
  130. <% end %>
  131. </ul>
  132. <div class="mts">
  133. <%= link_to t(:new_site), new_site_path %>
  134. </div>
  135. </div>
  136. </div>
  137. </div>