<%
# 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 class="rubric_dialog" id="rubric_dialog" style="display: none;">
  <h2 class="pull-left"><%= t 'titles.find_a_rubric', "Find a Rubric" %></h2>
  <a style="float: <%= direction('right') %>;" href="<%= context_url(@context, :context_rubrics_url) %>"><%= t 'links.manage_rubrics', "Manage Rubrics" %></a>
  <a href="<%= context_url(@context, :context_grading_rubrics_url) %>" class="grading_rubrics_url" style="display: none;">&nbsp;</a>
  <div class="clear"></div>
  <div class="loading_message" style="margin: 10px; text-align: center;">
  </div>
  <% css_bundle("side_tabs_table") %>
  <table class="rubrics_dialog_rubrics_holder side_tabs_table" style="display: none;">
    <tr>
      <td class="left far_left">
        <ul class="rubrics_dialog_contexts_select unstyled_list side_tabs">
          <li class="rubrics_dialog_context_select blank" style="display: none;">
            <a href="#">
              <span class="name">&nbsp;</span>
              <span class="context_code" style="display: none;">&nbsp;</span>
            </a>
            <div class="rubrics" style="font-size: 0.8em; color: #aaa;">&nbsp;</div>
          </li>
        </ul>
      </td>
      <td class="left">
        <div class="rubrics_loading_message" style="display: none; padding: 0 5px;">
        </div>
        <ul class="rubrics_dialog_rubrics_select unstyled_list side_tabs">
          <li class="rubrics_dialog_rubric_select blank" style="display: none;">
            <a href="#">
              <span class="title">&nbsp;</span>
              <span class="id" style="display: none;">&nbsp;</span>
            </a>
            <div class="rubrics" style="font-size: 0.8em; color: #aaa;">
              <%= t :criterion_count, "%{count} criteria", :count => '<span class="criterion_count">&nbsp;</span>'.html_safe %><br/>
              <%= t :points_possible, "%{points} points possible", :points => '<span class="points_possible">&nbsp;</span>'.html_safe %>
            </div>
          </li>
        </ul>
      </td>
      <td class="right">
        <div class="side_tabs_content rubrics_dialog_rubrics">
          <div style="margin-bottom: 10px; display: none;" class="rubrics_dialog_rubric blank">
            <div style="margin-bottom: 10px;" class="rubrics_dialog_rubric_brief side_tabs_content_with_room_for_button">
              <span class="id" style="display: none;">&nbsp;</span>
              <div>
                <div class="pull-left">
                  <a href="#" class="select_rubric_link"><b class="title">&nbsp;</b></a>
                  <span class="display_name" style="padding-<%= direction('left') %>: 10px; font-size: 0.8em; color: #888;">
                    &nbsp;
                  </span>
                </div>
                <div class="clear"></div>
              </div>
              <div style="margin-<%= direction('left') %>: 5px;" class="details">
                <%= render :partial => "shared/rubric_summary", :object => nil, :locals => {:brief => true} %>
              </div>
              <div class="clear"></div>
            </div>
            <button type="button" class="btn select_rubric_link"><%= t 'buttons.use_this_rubric', "Use This Rubric" %></button>
          </div>
        </div>
      </td>
    </tr>
  </table>
  <div style="margin-top: 5px; text-align: <%= direction('right') %>; display: none;"><a href="#" class="cancel_find_rubric_link"><%= t '#buttons.cancel', "Cancel" %></a></div>
  <div style="display: none;">
    <a href="<%= context_url(@context, :context_assignment_url, assignment.id) %>" style="display: none;" class="update_rubric_url">&nbsp;</a>
    <a href="<%= context_url(@context, :context_rubric_associations_url) %>" class="select_rubric_url">&nbsp;</a>
    <span class="rubric_association_type">Assignment</span>
    <span class="rubric_association_id"><%= assignment.id %></span>
    <span class="rubric_association_purpose">grading</span>
  </div>
</div>