access_token.mustache 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. <% access_token ||= nil %>
  19. <tr class="access_token <%= 'blank' unless access_token %>" style="<%= hidden unless access_token %>">
  20. <td class="app_name"><%= access_token.try(:app_name) || t(:default_app_name, "No App") %></td>
  21. <td class="purpose"><%= access_token.try(:purpose) || nbsp %></td>
  22. <td class="dates">
  23. <table class="subtable" role="presentation">
  24. <tr>
  25. <td><%= before_label(:token_expires, "Expires") %></td>
  26. <td class="expires nobr"><%= datetime_string(access_token.try(:expires_at)) || t('profile.token_never_expires', 'never') %></td>
  27. </tr><tr>
  28. <td class="nobr"><%= before_label(:token_last_used, "Last Used") %></td>
  29. <td class="used nobr"><%= datetime_string(access_token.try(:last_used_at)) || '--' %></td>
  30. </tr>
  31. </table>
  32. </td>
  33. <td>
  34. <a href="#" rel="<%= profile_token_url(access_token.try(:id) || "{{ id }}") %>" class="show_token_link">{{#t}}details{{/t}}</a>
  35. </td>
  36. <td class="links">
  37. <% unless @real_current_user %>
  38. <a href="#" class="delete_key_link" rel="<%= profile_token_url(access_token.try(:id) || "{{ id }}") %>" title="{{#t}}Delete this Token{{/t}}"><i class="icon-trash" role="presentation"></i></a>
  39. <% end %>
  40. </td>
  41. </tr>