<%
# Copyright (C) 2011 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
%>

<div id="message_students_dialog" style="display: none;">
  <%= form_tag conversations_url, :id => "message_assignment_recipients" do %>
    <%= hidden_field_tag :recipients, "", :class => "recipient_ids" %>
    <%= hidden_field_tag :group_conversation, "true" %>
    <%= hidden_field_tag :bulk_message, "true" %>
    <%= hidden_field_tag :context_code, "" %>
    <%= hidden_field_tag :mode, "async" %>
    <h2><%= t('Message students who...') %></h2>
    <div style="margin-bottom: 15px;">
      <%= t('for %{title}', :title => '<span class="asset_title">&nbsp;</span>'.html_safe) %>
    </div>
    <div style="margin-bottom: 10px;">
      <select class="message_types" aria-label="<%= t("Message Type") %>">
      </select>
      <span class="cutoff_holder">
        <input type="text" class="cutoff_score" style="width: 3em;" aria-label="<%= t("cutoff score") %>" aria-describedby="out_of" />
        <span class="out_of" id="out_of">
          <%= t('out of %{points_possible}', :points_possible => '<span class="points_possible">&nbsp;</span>'.html_safe) %>
        </span>
      </span>
    </div>
    <ul class="student_list">
      <li class="student blank" style="display: none;">
        <span class="name">&nbsp;</span>
        <span class="score">&nbsp;</span>
        <button class="remove-button Button Button--icon-action"><i class="icon-x"></i></button>
      </li>
    </ul>
    <div class="clear"></div>
    <table class="formtable" style="width: 100%;">
      <tr>
        <td style="font-weight: bold;" colspan="2">
          <%= label_tag :subject, before_label(:subject, "Subject") %>
          <%= text_field_tag :subject, "", :style => "width: 90%;" %>
        </td>
      </tr>
      <tr>
        <td style="font-weight: bold;" colspan="2">
          <%= label_tag :body, before_label(:body, "Message") %>
          <%= text_area_tag :body, "", :style => "width: 90%; height: 100px;" %>
        </td>
      </tr>
    </table>
    <div class="button-container">
      <button class="Button cancel_button"><%= t("Cancel") %></button>
      <button type="submit" class="Button Button--primary send_button"><%= t('Send Message') %></button>
    </div>
  <% end %>
</div>
