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.

67 lines
4.0 KiB

  1. {{template "base/head" .}}
  2. {{template "base/navbar" .}}
  3. <div id="gogs-body" class="container">
  4. <div id="gogs-user-setting-nav" class="col-md-3">
  5. <h4>Account Setting</h4>
  6. <ul class="list-group">
  7. <li class="list-group-item"><a href="/user/setting">Account Profile</a></li>
  8. <li class="list-group-item"><a href="/user/setting/password">Password</a></li>
  9. <li class="list-group-item"><a href="/user/setting/notification">Notifications</a></li>
  10. <li class="list-group-item list-group-item-success"><a href="/user/setting/ssh/">SSH Keys</a></li>
  11. <li class="list-group-item"><a href="/user/setting/security">Security</a></li>
  12. <li class="list-group-item"><a href="/user/delete">Delete Account</a></li>
  13. </ul>
  14. </div>
  15. <div id="gogs-user-setting-container" class="col-md-9">
  16. <div id="gogs-ssh-keys">
  17. <h4>SSH Keys</h4>{{if .AddSSHKeySuccess}}
  18. <p class="alert alert-success">New SSH Key has been added !</p>{{else if .HasError}}<p class="alert alert-danger">{{.ErrorMsg}}</p>{{end}}
  19. <ul id="gogs-ssh-keys-list" class="list-group">
  20. <li class="list-group-item"><span class="name">SSH Key's name</span></li>
  21. {{range .Keys}}
  22. <li class="list-group-item">
  23. <span class="name">{{.Name}}</span>
  24. <span class="print">({{.Fingerprint}})</span>
  25. <button href="#" class="btn btn-danger delete pull-right" rel="{{.Id}}" data-del="{{.Id}}">Delete</button>
  26. </li>
  27. {{end}}
  28. <li class="list-group-item">
  29. <a class="btn btn-link btn-primary" href="#ssh-add-modal" id="gogs-ssh-add" data-toggle="modal">Add SSH Key</a>
  30. </li>
  31. </ul>
  32. <div class="modal fade" id="ssh-add-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  33. <div class="modal-dialog">
  34. <form class="modal-content form-horizontal" id="gogs-ssh-form" method="post" action="/user/setting/ssh/">
  35. <div class="modal-header">
  36. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  37. <h4 class="modal-title" id="myModalLabel">Add SSH Key</h4>
  38. </div>
  39. <div class="modal-body">
  40. <div class="form-group">
  41. <label class="col-md-3 control-label">The name of key<strong class="text-danger">*</strong></label>
  42. <div class="col-md-8">
  43. <input name="keyname" class="form-control" placeholder="Type your preferred name" required="required">
  44. </div>
  45. </div>
  46. <div class="form-group">
  47. <label class="col-md-3 control-label">SSH Key<strong class="text-danger">*</strong></label>
  48. <div class="col-md-8">
  49. <textarea name="key_content" class="form-control" placeholder="Type your key content" required="required"></textarea>
  50. </div>
  51. </div>
  52. </div>
  53. <div class="modal-footer">
  54. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  55. <button type="submit" class="btn btn-primary">Save SSH Key</button>
  56. </div>
  57. </form>
  58. </div>
  59. </div>
  60. <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>
  61. </div>
  62. </div>
  63. </div>
  64. {{template "base/footer" .}}