Order admin poll list by starts_at date
This commit is contained in:
@@ -6,6 +6,7 @@ class Admin::Poll::PollsController < Admin::Poll::BaseController
|
||||
before_action :load_geozones, only: [:new, :create, :edit, :update]
|
||||
|
||||
def index
|
||||
@polls = Poll.order(starts_at: :desc)
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
@@ -4,19 +4,19 @@
|
||||
<%= link_to poll.name, admin_poll_path(poll) %>
|
||||
</strong>
|
||||
</td>
|
||||
<td>
|
||||
<%= l poll.starts_at.to_date %> - <%= l poll.ends_at.to_date %>
|
||||
<td class="text-center">
|
||||
<%= l poll.starts_at.to_date %>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<div class="small-6 column">
|
||||
<td class="text-center">
|
||||
<%= l poll.ends_at.to_date %>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to t("admin.actions.edit"),
|
||||
edit_admin_poll_path(poll),
|
||||
class: "button hollow expanded" %>
|
||||
</div>
|
||||
<div class="small-6 column">
|
||||
class: "button hollow" %>
|
||||
|
||||
<%= link_to t("admin.actions.configure"),
|
||||
admin_poll_path(poll),
|
||||
class: "button hollow expanded" %>
|
||||
</div>
|
||||
class: "button hollow " %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -7,8 +7,9 @@
|
||||
<% if @polls.any? %>
|
||||
<table>
|
||||
<thead>
|
||||
<th class="small-6"><%= t("admin.polls.index.name") %></th>
|
||||
<th><%= t("admin.polls.index.dates") %></th>
|
||||
<th class="small-5"><%= t("admin.polls.index.name") %></th>
|
||||
<th class="text-center"><%= t("admin.polls.index.start_date") %></th>
|
||||
<th class="text-center"><%= t("admin.polls.index.closing_date") %></th>
|
||||
<th><%= t("admin.actions.actions") %></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
Reference in New Issue
Block a user