コード例 #1
0
        public async Task <IActionResult> React([FromBody] TokkepediaReaction reaction)
        {
            bool result = false;

            if (ModelState.IsValid)
            {
                reaction.UserId    = User.GetUserId();
                reaction.DetailNum = 0;

                if (reaction.Kind == "comment")
                {
                    reaction.Text = reaction.Text.TrimEnd('\r', '\n');
                    var tokmojis = PurchasesTool.GetProducts().Where(x => x.ProductType == ProductType.Tokmoji).ToList();
                    foreach (var item in tokmojis)
                    {
                        reaction.Text = reaction.Text.Replace(":" + item.Image + ":", ":" + item.Id + ":");
                    }
                }

                if (!string.IsNullOrEmpty(reaction.ItemId) && !reaction.IsActive)
                {
                    result = await _reactionService.AddReaction(reaction);
                }
                else
                {
                    result = await _reactionService.DeleteReaction(reaction.ItemId);
                }
            }
            return(Json(result));
        }
コード例 #2
0
        public async Task <IActionResult> Shop()
        {
            var l = await _stickerService.GetStickersAsync();

            ViewBag.Stickers = l;
            return(View(PurchasesTool.GetProducts()));
        }
コード例 #3
0
        public async Task <Order> OrderProduct(string productId, string userId)
        {
            if (string.IsNullOrEmpty(userId))
            {
                return(null);
            }
            var product         = PurchasesTool.GetProduct(productId);
            var purchaseRequest = new OrdersCreateRequest();

            purchaseRequest.Prefer("return=representation");
            purchaseRequest.RequestBody(product.GetOrderRequest(userId));
            return((await _httpClient.Execute(purchaseRequest)).Result <Order>());
        }
コード例 #4
0
        public async Task <IActionResult> ToggleImage([FromBody] ToggleModel model)
        {
            var tokmojis = PurchasesTool.GetProducts().Where(x => x.ProductType == ProductType.Tokmoji).ToList();

            model.Text = model.Text.TrimEnd('\r', '\n');
            foreach (var item in tokmojis)
            {
                if (model.ShowImage)
                {
                    model.Text = model.Text.Replace(":" + item.Id + ":", "<img src='" + item.Image + "' style='height: 32px;' data-toggle='tooltip' data-title='" + item.Id + "'/>");
                }
                else
                {
                    model.Text = model.Text.Replace(":" + item.Image + ":", ":" + item.Id + ":");
                }
            }
            return(Json(model.Text));
        }
コード例 #5
0
        #pragma warning disable 1998
        public async override global::System.Threading.Tasks.Task ExecuteAsync()
        {
#line 2 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"

            var tokmojis = PurchasesTool.GetProducts().Where(x => x.ProductType == ProductType.Tokmoji);

#line default
#line hidden
            BeginContext(151, 55, true);
            WriteLiteral("\r\n<div class=\"comment-wrap\">\r\n    <div class=\"photo\">\r\n");
            EndContext();
#line 8 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
            if (Model.IsAvatarProfilePicture ?? false)
            {
#line default
#line hidden
                BeginContext(270, 31, true);
                WriteLiteral("            <img class=\"avatar\"");
                EndContext();
                BeginWriteAttribute("src", " src=\"", 301, "\"", 360, 1);
#line 10 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                WriteAttributeValue("", 307, PurchasesTool.GetProduct(Model.SelectedAvatar).Image, 307, 53, false);

#line default
#line hidden
                EndWriteAttribute();
                BeginContext(361, 3, true);
                WriteLiteral(">\r\n");
                EndContext();
#line 11 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
            }
            else
            {
                if (!string.IsNullOrEmpty(Model.UserPhoto))
                {
#line default
#line hidden
                    BeginContext(472, 35, true);
                    WriteLiteral("                <img class=\"avatar\"");
                    EndContext();
                    BeginWriteAttribute("src", " src=\"", 507, "\"", 529, 1);
#line 16 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                    WriteAttributeValue("", 513, Model.UserPhoto, 513, 16, false);

#line default
#line hidden
                    EndWriteAttribute();
                    BeginContext(530, 3, true);
                    WriteLiteral(">\r\n");
                    EndContext();
#line 17 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                }
                else
                {
#line default
#line hidden
                    BeginContext(581, 16, true);
                    WriteLiteral("                ");
                    EndContext();
                    BeginContext(597, 46, false);
                    __tagHelperExecutionContext = __tagHelperScopeManager.Begin("img", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "c2020852fbdd437fa1dbfb7dc5fe6c59", async() => {
                    }
                                                                                );
                    __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
                    __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
                    __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0);
                    __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1);
                    await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                    if (!__tagHelperExecutionContext.Output.IsContentModified)
                    {
                        await __tagHelperExecutionContext.SetOutputContentAsync();
                    }
                    Write(__tagHelperExecutionContext.Output);
                    __tagHelperExecutionContext = __tagHelperScopeManager.End();
                    EndContext();
                    BeginContext(643, 2, true);
                    WriteLiteral("\r\n");
                    EndContext();
#line 21 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                }
            }

#line default
#line hidden
            BeginContext(671, 103, true);
            WriteLiteral("        </div>\r\n    <div class=\"comment-block\">\r\n        <ul class=\"comment-actions\">\r\n            <li>");
            EndContext();
            BeginContext(774, 202, false);
            __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "0d00501b090f43bf9580e2dff4be8329", async() => {
                BeginContext(913, 3, true);
                WriteLiteral("<b>");
                EndContext();
                BeginContext(917, 51, false);
#line 26 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                Write(Html.DisplayFor(modelItem => Model.UserDisplayName));

#line default
#line hidden
                EndContext();
                BeginContext(968, 4, true);
                WriteLiteral("</b>");
                EndContext();
            }
                                                                        );
            __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
            __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_2.Value;
            __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_2);
            __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_3.Value;
            __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_3);
            if (__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues == null)
            {
                throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-id", "Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper", "RouteValues"));
            }
            BeginWriteTagHelperAttribute();
