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.
 
 
 
 
 

212 lines
12 KiB

@model Teknik.Areas.Profile.ViewModels.ProfileViewModel
<script>
var editUserURL = '@Url.SubRouteUrl("profile", "Profile.Action", new { action = "Edit" })';
var deleteUserURL = '@Url.SubRouteUrl("profile", "Profile.Action", new { action = "Delete" })';
</script>
@Scripts.Render("~/bundles/profile")
@{
bool OwnProfile = (Model.Username == User.Identity.Name);
}
<div class="container">
@if (Model != null)
{
<div class="row">
<div class="col-sm-3@((string.IsNullOrEmpty(Model.About) && !OwnProfile) ? " col-sm-offset-4" : string.Empty)"><h1>@Model.Username></h1></div>
</div>
<div class="row">
<div class="col-sm-3@((string.IsNullOrEmpty(Model.About) && !OwnProfile) ? " col-sm-offset-4" : string.Empty)"><!--left col-->
<ul class="list-group">
<li class="list-group-item text-muted">Profile</li>
<li class="list-group-item text-right"><span class="pull-left"><strong>Joined</strong></span> @Model.JoinDate.ToString("MMMM dd, yyyy")</li>
@if (OwnProfile && User.Identity.IsAuthenticated)
{
<li class="list-group-item text-right"><span class="pull-left"><strong>Last Seen</strong></span> @Model.LastSeen.ToString("MMMM dd, yyyy")</li>
}
<li class="list-group-item text-right"><span class="pull-left"><strong>Email</strong></span> <a href="mailto:@Model.Email">@Model.Email</a></li>
@if (!string.IsNullOrEmpty(Model.BlogTitle))
{
<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">@Model.BlogTitle</a></li>
}
<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>
@if (OwnProfile)
{
<li class="list-group-item text-center"><button type="button" class="btn btn-danger" id="delete_account">Delete Account</button></li>
}
</ul>
@if (!string.IsNullOrEmpty(Model.Website))
{
<div class="panel panel-default">
<div class="panel-heading">Website <i class="fa fa-link fa-1x"></i></div>
<div class="panel-body"><a href="@Model.Website" id="website">@Model.Website</a></div>
</div>
}
@if (!string.IsNullOrEmpty(Model.Quote))
{
<div class="panel panel-default">
<div class="panel-heading">Quote <i class="fa fa-quote-right fa-1x"></i></div>
<div class="panel-body" id="quote">@Model.Quote</div>
</div>
}
</div><!--/col-3-->
<div class="col-sm-9">
@if (!string.IsNullOrEmpty(Model.About) && OwnProfile)
{
<ul class="nav nav-tabs" id="myTab">
@if (!string.IsNullOrEmpty(Model.About))
{
<li @((OwnProfile) ? string.Empty : "class=\"active\"")>
<a href="#about" data-toggle="tab"> About Myself </a>
</li>
}
@if (OwnProfile)
{
<li class="active"><a href="#settings" data-toggle="tab">Settings</a></li>
<li><a href="#privacy" data-toggle="tab">Privacy</a></li>
}
</ul>
}
<div class="tab-content">
@if (!string.IsNullOrEmpty(Model.About))
{
<div class="tab-pane @((!OwnProfile) ? " active" : string.Empty)" id="about">
<script>
$(document).ready(function () {
var converter = new Markdown.getSanitizingConverter();
@if (!string.IsNullOrEmpty(Model.BlogTitle))
{
<text>
// Blog Title Conversion
var old_html = $("#blog_title").text();
var new_html = converter.makeHtml(old_html);
$("#blog_title").html(new_html);
</text>
}
@if (!string.IsNullOrEmpty(Model.Website))
{
<text>
// Website Conversion
var old_html = $("#website").text();
var new_html = converter.makeHtml(old_html);
$("#website").html(new_html);
</text>
}
@if (!string.IsNullOrEmpty(Model.Quote))
{
<text>
// Quote Conversion
var old_html = $("#quote").text();
var new_html = converter.makeHtml(old_html);
$("#quote").html(new_html);
</text>
}
@if (!string.IsNullOrEmpty(Model.About))
{
<text>
// About Conversion
var old_about = $("#markdown_body").text();
var new_about = converter.makeHtml(old_about);
$("#markdown_body").html(new_about);
</text>
}
});
</script>
<div class="col-sm-12" id="markdown_body">@Model.About</div>
</div><!--/tab-pane-->
}
@if (OwnProfile)
{
<div class="tab-pane active" id="settings">
<form class="form" action="##" method="post" id="updateForm">
<input name="update_userid" id="update_userid" type="hidden" value="@Model.UserID" />
<!-- Profile Settings -->
<div class="row">
<div class="col-sm-12 text-center">
<h3>Profile Settings</h3>
</div>
</div>
<hr>
<div class="row">
<div class="form-group col-sm-4">
<label for="update_password_current"><h4>Current Password</h4></label>
<input class="form-control" name="update_password_current" id="update_password_current" placeholder="current password" title="enter your current password." type="password" />
</div>
<div class="form-group col-sm-4">
<label for="update_password"><h4>New Password</h4></label>
<input class="form-control" name="update_password" id="update_password" placeholder="new password" title="enter your password." type="password" />
</div>
<div class="form-group col-sm-4">
<label for="update_password_confirm"><h4>Verify New Password</h4></label>
<input class="form-control" name="update_password_confirm" id="update_password_confirm" placeholder="new password confirmed" title="enter your password again." type="password" />
</div>
</div>
<div class="row">
<div class="form-group col-sm-6">
<label for="update_website"><h4>Website</h4></label>
<input class="form-control" id="update_website" name="update_website" placeholder="http://www.noneofyourbusiness.com/" title="enter your website" type="text" value="@Model.Website" />
</div>
<div class="form-group col-sm-6">
<label for="update_quote"><h4>Quote</h4></label>
<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" />
</div>
</div>
<div class="row">
<div class="form-group col-sm-12">
<label for="update_about"><h4>About Yourself</h4></label>
<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>
</div>
</div>
<!-- Blog Settings -->
<div class="row">
<div class="col-sm-12 text-center">
<h3>Blog Settings</h3>
</div>
</div>
<hr>
<div class="row">
<div class="form-group col-sm-6">
<label for="update_blog_title"><h4>Title</h4></label>
<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" />
</div>
<div class="form-group col-sm-6">
<label for="update_blog_description"><h4>Description</h4></label>
<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" />
</div>
</div>
<div class="row">
<div class="form-group col-sm-12">
<br />
<button class="btn btn-lg btn-success" id="update_submit" type="submit"><i class="glyphicon glyphicon-ok-sign"></i> Save</button>
<button class="btn btn-lg" type="reset"><i class="glyphicon glyphicon-repeat"></i> Reset</button>
</div>
</div>
</form>
</div><!--/tab-pane-->
<div class="tab-pane" id="privacy">
<div class="row">
<div class="col-sm-12 text-center">
<iframe style="border: 0; width: 100%;" src="https://stats.teknik.io/index.php?module=CoreAdminHome&action=optOut&language=en"></iframe>
</div>
</div>
</div>
}
</div><!--/tab-content-->
</div><!--/col-9-->
</div><!--/row-->
}
else
{
<div class="row">
<div class="col-sm-12 text-center">
<h2>Sorry, but I couldn't find that user.</h2>
</div>
</div>
}
</div>