diff --git a/core/webapi/novel.go b/core/webapi/novel.go index 5218f82..375daeb 100644 --- a/core/webapi/novel.go +++ b/core/webapi/novel.go @@ -108,7 +108,7 @@ func GetNovelRelated(c *fiber.Ctx, id string) ([]NovelBrief, error) { } // hard-coded value, may change - URL := http.GetNovelRelatedURL(id, 100) + URL := http.GetNovelRelatedURL(id, 50) response, err := http.UnwrapWebAPIRequest(c.Context(), URL, "") if err != nil { diff --git a/pages/novel.go b/pages/novel.go index 3ce5bfb..5a770bc 100644 --- a/pages/novel.go +++ b/pages/novel.go @@ -24,10 +24,15 @@ func NovelPage(c *fiber.Ctx) error { return err } - // todo: passing ArtWorkData{} here will not work. maybe lowercase? + user, err := core.GetUserBasicInformation(c, novel.UserID) + if err != nil { + return err + } + return c.Render("pages/novel", fiber.Map{ "Novel": novel, "NovelRelated": related, + "User": user, "Title": novel.Title, }) } diff --git a/views/css/style.css b/views/css/style.css index 37eb58d..ab47d38 100644 --- a/views/css/style.css +++ b/views/css/style.css @@ -576,6 +576,32 @@ nav .sidebar-item img { margin-right: 5px; } +.illust-attr { + display: flex; + align-items: center; + margin-top: 10px; + margin-bottom: 10px; +} +.illust-attr .illust-avatar { + width: 62px; + height: 62px; + border-radius: 50px; + object-fit: cover; + object-position: center top; +} +.illust-attr .attr-wrap { + margin-left: 5px; +} +.illust-attr .attr-wrap .illust-title { + font-weight: bold; +} +.illust-attr .attr-wrap .illust-author { + font-size: 0.8em; +} +.illust-attr .attr-wrap a { + color: #aaa; +} + .illust { background-color: #222; border-radius: 5px; @@ -593,31 +619,6 @@ nav .sidebar-item img { width: auto; max-width: 100%; } -.illust .illust-attr { - display: flex; - align-items: center; - margin-top: 10px; - margin-bottom: 10px; -} -.illust .illust-attr .illust-avatar { - width: 62px; - height: 62px; - border-radius: 50px; - object-fit: cover; - object-position: center top; -} -.illust .illust-attr .attr-wrap { - margin-left: 5px; -} -.illust .illust-attr .attr-wrap .illust-title { - font-weight: bold; -} -.illust .illust-attr .attr-wrap .illust-author { - font-size: 0.8em; -} -.illust .illust-attr .attr-wrap .illust-author a { - color: #aaa; -} .illust .illust-description { font-size: 0.85em; } diff --git a/views/css/style.scss b/views/css/style.scss index a4b521e..6e93e08 100644 --- a/views/css/style.scss +++ b/views/css/style.scss @@ -666,6 +666,35 @@ nav { } } +.illust-attr { + display: flex; + align-items: center; + margin-top: 10px; + margin-bottom: 10px; + + .illust-avatar { + width: 62px; + height: 62px; + border-radius: 50px; + object-fit: cover; + object-position: center top; + } + + .attr-wrap { + margin-left: 5px; + + .illust-title { + font-weight: bold; + } + .illust-author { + font-size: 0.8em; + } + a { + color: $fg-secondary; + } + } +} + .illust { background-color: $bg-secondary; border-radius: $border-radius; @@ -685,34 +714,6 @@ nav { } } - .illust-attr { - display: flex; - align-items: center; - margin-top: 10px; - margin-bottom: 10px; - - .illust-avatar { - width: 62px; - height: 62px; - border-radius: 50px; - object-fit: cover; - object-position: center top; - } - - .attr-wrap { - margin-left: 5px; - - .illust-title { - font-weight: bold; - } - .illust-author { - font-size: 0.8em; - a { - color: $fg-secondary; - } - } - } - } .illust-description { font-size: 0.85em; diff --git a/views/pages/novel.jet.html b/views/pages/novel.jet.html index 6bbe93c..c89dc53 100644 --- a/views/pages/novel.jet.html +++ b/views/pages/novel.jet.html @@ -62,9 +62,23 @@