-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
_questions.html.erb
28 lines (27 loc) · 1.21 KB
/
_questions.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<% questions = questions || @questions # accept local if present, default to instance %>
<div class="card-view questions-page row">
<% questions.each_with_index do |node,i| %>
<div class="<% if @widget %>col-xs-4 col-sm-4 col-md-4 <% end %>col-lg-4" style="margin-top:20px;">
<div class="card bg-white rounded<% if node.status == 4 %> moderated<% end %>">
<div class="card-header">
<%= render partial: 'dashboard/node_moderate', locals: { node: node } %>
<h4><a <% if @widget %>target="_blank"<% end %> href="<%= node.path(:question) %>"><%= node.title %></a></h4>
</div>
<div class="card-footer">
<p class="meta"><%= render partial: "dashboard/node_meta", locals: { node: node } %></p>
</div>
</div>
</div>
<% unless @widget %><hr class="d-lg-none" /><% end %>
<% if ((i+1)/3.0).to_i == ((i+1)/3.0) %>
<% unless @widget %><hr class="d-lg-none grid" /><% end %>
<% end %>
<% end %>
</div>
<div class="text-center mt-3">
<% if @pagy %>
<%== pagy_bootstrap_nav @pagy %>
<% else %>
<%= will_paginate questions, :renderer => WillPaginate::ActionView::BootstrapLinkRenderer unless @unpaginated || questions.empty? %>
<% end %>
</div>