You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

keys_principal.tmpl 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. {{if .AllowPrincipals}}
  2. <h4 class="ui top attached header">
  3. {{ctx.Locale.Tr "settings.manage_ssh_principals"}}
  4. <div class="ui right">
  5. {{if not .DisableSSH}}
  6. <button class="ui primary tiny show-panel button" data-panel="#add-ssh-principal-panel">{{ctx.Locale.Tr "settings.add_new_principal"}}</button>
  7. {{else}}
  8. <button class="ui primary tiny button disabled">{{ctx.Locale.Tr "settings.ssh_disabled"}}</button>
  9. {{end}}
  10. </div>
  11. </h4>
  12. <div class="ui attached segment">
  13. <div class="flex-list">
  14. <div class="flex-item">
  15. {{ctx.Locale.Tr "settings.principal_desc"}}
  16. </div>
  17. {{range .Principals}}
  18. <div class="flex-item">
  19. <div class="flex-item-leading">
  20. <span class="text {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-tooltip-content="{{ctx.Locale.Tr "settings.principal_state_desc"}}"{{end}}>{{svg "octicon-key" 32}}</span>
  21. </div>
  22. <div class="flex-item-main">
  23. <div class="flex-item-title">{{.Name}}</div>
  24. <div class="flex-item-body">
  25. <i>{{ctx.Locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix) | Safe}} — {{svg "octicon-info" 16}} {{if .HasUsed}}{{ctx.Locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="green"{{end}}>{{DateTime "short" .UpdatedUnix}}</span>{{else}}{{ctx.Locale.Tr "settings.no_activity"}}{{end}}</i>
  26. </div>
  27. </div>
  28. <div class="flex-item-trailing">
  29. <button class="ui red tiny button delete-button" data-modal-id="delete-principal" data-url="{{$.Link}}/delete?type=principal" data-id="{{.ID}}">
  30. {{ctx.Locale.Tr "settings.delete_key"}}
  31. </button>
  32. </div>
  33. </div>
  34. {{end}}
  35. </div>
  36. </div>
  37. <br>
  38. <div {{if not .HasPrincipalError}}class="gt-hidden"{{end}} id="add-ssh-principal-panel">
  39. <h4 class="ui top attached header">
  40. {{ctx.Locale.Tr "settings.add_new_principal"}}
  41. </h4>
  42. <div class="ui attached segment">
  43. <form class="ui form" action="{{.Link}}" method="post">
  44. {{.CsrfTokenHtml}}
  45. <div class="field {{if .Err_Content}}error{{end}}">
  46. <label for="content">{{ctx.Locale.Tr "settings.principal_content"}}</label>
  47. <input id="ssh-principal-content" name="content" value="{{.content}}" autofocus required>
  48. </div>
  49. <input name="title" type="hidden" value="principal">
  50. <input name="type" type="hidden" value="principal">
  51. <button class="ui primary button">
  52. {{ctx.Locale.Tr "settings.add_new_principal"}}
  53. </button>
  54. </form>
  55. </div>
  56. </div>
  57. <div class="ui g-modal-confirm delete modal" id="delete-principal">
  58. <div class="header">
  59. {{svg "octicon-trash"}}
  60. {{ctx.Locale.Tr "settings.ssh_principal_deletion"}}
  61. </div>
  62. <div class="content">
  63. <p>{{ctx.Locale.Tr "settings.ssh_principal_deletion_desc"}}</p>
  64. </div>
  65. {{template "base/modal_actions_confirm" .}}
  66. </div>
  67. {{end}}