wiki_image.mustache 1.4 KB

123456789101112131415161718192021222324252627
  1. <%
  2. # Copyright (C) 2011 - 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. <% wiki_image ||= nil %>
  19. <% url = context_url(@context, :context_file_preview_url, wiki_image.id) if wiki_image %>
  20. <a href="#" style="text-align: center <%= hidden unless wiki_image %>" class="img_link" title="{{#t}}Click to embed image{{/t}}">
  21. <div class="img_holder">
  22. <img class="img" data-url="<%= url %>" src="<%= (wiki_image && thumbnail_image_url(wiki_image)) || url %>" alt="<%= wiki_image ? wiki_image.display_name : '{{ display_name }}' %>" title="<%= t'titles.click_to_embed', "Click to embed %{image}", :image => (wiki_image ? wiki_image.display_name : '{{ display_name }}') %>">
  23. </div>
  24. <div class="display_name"><%= wiki_image ? wiki_image.display_name : '{{ display_name }}' %></div>
  25. </a>