#line 26 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
            WriteLiteral(Model.UserId);

#line default
#line hidden
            __tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
            __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"] = __tagHelperStringValueBuffer;
            __tagHelperExecutionContext.AddTagHelperAttribute("asp-route-id", __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
            __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_4);
            await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

            if (!__tagHelperExecutionContext.Output.IsContentModified)
            {
                await __tagHelperExecutionContext.SetOutputContentAsync();
            }
            Write(__tagHelperExecutionContext.Output);
            __tagHelperExecutionContext = __tagHelperScopeManager.End();
            EndContext();
            BeginContext(976, 91, true);
            WriteLiteral("</li>\r\n            <li class=\"right\"><span style=\"color: lightslategray; font-size: 11px;\">");
            EndContext();
            BeginContext(1068, 37, false);
#line 27 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
            Write(Model.CreatedTime.ToShortDateString());

#line default
#line hidden
            EndContext();
            BeginContext(1105, 1, true);
            WriteLiteral(" ");
            EndContext();
            BeginContext(1107, 2, true);
            WriteLiteral("@ ");
            EndContext();
            BeginContext(1110, 37, false);
#line 27 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
            Write(Model.CreatedTime.ToShortTimeString());

#line default
#line hidden
            EndContext();
            BeginContext(1147, 29, true);
            WriteLiteral("</span></li>\r\n        </ul>\r\n");
            EndContext();
#line 29 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
            if (Model.Kind == "inaccurate")
            {
#line default
#line hidden
                BeginContext(1227, 65, true);
                WriteLiteral("<br /><a href=\"#\" class=\"badge badge-danger\">Inaccurate</a><br />");
                EndContext();
#line 30 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
            }
            else if (Model.Kind == "accurate")
            {
#line default
#line hidden
                BeginContext(1348, 64, true);
                WriteLiteral("<br /><a href=\"#\" class=\"badge badge-success\">Accurate</a><br />");
                EndContext();
#line 32 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
            }
            else
            {
#line default
#line hidden
                BeginContext(1438, 6, true);
                WriteLiteral("<br />");
                EndContext();
#line 34 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
            }

#line default
#line hidden
            BeginContext(1447, 34, true);
            WriteLiteral("        <p class=\"comment-text\">\r\n");
            EndContext();
#line 36 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
            foreach (var emoji in tokmojis)
            {
                Model.Text = Model.Text.Replace(":" + emoji.Id + ":", ":" + emoji.Image + ":");
            }

