Guest User

Untitled

a guest
Nov 20th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.00 KB | None | 0 0
  1.  
  2. <%- model_class = @model_class unless @model_class.nil? -%>
  3.  
  4. <div class="page-header">
  5. <h1><%=t 'common.search_result.title' %></h1>
  6. </div>
  7. <% unless model_class.nil?%>
  8. <div class = "results box">
  9. <table class="table table-condensed">
  10. <thead>
  11. <tr>
  12. <% model_columns_collection(@model_class,whitelist = true).each do |column|%>
  13. <th><%= model_class.human_attribute_name(column[1]) %></th>
  14. <% end %>
  15. <th><%=t '.actions', :default => t("helpers.actions") %></th>
  16. </tr>
  17. </thead>
  18. <tbody>
  19. <% if @results.present? %>
  20. <% @results.each do |result| %>
  21. <tr>
  22. <% model_columns_collection(@model_class,whitelist = true).each do |column|%>
  23. <td><%= result.read_attribute(column[1]) %></td>
  24. <% end %>
  25. <td>
  26. <% if self.respond_to? "auth_#{result.class.to_s.underscore.gsub("/","_")}_path" %>
  27. <%= link_to t('.show', :default => t("helpers.links.show", :model => model_class.model_name.human)),
  28. send("auth_#{result.class.to_s.underscore.gsub("/","_")}_path", result), :class => 'btn btn-mini' %>
  29. <%= link_to t('.edit', :default => t("helpers.links.edit", :model => model_class.model_name.human)),
  30. send("edit_auth_#{result.class.to_s.underscore.gsub("/","_")}_path", result), :class => 'btn btn-mini' %>
  31. <!--%= link_to t('.destroy', :default => t("helpers.links.destroy", :model => model_class.model_name.human)),
  32. send("auth_#{result.class.to_s.underscore.gsub("/","_")}_path", result)
  33. :method => :delete,
  34. :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')),
  35. :class => 'btn btn-mini btn-danger' %-->
  36. <% else %>
  37. <%= link_to t('.show', :default => t("helpers.links.show", :model => model_class.model_name.human)),
  38. send("#{result.class.to_s.underscore.gsub("/","_")}_path", result), :class => 'btn btn-mini' %>
  39. <%= link_to t('.edit', :default => t("helpers.links.edit", :model => model_class.model_name.human)),
  40. send("edit_#{result.class.to_s.underscore.gsub("/","_")}_path", result), :class => 'btn btn-mini' %>
  41. <!--%= link_to t('.destroy', :default => t("helpers.links.destroy", :model => model_class.model_name.human)),
  42. send("#{result.class.to_s.underscore.gsub("/","_")}_path", result)
  43. :method => :delete,
  44. :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')),
  45. :class => 'btn btn-mini btn-danger' %-->
  46. <% end %>
  47. </td>
  48. </tr>
  49. <% end %>
  50. <% end %>
  51. </tbody>
  52. </table>
  53.  
  54. </div>
  55. <% end %>
Add Comment
Please, Sign In to add comment