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.

57 lines
3.4 KiB

10 years ago
10 years ago
10 years ago
  1. {{template "base/head" .}}
  2. {{template "base/navbar" .}}
  3. <div id="gogs-body" class="container" data-page="user">
  4. {{template "user/setting_nav" .}}
  5. <div id="gogs-user-setting-container" class="col-md-9">
  6. <div id="gogs-ssh-keys">
  7. <h4>SSH Keys</h4>{{if .AddSSHKeySuccess}}
  8. <p class="alert alert-success">New SSH Key has been added !</p>{{else if .HasError}}<p class="alert alert-danger">{{.ErrorMsg}}</p>{{end}}
  9. <ul id="gogs-ssh-keys-list" class="list-group">
  10. <li class="list-group-item"><span class="name">SSH Key's name</span></li>
  11. {{range .Keys}}
  12. <li class="list-group-item">
  13. <span class="name">{{.Name}}</span>
  14. <span class="print">({{.Fingerprint}})</span>
  15. <button href="#" class="btn btn-danger delete pull-right" rel="{{.Id}}" data-del="{{.Id}}">Delete</button>
  16. </li>
  17. {{end}}
  18. <li class="list-group-item">
  19. <a class="btn btn-link btn-primary" href="#ssh-add-modal" id="gogs-ssh-add" data-toggle="modal">Add SSH Key</a>
  20. </li>
  21. </ul>
  22. <div class="modal fade" id="ssh-add-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  23. <div class="modal-dialog">
  24. <form class="modal-content form-horizontal" id="gogs-ssh-form" method="post" action="/user/setting/ssh/">
  25. {{.CsrfTokenHtml}}
  26. <div class="modal-header">
  27. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  28. <h4 class="modal-title" id="myModalLabel">Add SSH Key</h4>
  29. </div>
  30. <div class="modal-body">
  31. <div class="form-group">
  32. <label class="col-md-3 control-label">The name of key<strong class="text-danger">*</strong></label>
  33. <div class="col-md-8">
  34. <input name="keyname" class="form-control" placeholder="Type your preferred name" required="required">
  35. </div>
  36. </div>
  37. <div class="form-group">
  38. <label class="col-md-3 control-label">SSH Key<strong class="text-danger">*</strong></label>
  39. <div class="col-md-8">
  40. <textarea name="key_content" class="form-control" placeholder="Type your key content" required="required"></textarea>
  41. </div>
  42. </div>
  43. </div>
  44. <div class="modal-footer">
  45. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  46. <button type="submit" class="btn btn-primary">Save SSH Key</button>
  47. </div>
  48. </form>
  49. </div>
  50. </div>
  51. <p><strong>Need help?</strong> Check out the guide to <a href="https://help.github.com/articles/generating-ssh-keys" target="_blank">generating SSH keys</a> or troubleshoot <a href="https://help.github.com/ssh-issues/" target="_blank">common SSH Problems</a></p>
  52. </div>
  53. </div>
  54. </div>
  55. {{template "base/footer" .}}