The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. @model Teknik.Areas.Profile.ViewModels.ProfileViewModel
  2. <script>
  3. var homeUrl = '@Url.SubRouteUrl("www", "Home.Index")';
  4. var editUserURL = '@Url.SubRouteUrl("profile", "Profile.Action", new { action = "Edit" })';
  5. var deleteUserURL = '@Url.SubRouteUrl("profile", "Profile.Action", new { action = "Delete" })';
  6. </script>
  7. @Scripts.Render("~/bundles/profile")
  8. <div class="container">
  9. @if (!Model.Error)
  10. {
  11. bool OwnProfile = (Model.Username == User.Identity.Name || User.IsInRole("Admin"));
  12. <div class="row">
  13. <div class="col-sm-3@((string.IsNullOrEmpty(Model.About) && !OwnProfile) ? " col-sm-offset-4" : string.Empty)"><h1>@Model.Username</h1></div>
  14. </div>
  15. <div class="row">
  16. <div class="col-sm-3@((string.IsNullOrEmpty(Model.About) && !OwnProfile) ? " col-sm-offset-4" : string.Empty)"><!--left col-->
  17. <ul class="list-group">
  18. <li class="list-group-item text-muted">Profile</li>
  19. <li class="list-group-item text-right"><span class="pull-left"><strong>Joined</strong></span> <time datetime="@Model.LastSeen.ToString("o")">@Model.JoinDate.ToString("MMMM dd, yyyy")</time></li>
  20. @if (OwnProfile && User.Identity.IsAuthenticated)
  21. {
  22. <li class="list-group-item text-right"><span class="pull-left"><strong>Last Seen</strong></span> <time datetime="@Model.LastSeen.ToString("o")">@Model.LastSeen.ToString("MMMM dd, yyyy")</time></li>
  23. }
  24. <li class="list-group-item text-right"><span class="pull-left"><strong>Email</strong></span> <a href="mailto:@Model.Email">@Model.Email</a></li>
  25. <li class="list-group-item text-right"><span class="pull-left"><strong>Blog</strong></span> <a href="@Url.SubRouteUrl("blog", "Blog.Blog", new { username = Model.Username })" id="blog_title">@(string.IsNullOrEmpty(Model.BlogTitle) ? string.Format("{0}'s Blog", Model.Username) : Model.BlogTitle)</a></li>
  26. <li class="list-group-item text-right"><span class="pull-left"><strong>Git</strong></span> <a href="@Url.SubRouteUrl("git", "Git.Index", new { username = Model.Username })">Public Repos</a></li>
  27. @if (OwnProfile)
  28. {
  29. <li class="list-group-item text-center"><button type="button" class="btn btn-danger" id="delete_account">Delete Account</button></li>
  30. }
  31. </ul>
  32. @if (!string.IsNullOrEmpty(Model.Website))
  33. {
  34. <div class="panel panel-default">
  35. <div class="panel-heading">Website <i class="fa fa-link fa-1x"></i></div>
  36. <div class="panel-body"><a href="@Model.Website" id="website">@Model.Website</a></div>
  37. </div>
  38. }
  39. @if (!string.IsNullOrEmpty(Model.Quote))
  40. {
  41. <div class="panel panel-default">
  42. <div class="panel-heading">Quote <i class="fa fa-quote-right fa-1x"></i></div>
  43. <div class="panel-body" id="quote">@Model.Quote</div>
  44. </div>
  45. }
  46. </div><!--/col-3-->
  47. <div class="col-sm-9">
  48. @if (!string.IsNullOrEmpty(Model.About) && OwnProfile)
  49. {
  50. <ul class="nav nav-tabs" id="myTab">
  51. @if (!string.IsNullOrEmpty(Model.About))
  52. {
  53. <li @((OwnProfile) ? string.Empty : "class=\"active\"")>
  54. <a href="#about" data-toggle="tab"> About Myself </a>
  55. </li>
  56. }
  57. @if (OwnProfile)
  58. {
  59. <li class="active"><a href="#settings" data-toggle="tab">Settings</a></li>
  60. <li><a href="#privacy" data-toggle="tab">Privacy</a></li>
  61. }
  62. </ul>
  63. }
  64. <div class="tab-content">
  65. @if (!string.IsNullOrEmpty(Model.About))
  66. {
  67. <div class="tab-pane @((!OwnProfile) ? " active" : string.Empty)" id="about">
  68. <script>
  69. $(document).ready(function () {
  70. var converter = new Markdown.getSanitizingConverter();
  71. @if (!string.IsNullOrEmpty(Model.BlogTitle))
  72. {
  73. <text>
  74. // Blog Title Conversion
  75. var old_html = $("#blog_title").text();
  76. var new_html = converter.makeHtml(old_html);
  77. $("#blog_title").html(new_html);
  78. </text>
  79. }
  80. @if (!string.IsNullOrEmpty(Model.Website))
  81. {
  82. <text>
  83. // Website Conversion
  84. var old_html = $("#website").text();
  85. var new_html = converter.makeHtml(old_html);
  86. $("#website").html(new_html);
  87. </text>
  88. }
  89. @if (!string.IsNullOrEmpty(Model.Quote))
  90. {
  91. <text>
  92. // Quote Conversion
  93. var old_html = $("#quote").text();
  94. var new_html = converter.makeHtml(old_html);
  95. $("#quote").html(new_html);
  96. </text>
  97. }
  98. @if (!string.IsNullOrEmpty(Model.About))
  99. {
  100. <text>
  101. // About Conversion
  102. var old_about = $("#markdown_body").text();
  103. var new_about = converter.makeHtml(old_about);
  104. $("#markdown_body").html(new_about);
  105. </text>
  106. }
  107. });
  108. </script>
  109. <div class="col-sm-12" id="markdown_body">@Model.About</div>
  110. </div><!--/tab-pane-->
  111. }
  112. @if (OwnProfile)
  113. {
  114. <div class="tab-pane active" id="settings">
  115. <form class="form" action="##" method="post" id="updateForm">
  116. <input name="update_userid" id="update_userid" type="hidden" value="@Model.UserID" />
  117. <!-- Profile Settings -->
  118. <div class="row">
  119. <div class="col-sm-12 text-center">
  120. <h3>Profile Settings</h3>
  121. </div>
  122. </div>
  123. <hr>
  124. <div class="row">
  125. <div class="form-group col-sm-4">
  126. <label for="update_password_current"><h4>Current Password</h4></label>
  127. <input class="form-control" name="update_password_current" id="update_password_current" placeholder="current password" title="enter your current password." type="password" />
  128. </div>
  129. <div class="form-group col-sm-4">
  130. <label for="update_password"><h4>New Password</h4></label>
  131. <input class="form-control" name="update_password" id="update_password" placeholder="new password" title="enter your password." type="password" />
  132. </div>
  133. <div class="form-group col-sm-4">
  134. <label for="update_password_confirm"><h4>Verify New Password</h4></label>
  135. <input class="form-control" name="update_password_confirm" id="update_password_confirm" placeholder="new password confirmed" title="enter your password again." type="password" />
  136. </div>
  137. </div>
  138. <div class="row">
  139. <div class="form-group col-sm-6">
  140. <label for="update_website"><h4>Website</h4></label>
  141. <input class="form-control" id="update_website" name="update_website" placeholder="http://www.noneofyourbusiness.com/" title="enter your website" type="text" value="@Model.Website" />
  142. </div>
  143. <div class="form-group col-sm-6">
  144. <label for="update_quote"><h4>Quote</h4></label>
  145. <input class="form-control" id="update_quote" name="update_quote" placeholder="I have a dream!" title="enter a memorable quote" type="text" value="@Model.Quote" maxlength="140" />
  146. </div>
  147. </div>
  148. <div class="row">
  149. <div class="form-group col-sm-12">
  150. <label for="update_about"><h4>About Yourself</h4></label>
  151. <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.About</textarea>
  152. </div>
  153. </div>
  154. <!-- Blog Settings -->
  155. <div class="row">
  156. <div class="col-sm-12 text-center">
  157. <h3>Blog Settings</h3>
  158. </div>
  159. </div>
  160. <hr>
  161. <div class="row">
  162. <div class="form-group col-sm-6">
  163. <label for="update_blog_title"><h4>Title</h4></label>
  164. <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.BlogTitle" />
  165. </div>
  166. <div class="form-group col-sm-6">
  167. <label for="update_blog_description"><h4>Description</h4></label>
  168. <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.BlogDescription" />
  169. </div>
  170. </div>
  171. <div class="row">
  172. <div class="form-group col-sm-12">
  173. <br />
  174. <button class="btn btn-lg btn-success" id="update_submit" type="submit"><i class="glyphicon glyphicon-ok-sign"></i> Save</button>
  175. <button class="btn btn-lg" type="reset"><i class="glyphicon glyphicon-repeat"></i> Reset</button>
  176. </div>
  177. </div>
  178. <!-- Upload Settings -->
  179. <!-- Paste Settings -->
  180. </form>
  181. </div><!--/tab-pane-->
  182. <div class="tab-pane" id="privacy">
  183. <div class="row">
  184. <div class="col-sm-12 text-center">
  185. <!-- Privacy Settings Here -->
  186. </div>
  187. </div>
  188. </div>
  189. }
  190. </div><!--/tab-content-->
  191. </div><!--/col-9-->
  192. </div><!--/row-->
  193. }
  194. else
  195. {
  196. <div class="row">
  197. <div class="col-sm-12 text-center">
  198. <h2>Sorry, but I couldn't find that user.</h2>
  199. </div>
  200. </div>
  201. }
  202. </div>