current_conference.mustache 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <%
  2. # Copyright (C) 2012 - present Instructure, Inc.
  3. #
  4. # This file is part of Canvas.
  5. #
  6. # Canvas is free software: you can redistribute it and/or modify it under
  7. # the terms of the GNU Affero General Public License as published by the Free
  8. # Software Foundation, version 3 of the License.
  9. #
  10. # Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
  11. # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. # A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
  13. # details.
  14. #
  15. # You should have received a copy of the GNU Affero General Public License along
  16. # with this program. If not, see <http://www.gnu.org/licenses/>.
  17. %>
  18. <% current_conference ||= nil %>
  19. <% conference = current_conference %>
  20. <% if conference.active?(false, false) && can_do(conference, @current_user, :join) %>
  21. <div class="ic-notification conference">
  22. <div class="ic-notification__icon" role="presentation">
  23. <i class="icon-invitation"></i>
  24. <span class="screenreader-only">
  25. <%= accessible_message_icon_text("invitation") %>
  26. </span>
  27. </div>
  28. <div class="ic-notification__content">
  29. <div class="ic-notification__message notification_message">
  30. <%=
  31. mt(:current_conference_text, "You have been invited to join **[%{conference}](%{link_to_conference})**. It started at %{started_at} and has %{participant_count}.", {
  32. :conference => conference.title,
  33. :link_to_conference => context_url(@context, :context_conference_url, conference.id),
  34. :started_at => time_string(conference.started_at),
  35. :participant_count => t(:participant_count, "participant", :count => conference.added_users.length)
  36. })
  37. %>
  38. </div>
  39. <div class="ic-notification__actions">
  40. <% if can_do(conference, @current_user, :close) %>
  41. <a href="<%= context_url(@context, :context_conference_close_url, conference.id) %>" class="btn btn-small close_conference_link">
  42. {{#t}}End it now{{/t}}
  43. </a>
  44. <% end %>
  45. <a target="_blank" href="<%= context_url(@context, :context_conference_join_url, conference.id) %>" class="Button Button--small Button--primary join_conference_link">
  46. {{#t}}Join it now{{/t}}
  47. </a>
  48. </div>
  49. </div>
  50. </div>
  51. <% end %>