%
# 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 .
%>
<% event ||= nil %>
<% is_assignment = event.respond_to?(:due_at)
full_id = 'event_blank'
if event
if is_assignment
full_id = 'event_assignment_' + event.id.to_s
else
full_id = 'event_calendar_event_' + event.id.to_s
end
end
title_text = event ? ("#{event.title} - #{time_string(event.start_at, event.end_at)}") : ""
title_text = t(:event_title, "due: %{event_title}", :event_title => title_text) if title_text && !title_text.empty? && is_assignment
%>
<%= "draggable" if can_do(event, @current_user, :update) %>" id="<%= full_id %>" style="<%= event ? '' : 'display: none;' %>" title="<%= title_text %>">
<%= t :due, "due" %>
<% if is_assignment %>
<%= event.title rescue ""%>
<% else %>
<%= event.title rescue ""%>
<% end %>