mirror of
https://git.teknik.io/Teknikode/Teknik.git
synced 2023-08-02 14:16:22 +02:00
Removed user from system blog.
Added gogs source id as config option.
This commit is contained in:
parent
f431ed4e67
commit
17a66c79c2
@ -7,7 +7,13 @@
|
||||
<div class="blog-post">
|
||||
<h2 class="blog-post-title text-center"><a href="@Url.SubRouteUrl("blog", "Blog.Post", new { username = Model.Blog.User.Username, id = Model.PostId })" id="title_@Model.PostId">@Html.Markdown(@Model.Title)</a></h2>
|
||||
<p class="blog-post-meta text-center text-muted">
|
||||
Posted on <time datetime="@Model.DatePosted.ToString("o")">@Model.DatePosted.ToString("MMMM dd, yyyy")</time> by <a href="@Url.SubRouteUrl("profile", "Profile.Index", new { username = Model.Blog.User.Username })">@Model.Blog.User.Username</a>
|
||||
Posted on <time datetime="@Model.DatePosted.ToString("o")">@Model.DatePosted.ToString("MMMM dd, yyyy")</time>
|
||||
@if (!Model.System)
|
||||
{
|
||||
<text>
|
||||
by <a href="@Url.SubRouteUrl("profile", "Profile.Index", new { username = Model.Blog.User.Username })">@Model.Blog.User.Username</a>
|
||||
</text>
|
||||
}
|
||||
@if (Model.Blog.User.Username == User.Identity.Name || User.IsInRole("Admin"))
|
||||
{
|
||||
<br />
|
||||
|
@ -151,7 +151,7 @@
|
||||
<a href="@Url.SubRouteUrl("blog", "Blog.Post", new { username = post.Blog.User.Username, id = post.BlogPostId })" id="title_@post.BlogPostId">@post.Title</a>
|
||||
</h2>
|
||||
<p class="blog-post-meta-sm text-left text-muted">
|
||||
Posted on <time datetime="@post.DatePosted.ToString("o")">@post.DatePosted.ToString("MMMM dd, yyyy")</time> by <a href="@Url.SubRouteUrl("profile", "Profile.Index", new { username = post.Blog.User.Username })">@post.Blog.User.Username</a>
|
||||
Posted on <time datetime="@post.DatePosted.ToString("o")">@post.DatePosted.ToString("MMMM dd, yyyy")</time>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -227,7 +227,7 @@ namespace Teknik.Areas.Profile.Controllers
|
||||
// Add gogs user
|
||||
using (var client = new WebClient())
|
||||
{
|
||||
var obj = new { username = model.Username, email = email, password = model.Password };
|
||||
var obj = new { source_id = Config.GitConfig.SourceId, username = model.Username, email = email, password = model.Password };
|
||||
string json = Newtonsoft.Json.JsonConvert.SerializeObject(obj);
|
||||
client.Headers[HttpRequestHeader.ContentType] = "application/json";
|
||||
Uri baseUri = new Uri(Config.GitConfig.Host);
|
||||
@ -305,7 +305,7 @@ namespace Teknik.Areas.Profile.Controllers
|
||||
{
|
||||
using (var client = new WebClient())
|
||||
{
|
||||
var obj = new { source_id = 1, email = email, password = newPass };
|
||||
var obj = new { source_id = Config.GitConfig.SourceId, email = email, password = newPass };
|
||||
string json = Newtonsoft.Json.JsonConvert.SerializeObject(obj);
|
||||
client.Headers[HttpRequestHeader.ContentType] = "application/json";
|
||||
Uri baseUri = new Uri(Config.GitConfig.Host);
|
||||
|
@ -14,11 +14,14 @@ namespace Teknik.Configuration
|
||||
|
||||
public string AccessToken { get; set; }
|
||||
|
||||
public int SourceId { get; set; }
|
||||
|
||||
public GitConfig()
|
||||
{
|
||||
Enabled = true;
|
||||
Host = string.Empty;
|
||||
AccessToken = string.Empty;
|
||||
SourceId = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user