#line default
#line hidden
            BeginContext(1650, 12, true);
            WriteLiteral("            ");
            EndContext();
            BeginContext(1663, 10, false);
#line 40 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
            Write(Model.Text);

#line default
#line hidden
            EndContext();
            BeginContext(1673, 96, true);
            WriteLiteral("\r\n        </p>\r\n        <div class=\"bottom-comment\">\r\n            <ul class=\"comment-actions\">\r\n");
            EndContext();
#line 44 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
            if (User != null)
            {
                if (User.Identity.IsAuthenticated)
                {
#line default
#line hidden
                    BeginContext(1903, 82, true);
                    WriteLiteral("                        <li><a><i class=\"material-icons reactionbtn\">thumb_up</i> ");
                    EndContext();
                    BeginContext(1987, 65, false);
#line 48 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                    Write(Model.ChildrenCounts.Count > 0 ? Model.ChildrenCounts["like"] : 0);

#line default
#line hidden
                    EndContext();
                    BeginContext(2053, 206, true);
                    WriteLiteral("</a></li>\r\n                        <li class=\"right\"><a><i class=\"material-icons reactionbtn\">thumb_down</i></a></li>\r\n                        <li class=\"right\"><a onclick=\"ShowReply(this)\">REPLY</a></li>\r\n");
                    EndContext();
#line 51 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                }
                else
                {
#line default
#line hidden
                    BeginContext(2331, 113, true);
                    WriteLiteral("                        <li><a onclick=\"RequireLogin(\'Like\')\"><i class=\"material-icons reactionbtn\">thumb_up</i> ");
                    EndContext();
                    BeginContext(2446, 65, false);
#line 54 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                    Write(Model.ChildrenCounts.Count > 0 ? Model.ChildrenCounts["like"] : 0);

#line default
#line hidden
                    EndContext();
                    BeginContext(2512, 246, true);
                    WriteLiteral("</a></li>\r\n                        <li class=\"right\"><a onclick=\"RequireLogin(\'Dislike\')\"><i class=\"material-icons reactionbtn\">thumb_down</i></a></li>\r\n                        <li class=\"right\"><a onclick=\"RequireLogin(\'Reply\')\">REPLY</a></li>\r\n");
                    EndContext();
#line 57 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                }
            }
            else
            {
#line default
#line hidden
                BeginContext(2841, 109, true);
                WriteLiteral("                    <li><a onclick=\"RequireLogin(\'Like\')\"><i class=\"material-icons reactionbtn\">thumb_up</i> ");
                EndContext();
                BeginContext(2952, 65, false);
#line 61 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                Write(Model.ChildrenCounts.Count > 0 ? Model.ChildrenCounts["like"] : 0);

#line default
#line hidden
                EndContext();
                BeginContext(3018, 238, true);
                WriteLiteral("</a></li>\r\n                    <li class=\"right\"><a onclick=\"RequireLogin(\'Dislike\')\"><i class=\"material-icons reactionbtn\">thumb_down</i></a></li>\r\n                    <li class=\"right\"><a onclick=\"RequireLogin(\'Reply\')\">REPLY</a></li>\r\n");
                EndContext();
#line 64 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
            }

#line default
#line hidden
            BeginContext(3275, 286, true);
            WriteLiteral(@"            </ul>
        </div>
    </div>
    <br />
    <div class=""row"">
        <div class=""col-md-12"">
            <div class=""comment-wrap replySection"" data-isshown=""0"" style=""display: none"">
                <div class=""photo"">
                    <div class=""avatar"">
");
            EndContext();
#line 74 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
            if (User != null)
            {
                if (User.Identity.IsAuthenticated)
                {
                    if (!string.IsNullOrEmpty(ViewBag.UserPhoto))
                    {
#line default
#line hidden
                        BeginContext(3841, 40, true);
                        WriteLiteral("                                    <img");
                        EndContext();
                        BeginWriteAttribute("src", " src=\"", 3881, "\"", 3905, 1);
#line 80 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                        WriteAttributeValue("", 3887, ViewBag.UserPhoto, 3887, 18, false);

#line default
#line hidden
                        EndWriteAttribute();
                        BeginContext(3906, 5, true);
                        WriteLiteral(" />\r\n");
                        EndContext();
#line 81 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                    }
                    else
                    {
#line default
#line hidden
                        BeginContext(4019, 36, true);
                        WriteLiteral("                                    ");
                        EndContext();
                        BeginContext(4055, 33, false);
                        __tagHelperExecutionContext = __tagHelperScopeManager.Begin("img", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "c89a16fa99a644d18a29967e25bafdb5", async() => {
                        }
                                                                                    );
                        __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
                        __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
                        __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_5);
                        await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                        if (!__tagHelperExecutionContext.Output.IsContentModified)
                        {
                            await __tagHelperExecutionContext.SetOutputContentAsync();
                        }
                        Write(__tagHelperExecutionContext.Output);
                        __tagHelperExecutionContext = __tagHelperScopeManager.End();
                        EndContext();
                        BeginContext(4088, 2, true);
                        WriteLiteral("\r\n");
                        EndContext();
#line 85 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                    }
                }
                else
                {
#line default
#line hidden
                    BeginContext(4221, 32, true);
                    WriteLiteral("                                ");
                    EndContext();
                    BeginContext(4253, 33, false);
                    __tagHelperExecutionContext = __tagHelperScopeManager.Begin("img", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "dcac0a630c4542d99c1f07e3dd023107", async() => {
                    }
                                                                                );
                    __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
                    __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
                    __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_5);
                    await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                    if (!__tagHelperExecutionContext.Output.IsContentModified)
                    {
                        await __tagHelperExecutionContext.SetOutputContentAsync();
                    }
                    Write(__tagHelperExecutionContext.Output);
                    __tagHelperExecutionContext = __tagHelperScopeManager.End();
                    EndContext();
                    BeginContext(4286, 2, true);
                    WriteLiteral("\r\n");
                    EndContext();
#line 90 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                }
            }
            else
            {
#line default
#line hidden
                BeginContext(4403, 28, true);
                WriteLiteral("                            ");
                EndContext();
                BeginContext(4431, 33, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("img", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "7599de42a5664bc2a4d6c7f1a33e37e2", async() => {
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_5);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(4464, 2, true);
                WriteLiteral("\r\n");
                EndContext();
#line 95 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
            }

#line default
#line hidden
            BeginContext(4493, 117, true);
            WriteLiteral("                    </div>\r\n                </div>\r\n                <div class=\"comment-block\">\r\n                    ");
            EndContext();
            BeginContext(4610, 186, false);
            __tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "6cfdc66fd97f4d6db72e12fe17a84a82", async() => {
                BeginContext(4626, 163, true);
                WriteLiteral("\r\n                        <textarea class=\"form-control\" name=\"\" id=\"CommentText\" cols=\"30\" rows=\"1\" placeholder=\"Add a reply...\"></textarea>\r\n                    ");
                EndContext();
            }
                                                                        );
            __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper);
            __Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper);
            __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_6);
            await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

            if (!__tagHelperExecutionContext.Output.IsContentModified)
            {
                await __tagHelperExecutionContext.SetOutputContentAsync();
            }
            Write(__tagHelperExecutionContext.Output);
            __tagHelperExecutionContext = __tagHelperScopeManager.End();
            EndContext();
            BeginContext(4796, 422, true);
            WriteLiteral(@"
                </div>
                <button id=""btnReply"" type=""button"" class=""btn btn-primary commentbtn float-right"" disabled style=""margin-bottom: 4px;"">Reply</button>
                <button id=""btnReply"" type=""button"" class=""btn btn-light float-right"" style=""margin-bottom: 4px;"" onclick=""$(this).parent().css('display', 'none'); $(this).parent().attr('data-isshown', 0);"">Cancel</button>
            </div>
");
            EndContext();
#line 106 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
            if (Model.ChildComments != null)
            {
                if (Model.ChildComments.Count > 0)
                {
#line default
#line hidden
                    BeginContext(5350, 52, true);
                    WriteLiteral("                    <a data-isshown=\"0\" data-cnter=\"");
                    EndContext();
                    BeginContext(5403, 25, false);
#line 110 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                    Write(Model.ChildComments.Count);

#line default
#line hidden
                    EndContext();
                    BeginContext(5428, 66, true);
                    WriteLiteral("\" onclick=\"ViewReplies(this)\" href=\"javascript:void(0);\"><h6>View ");
                    EndContext();
                    BeginContext(5495, 25, false);
#line 110 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                    Write(Model.ChildComments.Count);

#line default
#line hidden
                    EndContext();
                    BeginContext(5520, 19, true);
                    WriteLiteral(" Replies</h6></a>\r\n");
                    EndContext();
#line 111 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                }

                foreach (var reply in Model.ChildComments)
                {
#line default
#line hidden
                    BeginContext(5639, 122, true);
                    WriteLiteral("                    <div class=\"comment-wrap reply\" style=\"display: none;\">\r\n                        <div class=\"photo\">\r\n");
                    EndContext();
#line 117 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                    if (reply.IsAvatarProfilePicture ?? false)
                    {
#line default
#line hidden
                        BeginContext(5865, 51, true);
                        WriteLiteral("                                <img class=\"avatar\"");
                        EndContext();
                        BeginWriteAttribute("src", " src=\"", 5916, "\"", 5975, 1);
#line 119 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                        WriteAttributeValue("", 5922, PurchasesTool.GetProduct(reply.SelectedAvatar).Image, 5922, 53, false);

#line default
#line hidden
                        EndWriteAttribute();
                        BeginContext(5976, 3, true);
                        WriteLiteral(">\r\n");
                        EndContext();
#line 120 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(reply.UserPhoto))
                        {
#line default
#line hidden
                            BeginContext(6187, 55, true);
                            WriteLiteral("                                    <img class=\"avatar\"");
                            EndContext();
                            BeginWriteAttribute("src", " src=\"", 6242, "\"", 6264, 1);
#line 125 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                            WriteAttributeValue("", 6248, reply.UserPhoto, 6248, 16, false);

#line default
#line hidden
                            EndWriteAttribute();
                            BeginContext(6265, 3, true);
                            WriteLiteral(">\r\n");
                            EndContext();
#line 126 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                        }
                        else
                        {
#line default
#line hidden
                            BeginContext(6376, 36, true);
                            WriteLiteral("                                    ");
                            EndContext();
                            BeginContext(6412, 46, false);
                            __tagHelperExecutionContext = __tagHelperScopeManager.Begin("img", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "f4611c3621ef4c8eb2fd5cd36f3c8b5d", async() => {
                            }
                                                                                        );
                            __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
                            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
                            __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0);
                            __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1);
                            await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                            if (!__tagHelperExecutionContext.Output.IsContentModified)
                            {
                                await __tagHelperExecutionContext.SetOutputContentAsync();
                            }
                            Write(__tagHelperExecutionContext.Output);
                            __tagHelperExecutionContext = __tagHelperScopeManager.End();
                            EndContext();
                            BeginContext(6458, 2, true);
                            WriteLiteral("\r\n");
                            EndContext();
#line 130 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                        }
                    }

#line default
#line hidden
                    BeginContext(6526, 179, true);
                    WriteLiteral("                        </div>\r\n                        <div class=\"comment-block\">\r\n                            <ul class=\"comment-actions\">\r\n                                <li>");
                    EndContext();
                    BeginContext(6705, 172, false);
                    __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "9ef44a7df3204778beb548a41fe5bec0", async() => {
                        BeginContext(6844, 3, true);
                        WriteLiteral("<b>");
                        EndContext();
                        BeginContext(6848, 21, false);
#line 135 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                        Write(reply.UserDisplayName);

#line default
#line hidden
                        EndContext();
                        BeginContext(6869, 4, true);
                        WriteLiteral("</b>");
                        EndContext();
                    }
                                                                                );
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                    __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_2.Value;
                    __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_2);
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_3.Value;
                    __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_3);
                    if (__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues == null)
                    {
                        throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-id", "Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper", "RouteValues"));
                    }
                    BeginWriteTagHelperAttribute();
#line 135 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                    WriteLiteral(reply.UserId);

#line default
#line hidden
                    __tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"] = __tagHelperStringValueBuffer;
                    __tagHelperExecutionContext.AddTagHelperAttribute("asp-route-id", __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
                    __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_4);
                    await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                    if (!__tagHelperExecutionContext.Output.IsContentModified)
                    {
                        await __tagHelperExecutionContext.SetOutputContentAsync();
                    }
                    Write(__tagHelperExecutionContext.Output);
                    __tagHelperExecutionContext = __tagHelperScopeManager.End();
                    EndContext();
                    BeginContext(6877, 111, true);
                    WriteLiteral("</li>\r\n                                <li class=\"right\"><span style=\"color: lightslategray; font-size: 11px;\">");
                    EndContext();
                    BeginContext(6989, 37, false);
#line 136 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                    Write(reply.CreatedTime.ToShortDateString());

#line default
#line hidden
                    EndContext();
                    BeginContext(7026, 1, true);
                    WriteLiteral(" ");
                    EndContext();
                    BeginContext(7028, 2, true);
                    WriteLiteral("@ ");
                    EndContext();
                    BeginContext(7031, 37, false);
#line 136 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                    Write(reply.CreatedTime.ToShortTimeString());

#line default
#line hidden
                    EndContext();
                    BeginContext(7068, 171, true);
                    WriteLiteral("</span></li>\r\n                            </ul>\r\n                            <br />\r\n                            <p class=\"comment-text\">\r\n                                ");
                    EndContext();
                    BeginContext(7240, 10, false);
#line 140 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                    Write(reply.Text);

#line default
#line hidden
                    EndContext();
                    BeginContext(7250, 156, true);
                    WriteLiteral("\r\n                            </p>\r\n                            <div class=\"bottom-comment\">\r\n                                <ul class=\"comment-actions\">\r\n");
                    EndContext();
#line 144 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                    if (User != null)
                    {
                        if (User.Identity.IsAuthenticated)
                        {
#line default
#line hidden
                            BeginContext(7620, 102, true);
                            WriteLiteral("                                            <li><a><i class=\"material-icons reactionbtn\">thumb_up</i> ");
                            EndContext();
                            BeginContext(7724, 65, false);
#line 148 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                            Write(reply.ChildrenCounts.Count > 0 ? reply.ChildrenCounts["like"] : 0);

#line default
#line hidden
                            EndContext();
                            BeginContext(7790, 139, true);
                            WriteLiteral("</a></li>\r\n                                            <li class=\"right\"><a><i class=\"material-icons reactionbtn\">thumb_down</i></a></li>\r\n");
                            EndContext();
#line 150 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                        }
                        else
                        {
#line default
#line hidden
                            BeginContext(8061, 133, true);
                            WriteLiteral("                                            <li><a onclick=\"RequireLogin(\'Like\')\"><i class=\"material-icons reactionbtn\">thumb_up</i> ");
                            EndContext();
                            BeginContext(8196, 65, false);
#line 153 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                            Write(reply.ChildrenCounts.Count > 0 ? reply.ChildrenCounts["like"] : 0);

#line default
#line hidden
                            EndContext();
                            BeginContext(8262, 173, true);
                            WriteLiteral("</a></li>\r\n                                            <li class=\"right\"><a onclick=\"RequireLogin(\'Dislike\')\"><i class=\"material-icons reactionbtn\">thumb_down</i></a></li>\r\n");
                            EndContext();
#line 155 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                        }
                    }
                    else
                    {
#line default
#line hidden
                        BeginContext(8598, 129, true);
                        WriteLiteral("                                        <li><a onclick=\"RequireLogin(\'Like\')\"><i class=\"material-icons reactionbtn\">thumb_up</i> ");
                        EndContext();
                        BeginContext(8729, 65, false);
#line 159 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                        Write(reply.ChildrenCounts.Count > 0 ? reply.ChildrenCounts["like"] : 0);

#line default
#line hidden
                        EndContext();
                        BeginContext(8795, 169, true);
                        WriteLiteral("</a></li>\r\n                                        <li class=\"right\"><a onclick=\"RequireLogin(\'Dislike\')\"><i class=\"material-icons reactionbtn\">thumb_down</i></a></li>\r\n");
                        EndContext();
#line 161 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                    }

#line default
#line hidden
                    BeginContext(9003, 135, true);
                    WriteLiteral("                                </ul>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n");
                    EndContext();
#line 166 "C:\Users\bonqu\source\github\TokkepediaWeb\Tokkepedia\Views\Shared\CommentView.cshtml"
                }
            }

#line default
#line hidden
            BeginContext(9172, 36, true);
            WriteLiteral("        </div>\r\n    </div>\r\n</div>\r\n");
            EndContext();
        }
コード例 #6
0
 public async Task <IActionResult> Avatars()
 {
     return(View(PurchasesTool.GetProducts()));
 }