view: update icons
Some checks failed
/ push (push) Has been cancelled

This commit is contained in:
Tigor Hutasuhut 2024-05-28 15:36:10 +07:00
parent e887675346
commit d2b81567e3
2 changed files with 20 additions and 5 deletions

View file

@ -60,6 +60,7 @@ func (routes *Routes) registerHTMXRoutes(router chi.Router) {
router.Post("/subreddits/add", routes.SubredditsCreateHTMX) router.Post("/subreddits/add", routes.SubredditsCreateHTMX)
router.Post("/subreddits/start", routes.SubredditStartDownloadHTMX) router.Post("/subreddits/start", routes.SubredditStartDownloadHTMX)
router.Get("/subreddits/start", routes.SubredditStartDownloadHTMX)
router.Get("/subreddits/check", routes.SubredditCheckHTMX) router.Get("/subreddits/check", routes.SubredditCheckHTMX)
router.Get("/subreddits/validate/schedule", routes.SubredditValidateScheduleHTMX) router.Get("/subreddits/validate/schedule", routes.SubredditValidateScheduleHTMX)

View file

@ -46,21 +46,28 @@ templ DetailsContent(c *views.Context, data Data) {
<h1 class="my-auto">Subreddit { data.Subreddit.Name }</h1> <h1 class="my-auto">Subreddit { data.Subreddit.Name }</h1>
<div class="max-xs:toast max-xs:z-40"> <div class="max-xs:toast max-xs:z-40">
<div class="dropdown dropdown-hover dropdown-top xs:dropdown-bottom dropdown-end"> <div class="dropdown dropdown-hover dropdown-top xs:dropdown-bottom dropdown-end">
<div tabindex="0" role="button" class="btn btn-primary max-xs:btn-circle btn-square xs:btn-outline m-1 max-xs:border-none"> <div
tabindex="0"
role="button"
class="btn btn-primary max-xs:btn-circle max-lg:btn-square xs:btn-outline m-1 max-xs:border-none"
>
@icons.Kebab("h-8 w-8") @icons.Kebab("h-8 w-8")
</div> </div>
<ul tabindex="0" class="dropdown-content z-[1] menu p-2 shadow bg-base-100 rounded-box w-52 m-0 border-primary border-2"> <ul
tabindex="0"
class="dropdown-content z-[1] menu p-2 shadow bg-base-100 rounded-box w-52 m-0 border-primary border-2"
onclick="document.activeElement.blur()"
>
<li class="m-0 p-0 hover:bg-primary rounded-btn"> <li class="m-0 p-0 hover:bg-primary rounded-btn">
<button <button
hx-post="/htmx/subreddits/start" hx-get="/htmx/subreddits/start"
hx-include="this"
hx-target={ components.NotificationContainerID } hx-target={ components.NotificationContainerID }
hx-target-error={ components.NotificationContainerID } hx-target-error={ components.NotificationContainerID }
hx-swap="afterbegin" hx-swap="afterbegin"
hx-vals={ fmt.Sprintf(`{"subreddit":%q}`, data.Subreddit.Name) }
class="btn btn-ghost btn-sm m-0" class="btn btn-ghost btn-sm m-0"
> >
Start Download Start Download
<input type="hidden" name="subreddit" value={ data.Subreddit.Name }/>
</button> </button>
</li> </li>
<div class="divider m-0 p-0"></div> <div class="divider m-0 p-0"></div>
@ -70,6 +77,13 @@ templ DetailsContent(c *views.Context, data Data) {
class="btn btn-ghost btn-sm no-underline m-0" class="btn btn-ghost btn-sm no-underline m-0"
>Edit</a> >Edit</a>
</li> </li>
<div class="xs:hidden divider m-0 p-0"></div>
<li class="xs:hidden m-0 p-0 hover:bg-primary rounded-btn">
<button
class="btn btn-ghost btn-sm m-0"
onclick="window.scrollTo({ top: 0, behavior: 'smooth' })"
>Scroll to Top</button>
</li>
</ul> </ul>
</div> </div>
</div> </div>