The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
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.

Settings.cshtml 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. @model Teknik.Areas.Users.ViewModels.SettingsViewModel
  2. @using Teknik.Helpers
  3. <script>
  4. var homeUrl = '@Url.SubRouteUrl("www", "Home.Index")';
  5. var editUserURL = '@Url.SubRouteUrl("user", "User.Action", new { action = "Edit" })';
  6. var deleteUserURL = '@Url.SubRouteUrl("user", "User.Action", new { action = "Delete" })';
  7. var resendVerifyURL = '@Url.SubRouteUrl("user", "User.Action", new { action = "ResendVerifyRecoveryEmail"})';
  8. </script>
  9. @Styles.Render("~/Content/user")
  10. @Scripts.Render("~/bundles/user")
  11. <div class="container">
  12. @if (!Model.Error)
  13. {
  14. <div class="row">
  15. <div class="col-sm-12">
  16. <form class="form" action="##" method="post" id="updateForm">
  17. <input name="update_userid" id="update_userid" type="hidden" value="@Model.UserID" />
  18. <!-- Tab Navigation -->
  19. <ul class="nav nav-tabs" id="settingTabs">
  20. <li class="active"><a href="#profile" data-toggle="tab"> Profile </a></li>
  21. <li><a href="#security" data-toggle="tab"> Security </a></li>
  22. <li><a href="#blog" data-toggle="tab"> Blog </a></li>
  23. <li><a href="#uploads" data-toggle="tab"> Uploads </a></li>
  24. </ul>
  25. <div class="tab-content">
  26. <!-- Profile Settings -->
  27. <div class="tab-pane active" id="profile">
  28. <div class="row">
  29. <div class="form-group col-sm-4">
  30. <label for="update_website"><h4>Website</h4></label>
  31. <input class="form-control" id="update_website" name="update_website" placeholder="http://www.noneofyourbusiness.com/" title="enter your website" type="text" value="@Model.UserSettings.Website" />
  32. </div>
  33. <div class="form-group col-sm-8">
  34. <label for="update_quote"><h4>Quote</h4></label>
  35. <input class="form-control" id="update_quote" name="update_quote" placeholder="I have a dream!" title="enter a memorable quote" type="text" value="@Model.UserSettings.Quote" maxlength="140" />
  36. </div>
  37. </div>
  38. <div class="row">
  39. <div class="form-group col-sm-12">
  40. <label for="update_about"><h4>About Yourself</h4></label>
  41. <textarea class="form-control" name="update_about" id="update_about" placeholder="I'm awesome" title="enter any information you want to share with the world." data-provide="markdown" rows="10">@Model.UserSettings.About</textarea>
  42. </div>
  43. </div>
  44. </div>
  45. <!-- Security Settings -->
  46. <div class="tab-pane" id="security">
  47. <div class="row">
  48. <div class="col-sm-4">
  49. <div class="row">
  50. <div class="form-group col-sm-12">
  51. <label for="update_password_current"><h4>Current Password</h4></label>
  52. <input class="form-control" name="update_password_current" id="update_password_current" placeholder="current password" title="enter your current password." type="password" />
  53. </div>
  54. </div>
  55. <div class="row">
  56. <div class="form-group col-sm-12">
  57. <label for="update_password"><h4>New Password</h4></label>
  58. <input class="form-control" name="update_password" id="update_password" placeholder="new password" title="enter your password." type="password" />
  59. </div>
  60. </div>
  61. <div class="row">
  62. <div class="form-group col-sm-12">
  63. <label for="update_password_confirm"><h4>Verify New Password</h4></label>
  64. <input class="form-control" name="update_password_confirm" id="update_password_confirm" placeholder="new password confirmed" title="enter your password again." type="password" />
  65. </div>
  66. </div>
  67. </div>
  68. <div class="col-sm-8">
  69. <label for="update_pgp_public_key"><h4>Public Key</h4></label>
  70. <textarea class="form-control" id="update_pgp_public_key" name="update_pgp_public_key" placeholder="Public Key Here" title="enter your pgp public key" rows="15">@Model.UserSettings.PGPSignature</textarea>
  71. </div>
  72. </div>
  73. <div class="row">
  74. <div class="col-sm-4">
  75. <div class="row">
  76. <div class="form-group col-sm-12">
  77. <label for="update_recovery_email"><h4>Recovery Email</h4></label>
  78. <input class="form-control" name="update_recovery_email" id="update_recovery_email" placeholder="user@example.com" title="enter a recovery email." type="text" value="@Model.RecoveryEmail" />
  79. @if (!string.IsNullOrEmpty(Model.RecoveryEmail))
  80. {
  81. <p class="form-control-static">
  82. @if (Model.RecoveryVerified)
  83. {
  84. <span class="text-success"><i class="fa fa-check"></i> Verified</span>
  85. }
  86. else
  87. {
  88. <span class="text-danger"><i class="fa fa-ban"></i> Unverified</span> <small><a href="#" class="text-primary" id="ResendVerification"><i class="fa fa-repeat"></i> Resend</a></small>
  89. }
  90. </p>
  91. }
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. <!-- Blog Settings -->
  98. <div class="tab-pane" id="blog">
  99. <div class="row">
  100. <div class="form-group col-sm-6">
  101. <label for="update_blog_title"><h4>Title</h4></label>
  102. <input class="form-control" id="update_blog_title" name="update_blog_title" placeholder="click bait" title="enter your blog's title" type="text" value="@Model.BlogSettings.Title" />
  103. </div>
  104. <div class="form-group col-sm-6">
  105. <label for="update_blog_description"><h4>Description</h4></label>
  106. <input class="form-control" id="update_blog_description" name="update_blog_description" placeholder="This blog is not worth reading." title="enter your blog's description" type="text" value="@Model.BlogSettings.Description" />
  107. </div>
  108. </div>
  109. </div>
  110. <!-- Upload Settings -->
  111. <div class="tab-pane" id="uploads">
  112. <div class="row">
  113. <div class="col-sm-6">
  114. <div class="checkbox">
  115. <label>
  116. <label for="update_upload_saveKey"><h4>Save Key on Server</h4></label>
  117. <input id="update_upload_saveKey" name="update_upload_saveKey" title="whether the key should be saved on the server or not" type="checkbox" value="true" @(Model.UploadSettings.SaveKey ? "checked" : string.Empty) />
  118. </label>
  119. </div>
  120. </div>
  121. <div class="col-sm-6">
  122. <div class="checkbox">
  123. <label>
  124. <label for="update_upload_serverSideEncrypt"><h4>Encrypt on Server Side</h4></label>
  125. <input id="update_upload_serverSideEncrypt" name="update_upload_serverSideEncrypt" title="whether the file should be encrypted server side or client side" type="checkbox" value="true" @(Model.UploadSettings.ServerSideEncrypt ? "checked" : string.Empty) />
  126. </label>
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. <!-- Save Settings -->
  133. <div class="row">
  134. <div class="form-group col-sm-10">
  135. <br />
  136. <button class="btn btn-lg btn-success" id="update_submit" type="submit"><i class="glyphicon glyphicon-ok-sign"></i> Save</button>
  137. <button class="btn btn-lg" type="reset"><i class="glyphicon glyphicon-repeat"></i> Reset</button>
  138. </div>
  139. <div class="form-group col-sm-2">
  140. <br />
  141. <button type="button" class="btn btn-danger" id="delete_account">Delete Account</button>
  142. </div>
  143. </div>
  144. </form>
  145. </div><!--/col-9-->
  146. </div><!--/row-->
  147. }
  148. else
  149. {
  150. <div class="row">
  151. <div class="col-sm-12 text-center">
  152. <h2>Sorry, but I couldn't find that user.</h2>
  153. </div>
  154. </div>
  155. }
  156. </div>