Started working on job UI implementation

This commit is contained in:
2018-04-28 19:44:44 +02:00
parent 3983894a27
commit 59633707c1
6 changed files with 61 additions and 1 deletions

View File

@ -33,6 +33,7 @@ component Editor(url string, score int, scoreTitle string, scoreTypes map[string
.footer.mountable
a.footer-element(href="/editor/mal/diff/anime" + user.Settings().Editor.Filter.Suffix()) MALdiff
a.footer-element(href="/editor/kitsu/new/anime") Kitsu
a.footer-element(href="/editor/jobs") Jobs
if user.Role == "admin"
a.footer-element(href="/admin") Admin

17
pages/editor/jobs/jobs.go Normal file
View File

@ -0,0 +1,17 @@
package jobs
import (
"github.com/aerogo/aero"
"github.com/animenotifier/notify.moe/components"
"github.com/animenotifier/notify.moe/utils"
)
var running = map[string]bool{}
var lastRun = map[string]string{}
// Overview shows all background jobs.
func Overview(ctx *aero.Context) string {
user := utils.GetUser(ctx)
return ctx.HTML(components.EditorJobs(running, lastRun, ctx.URI(), user))
}

View File

@ -0,0 +1,9 @@
component EditorJobs(running bool, url string, user *arn.User)
EditorTabs(url, user)
h1.editor-list-page-title.mountable Background jobs
.buttons
button.mountable.action(data-action="startJob", data-trigger="click", data-job="twist", disabled=running)
Icon("rocket")
span twist