Newer
Older
dmpopidor / app / views / org_admin / plans / index.html.erb
<% title "#{current_user.org.name} Plans" %>
<div class="row">
  <div class="col-md-12">
    <h1><%= _('%{org_name} Plans') % { org_name: current_user.org.name } %></h1>
  </div>
</div>

<div class="row">
  <div class="col-md-12">
    <% if @feedback_plans.length > 0 %>
      <h2><%= _('Notifications') %></h2>
      <div class="panel panel-default">
        <div class="panel-body notifications">
          <table class="table">
            <thead>
              <th scope="col"><%= _('Plan') %></th>
              <th scope="col"><%= _('Requestor') %></th>
              <th scope="col"><%= _('Type') %></th>
              <th scope="col"><%= _('Actions') %></th>
            </thead>
            <tbody>
              <% @feedback_plans.each do |notice| %>
                <!-- Using the plan owner as the requestor even though it could have been issued by a co-owner -->
                <!-- TODO: correct this behavior once the notification table is in place -->
                <tr>
                  <td><%= link_to notice.name, plan_path(notice) %></td>
                  <td><%= notice.owner&.name(false) %></td>
                  <td><%= _('Feedback requested') %></td>
                  <td><%= link_to _('Complete'), feedback_complete_org_admin_plan_path(notice), 'data-toggle': 'tooltip', title: _('Notify the plan owner that I have finished providing feedback') %></td>
                </tr>
              <% end %>
            </tbody>
          </table>
        </div>
      </div>
    <% end %>
    <% if @plans.length > 0 %>
      <%= link_to sanitize(_('Download plans <em class="sr-only">(new window)</em><span class="new-window-popup-info">%{open_in_new_window_text}</span>') %
                           { open_in_new_window_text: _('Opens in new window') },
                           tags: %w{ span em }),
                  org_admin_download_plans_path(format: :csv),
                  target: '_blank',
                  class: 'btn btn-default pull-right has-new-window-popup-info' %>
      <%= paginable_renderise(
        partial: '/paginable/plans/org_admin',
        controller: 'paginable/plans',
        action: 'org_admin',
        scope: @plans,
        query_params: { sort_field: 'plans.updated_at', sort_direction: :desc }) %>
    <% end %>
  </div>
</div>