|  | @@ -56,19 +56,19 @@
 | 
											
												
													
														|  |                                  @{
 |  |                                  @{
 | 
											
												
													
														|  |                                      if (!string.IsNullOrEmpty(Model.Label))
 |  |                                      if (!string.IsNullOrEmpty(Model.Label))
 | 
											
												
													
														|  |                                      {
 |  |                                      {
 | 
											
												
													
														|  | -                                    <div class="pull-right margin-right20">
 |  | 
 | 
											
												
													
														|  | -                                        <div>
 |  | 
 | 
											
												
													
														|  | -                                            @foreach (string s in Model.Label.Split(',', ',', ' '))
 |  | 
 | 
											
												
													
														|  | 
 |  | +                                        <div class="pull-right margin-right20">
 | 
											
												
													
														|  | 
 |  | +                                            <div>
 | 
											
												
													
														|  | 
 |  | +                                                @foreach (string s in Model.Label.Split(',', ',', ' '))
 | 
											
												
													
														|  |                                                  {
 |  |                                                  {
 | 
											
												
													
														|  |                                                      if (!string.IsNullOrEmpty(s))
 |  |                                                      if (!string.IsNullOrEmpty(s))
 | 
											
												
													
														|  |                                                      {
 |  |                                                      {
 | 
											
												
													
														|  | -                                            <a asp-controller="Home" asp-action="Tag" asp-route-id="@s">
 |  | 
 | 
											
												
													
														|  | -                                                <span class="label label-@colors[new Random().Next() % colors.Length]">@s</span>
 |  | 
 | 
											
												
													
														|  | -                                            </a>
 |  | 
 | 
											
												
													
														|  | 
 |  | +                                                        <a asp-controller="Home" asp-action="Tag" asp-route-id="@s">
 | 
											
												
													
														|  | 
 |  | +                                                            <span class="label label-@colors[new Random().Next() % colors.Length]">@s</span>
 | 
											
												
													
														|  | 
 |  | +                                                        </a>
 | 
											
												
													
														|  |                                                      }
 |  |                                                      }
 | 
											
												
													
														|  |                                                  }
 |  |                                                  }
 | 
											
												
													
														|  | 
 |  | +                                            </div>
 | 
											
												
													
														|  |                                          </div>
 |  |                                          </div>
 | 
											
												
													
														|  | -                                    </div>
 |  | 
 | 
											
												
													
														|  |                                      }
 |  |                                      }
 | 
											
												
													
														|  |                                  }
 |  |                                  }
 | 
											
												
													
														|  |                              </div>
 |  |                              </div>
 | 
											
										
											
												
													
														|  | @@ -77,24 +77,27 @@
 | 
											
												
													
														|  |                                      分类:<i class="icon-map-pin"></i>@Html.ActionLink(Model.Category.Name, "Category", "Home", new { id = Model.CategoryId }, new { @class = "label label-" + colors[new Random().Next() % colors.Length] }) | 评论总数:<span class="text-danger">@Model.Comment.Count</span>条 | 热度:<span class="text-danger">@Model.TotalViewCount</span>℃ | 状态:@Model.Status.GetDisplay()
 |  |                                      分类:<i class="icon-map-pin"></i>@Html.ActionLink(Model.Category.Name, "Category", "Home", new { id = Model.CategoryId }, new { @class = "label label-" + colors[new Random().Next() % colors.Length] }) | 评论总数:<span class="text-danger">@Model.Comment.Count</span>条 | 热度:<span class="text-danger">@Model.TotalViewCount</span>℃ | 状态:@Model.Status.GetDisplay()
 | 
											
												
													
														|  |                                      @if (Model.Seminar.Any())
 |  |                                      @if (Model.Seminar.Any())
 | 
											
												
													
														|  |                                      {
 |  |                                      {
 | 
											
												
													
														|  | -                                    <span> | 所属专题:</span>
 |  | 
 | 
											
												
													
														|  | 
 |  | +                                        <span> | 所属专题:</span>
 | 
											
												
													
														|  |                                          var seminars = Model.Seminar;
 |  |                                          var seminars = Model.Seminar;
 | 
											
												
													
														|  |                                          foreach (var s in seminars)
 |  |                                          foreach (var s in seminars)
 | 
											
												
													
														|  |                                          {
 |  |                                          {
 | 
											
												
													
														|  | -                                    @Html.ActionLink(s.Seminar.Title, "Index", "Seminar", new { id = s.SeminarId }, new { @class = "label label-" + colors[new Random().Next() % colors.Length] })<text> </text>
 |  | 
 | 
											
												
													
														|  | 
 |  | +                                            @Html.ActionLink(s.Seminar.Title, "Index", "Seminar", new { id = s.SeminarId }, new { @class = "label label-" + colors[new Random().Next() % colors.Length] })<text> </text>
 | 
											
												
													
														|  |                                          }
 |  |                                          }
 | 
											
												
													
														|  |                                      }
 |  |                                      }
 | 
											
												
													
														|  |                                      <div class="pull-right margin-right20">
 |  |                                      <div class="pull-right margin-right20">
 | 
											
												
													
														|  |                                          <div class="btn-group">
 |  |                                          <div class="btn-group">
 | 
											
												
													
														|  |                                              @Html.ActionLink("刷新", "Refresh", "Post", new { id = Model.Id }, new { @class = "btn btn-info" })
 |  |                                              @Html.ActionLink("刷新", "Refresh", "Post", new { id = Model.Id }, new { @class = "btn btn-info" })
 | 
											
												
													
														|  | -                                            @if(Model.IsFixedTop) {
 |  | 
 | 
											
												
													
														|  | -                                            <button class="btn btn-success" id="pin">取消置顶</button>
 |  | 
 | 
											
												
													
														|  | -                                            }else {
 |  | 
 | 
											
												
													
														|  | -                                            <button class="btn btn-success" id="pin">置顶</button>
 |  | 
 | 
											
												
													
														|  | 
 |  | +                                            @if (Model.IsFixedTop)
 | 
											
												
													
														|  | 
 |  | +                                            {
 | 
											
												
													
														|  | 
 |  | +                                                <button class="btn btn-success" id="pin">取消置顶</button>
 | 
											
												
													
														|  | 
 |  | +                                            }
 | 
											
												
													
														|  | 
 |  | +                                            else
 | 
											
												
													
														|  | 
 |  | +                                            {
 | 
											
												
													
														|  | 
 |  | +                                                <button class="btn btn-success" id="pin">置顶</button>
 | 
											
												
													
														|  |                                              }
 |  |                                              }
 | 
											
												
													
														|  |                                              @if (Model.Status == Status.Pending)
 |  |                                              @if (Model.Status == Status.Pending)
 | 
											
												
													
														|  |                                              {
 |  |                                              {
 | 
											
												
													
														|  | -                                            <button class="btn btn-primary" id="pass">通过</button>
 |  | 
 | 
											
												
													
														|  | 
 |  | +                                                <button class="btn btn-primary" id="pass">通过</button>
 | 
											
												
													
														|  |                                              }
 |  |                                              }
 | 
											
												
													
														|  |                                              <a asp-controller="Dashboard" asp-action="Index" asp-fragment="/post/[email protected]" class="btn btn-primary" target="_blank">修改</a>
 |  |                                              <a asp-controller="Dashboard" asp-action="Index" asp-fragment="/post/[email protected]" class="btn btn-primary" target="_blank">修改</a>
 | 
											
												
													
														|  |                                              <button class="btn btn-danger" id="del">删除</button>
 |  |                                              <button class="btn btn-danger" id="del">删除</button>
 | 
											
										
											
												
													
														|  | @@ -107,9 +110,9 @@
 | 
											
												
													
														|  |                              @Html.Raw(Model.Content)
 |  |                              @Html.Raw(Model.Content)
 | 
											
												
													
														|  |                              @if (!string.IsNullOrEmpty(Model.ProtectContent))
 |  |                              @if (!string.IsNullOrEmpty(Model.ProtectContent))
 | 
											
												
													
														|  |                              {
 |  |                              {
 | 
											
												
													
														|  | -                            <div class="row protected">
 |  | 
 | 
											
												
													
														|  | -                                @Html.Raw(Model.ProtectContent)
 |  | 
 | 
											
												
													
														|  | -                            </div>
 |  | 
 | 
											
												
													
														|  | 
 |  | +                                <div class="row protected">
 | 
											
												
													
														|  | 
 |  | +                                    @Html.Raw(Model.ProtectContent)
 | 
											
												
													
														|  | 
 |  | +                                </div>
 | 
											
												
													
														|  |                              }
 |  |                              }
 | 
											
												
													
														|  |                          </article>
 |  |                          </article>
 | 
											
												
													
														|  |                          <h3>分享到:</h3>
 |  |                          <h3>分享到:</h3>
 | 
											
										
											
												
													
														|  | @@ -308,17 +311,17 @@
 | 
											
												
													
														|  |  <script src="~/Assets/highlight/js/highlight.js"></script>
 |  |  <script src="~/Assets/highlight/js/highlight.js"></script>
 | 
											
												
													
														|  |  <script>
 |  |  <script>
 | 
											
												
													
														|  |      function getcomments() {
 |  |      function getcomments() {
 | 
											
												
													
														|  | -		$.post("/comment/getcomments", {
 |  | 
 | 
											
												
													
														|  | 
 |  | +        window.post("/comment/getcomments",{
 | 
											
												
													
														|  |  			id: $("#postId").val(),
 |  |  			id: $("#postId").val(),
 | 
											
												
													
														|  |  			page: 1,
 |  |  			page: 1,
 | 
											
												
													
														|  |  			size: 10,
 |  |  			size: 10,
 | 
											
												
													
														|  |  			cid: @cid
 |  |  			cid: @cid
 | 
											
												
													
														|  | -		}, (data) => {
 |  | 
 | 
											
												
													
														|  | -			data = data.Data;
 |  | 
 | 
											
												
													
														|  | 
 |  | +		},function(data) {
 | 
											
												
													
														|  | 
 |  | +            data = data.Data;
 | 
											
												
													
														|  |  			document.querySelector(".media-list").innerHTML = loadParentComments(data);
 |  |  			document.querySelector(".media-list").innerHTML = loadParentComments(data);
 | 
											
												
													
														|  |  			bindReplyBtn();
 |  |  			bindReplyBtn();
 | 
											
												
													
														|  |  			commentVoteBind(); //评论投票
 |  |  			commentVoteBind(); //评论投票
 | 
											
												
													
														|  | -		});
 |  | 
 | 
											
												
													
														|  | 
 |  | +        });
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  	window.onload = function() {
 |  |  	window.onload = function() {
 | 
											
												
													
														|  |          var keywords = @Html.Raw(ViewData["keywords"] ?? "[]");
 |  |          var keywords = @Html.Raw(ViewData["keywords"] ?? "[]");
 | 
											
										
											
												
													
														|  | @@ -331,7 +334,7 @@
 | 
											
												
													
														|  |  			count: @Model.Comment.Count(c =>c.ParentId==0&& c.Status==Status.Pended),
 |  |  			count: @Model.Comment.Count(c =>c.ParentId==0&& c.Status==Status.Pended),
 | 
											
												
													
														|  |  			toolbar: true,
 |  |  			toolbar: true,
 | 
											
												
													
														|  |  			callback: function(page, size, count) {
 |  |  			callback: function(page, size, count) {
 | 
											
												
													
														|  | -				$.post("/comment/getcomments", {
 |  | 
 | 
											
												
													
														|  | 
 |  | +				window.post("/comment/getcomments", {
 | 
											
												
													
														|  |  					id: @Model.Id,
 |  |  					id: @Model.Id,
 | 
											
												
													
														|  |  					page: page,
 |  |  					page: page,
 | 
											
												
													
														|  |  					size: size
 |  |  					size: size
 | 
											
										
											
												
													
														|  | @@ -357,35 +360,51 @@
 | 
											
												
													
														|  |  				animation: true,
 |  |  				animation: true,
 | 
											
												
													
														|  |  				allowOutsideClick: false
 |  |  				allowOutsideClick: false
 | 
											
												
													
														|  |  			}).then(function () {
 |  |  			}).then(function () {
 | 
											
												
													
														|  | -				$.post("/post/delete", {
 |  | 
 | 
											
												
													
														|  | -					id: @Model.Id
 |  | 
 | 
											
												
													
														|  | -				}, function (data) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +				window.post("/post/delete", { id: @Model.Id}, function (data) {
 | 
											
												
													
														|  |  					window.notie.alert({
 |  |  					window.notie.alert({
 | 
											
												
													
														|  |  						type: 1,
 |  |  						type: 1,
 | 
											
												
													
														|  |  						text: data.Message,
 |  |  						text: data.Message,
 | 
											
												
													
														|  |  						time: 4
 |  |  						time: 4
 | 
											
												
													
														|  |  					});
 |  |  					});
 | 
											
												
													
														|  | -				});
 |  | 
 | 
											
												
													
														|  | 
 |  | +                }, () => {
 | 
											
												
													
														|  | 
 |  | +                    window.notie.alert({
 | 
											
												
													
														|  | 
 |  | +						type: 3,
 | 
											
												
													
														|  | 
 |  | +						text: "请求失败,请稍候再试!",
 | 
											
												
													
														|  | 
 |  | +						time: 4
 | 
											
												
													
														|  | 
 |  | +					});
 | 
											
												
													
														|  | 
 |  | +                });
 | 
											
												
													
														|  |  			}, function () {
 |  |  			}, function () {
 | 
											
												
													
														|  |  			});
 |  |  			});
 | 
											
												
													
														|  |  		});
 |  |  		});
 | 
											
												
													
														|  |  		$("#pass").on("click", function (e) {
 |  |  		$("#pass").on("click", function (e) {
 | 
											
												
													
														|  | -			$.post("/post/pass", { id:@Model.Id}, function (data) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +			window.post("/post/pass", { id:@Model.Id}, function (data) {
 | 
											
												
													
														|  |  				window.notie.alert({
 |  |  				window.notie.alert({
 | 
											
												
													
														|  |  					type: 1,
 |  |  					type: 1,
 | 
											
												
													
														|  |  					text: data.Message,
 |  |  					text: data.Message,
 | 
											
												
													
														|  |  					time: 4
 |  |  					time: 4
 | 
											
												
													
														|  | -				});
 |  | 
 | 
											
												
													
														|  | 
 |  | +				}, () => {
 | 
											
												
													
														|  | 
 |  | +                    window.notie.alert({
 | 
											
												
													
														|  | 
 |  | +						type: 3,
 | 
											
												
													
														|  | 
 |  | +						text: "请求失败,请稍候再试!",
 | 
											
												
													
														|  | 
 |  | +						time: 4
 | 
											
												
													
														|  | 
 |  | +					});
 | 
											
												
													
														|  | 
 |  | +                });
 | 
											
												
													
														|  |                  location.reload();
 |  |                  location.reload();
 | 
											
												
													
														|  |  			});
 |  |  			});
 | 
											
												
													
														|  |  		});
 |  |  		});
 | 
											
												
													
														|  |  		$("#pin").on("click", function (e) {
 |  |  		$("#pin").on("click", function (e) {
 | 
											
												
													
														|  | -			$.post("/post/Fixtop", { id: @Model.Id }, function (data) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +			window.post("/post/Fixtop", { id: @Model.Id }, function (data) {
 | 
											
												
													
														|  |  				window.notie.alert({
 |  |  				window.notie.alert({
 | 
											
												
													
														|  |  					type: 1,
 |  |  					type: 1,
 | 
											
												
													
														|  |  					text: data.Message,
 |  |  					text: data.Message,
 | 
											
												
													
														|  |  					time: 4
 |  |  					time: 4
 | 
											
												
													
														|  | -				});
 |  | 
 | 
											
												
													
														|  | 
 |  | +				}, () => {
 | 
											
												
													
														|  | 
 |  | +                    window.notie.alert({
 | 
											
												
													
														|  | 
 |  | +						type: 3,
 | 
											
												
													
														|  | 
 |  | +						text: "请求失败,请稍候再试!",
 | 
											
												
													
														|  | 
 |  | +						time: 4
 | 
											
												
													
														|  | 
 |  | +					});
 | 
											
												
													
														|  | 
 |  | +                });
 | 
											
												
													
														|  |                  location.reload();
 |  |                  location.reload();
 | 
											
												
													
														|  |  			});
 |  |  			});
 | 
											
												
													
														|  |  		});
 |  |  		});
 | 
											
										
											
												
													
														|  | @@ -468,10 +487,16 @@
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  	function pass(id) {
 |  |  	function pass(id) {
 | 
											
												
													
														|  | -		$.post("/comment/pass", { id: id }, function (res) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +		window.post("/comment/pass", { id: id }, function (res) {
 | 
											
												
													
														|  |  			swal(res.Message, "", res.Success ? "success" : "error");
 |  |  			swal(res.Message, "", res.Success ? "success" : "error");
 | 
											
												
													
														|  |  			getcomments();
 |  |  			getcomments();
 | 
											
												
													
														|  | -		});
 |  | 
 | 
											
												
													
														|  | 
 |  | +		}, () => {
 | 
											
												
													
														|  | 
 |  | +                    window.notie.alert({
 | 
											
												
													
														|  | 
 |  | +						type: 3,
 | 
											
												
													
														|  | 
 |  | +						text: "请求失败,请稍候再试!",
 | 
											
												
													
														|  | 
 |  | +						time: 4
 | 
											
												
													
														|  | 
 |  | +					});
 | 
											
												
													
														|  | 
 |  | +                });
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  |  	function del(id) {
 |  |  	function del(id) {
 | 
											
												
													
														|  |  		swal({
 |  |  		swal({
 | 
											
										
											
												
													
														|  | @@ -484,11 +509,11 @@
 | 
											
												
													
														|  |  			cancelButtonText: '取消',
 |  |  			cancelButtonText: '取消',
 | 
											
												
													
														|  |  			preConfirm: function() {
 |  |  			preConfirm: function() {
 | 
											
												
													
														|  |  				return new Promise(function (resolve) {
 |  |  				return new Promise(function (resolve) {
 | 
											
												
													
														|  | -					$.post("/comment/delete", {
 |  | 
 | 
											
												
													
														|  | 
 |  | +					window.post("/comment/delete", {
 | 
											
												
													
														|  |  						id: id
 |  |  						id: id
 | 
											
												
													
														|  |  					}, function (res) {
 |  |  					}, function (res) {
 | 
											
												
													
														|  |  						resolve(res);
 |  |  						resolve(res);
 | 
											
												
													
														|  | -					});
 |  | 
 | 
											
												
													
														|  | 
 |  | +					}, (e) => reject(e));
 | 
											
												
													
														|  |  				});
 |  |  				});
 | 
											
												
													
														|  |  			},
 |  |  			},
 | 
											
												
													
														|  |  			allowOutsideClick: false
 |  |  			allowOutsideClick: false
 |