Added list item status
This commit is contained in:
parent
7f9d599b50
commit
dc4d4ae34c
@ -13,7 +13,7 @@ component InputNumber(id string, value float64, label string, placeholder string
|
||||
label(for=id)= label + ":"
|
||||
input.widget-element.action(id=id, type="number", value=value, min=min, max=max, step=step, placeholder=placeholder, title=placeholder, data-action="save", data-trigger="change")
|
||||
|
||||
component InputSelection(id string, value string, label string, placeholder string)
|
||||
component InputSelection(id string, value string, label string, placeholder string, values []string)
|
||||
.widget-input
|
||||
label(for=id)= label + ":"
|
||||
select.widget-element.action(id=id, value=value, title=placeholder, data-action="save", data-trigger="change")
|
||||
|
@ -1,7 +1,7 @@
|
||||
.anime-list
|
||||
vertical
|
||||
width 100%
|
||||
max-width 1100px
|
||||
max-width 1200px
|
||||
margin 0 auto
|
||||
|
||||
tr
|
||||
|
@ -5,6 +5,14 @@ component AnimeListItem(viewUser *arn.User, item *arn.AnimeListItem, anime *arn.
|
||||
|
||||
InputNumber("Episodes", float64(item.Episodes), "Episodes", "Number of episodes you watched", "0", arn.EpisodeCountMax(anime.EpisodeCount), "1")
|
||||
|
||||
label(for="Status") Status:
|
||||
select.widget-element.action(id="Status", value=item.Status, data-action="save", data-trigger="change")
|
||||
option(value=arn.AnimeListStatusWatching) Watching
|
||||
option(value=arn.AnimeListStatusCompleted) Completed
|
||||
option(value=arn.AnimeListStatusPlanned) Plan to watch
|
||||
option(value=arn.AnimeListStatusHold) On hold
|
||||
option(value=arn.AnimeListStatusDropped) Dropped
|
||||
|
||||
.anime-list-item-rating-edit
|
||||
InputNumber("Rating.Overall", item.Rating.Overall, "Overall", "Overall rating on a scale of 0 to 10", "0", "10", "0.1")
|
||||
InputNumber("Rating.Story", item.Rating.Story, "Story", "Story rating on a scale of 0 to 10", "0", "10", "0.1")
|
||||
|
@ -5,7 +5,7 @@ component NewThread(user *arn.User)
|
||||
|
||||
textarea#text.widget-element(placeholder="Content")
|
||||
|
||||
select#tag.widget-element
|
||||
select#tag.widget-element(value="general")
|
||||
option(value="general") General
|
||||
option(value="news") News
|
||||
option(value="anime") Anime
|
||||
|
@ -71,9 +71,16 @@ export class AnimeNotifier {
|
||||
|
||||
// Update each of these asynchronously
|
||||
Promise.resolve().then(() => this.mountMountables())
|
||||
Promise.resolve().then(() => this.assignActions())
|
||||
Promise.resolve().then(() => this.lazyLoadImages())
|
||||
Promise.resolve().then(() => this.displayLocalDates())
|
||||
Promise.resolve().then(() => this.setSelectBoxValue())
|
||||
Promise.resolve().then(() => this.assignActions())
|
||||
}
|
||||
|
||||
setSelectBoxValue() {
|
||||
for(let element of document.getElementsByTagName("select")) {
|
||||
element.value = element.getAttribute("value")
|
||||
}
|
||||
}
|
||||
|
||||
displayLocalDates() {
|
||||
@ -229,7 +236,7 @@ export class AnimeNotifier {
|
||||
this.unmountMountables()
|
||||
this.loading(true)
|
||||
|
||||
return delay(300).then(() => {
|
||||
return delay(330).then(() => {
|
||||
request
|
||||
.then(html => this.app.setContent(html, true))
|
||||
.then(() => this.app.markActiveLinks())
|
||||
|
@ -57,6 +57,11 @@ export class Diff {
|
||||
let attrib = elemB.attributes[x]
|
||||
|
||||
if(attrib.specified) {
|
||||
// Skip mountables
|
||||
if(attrib.name == "class" && elemA.classList.contains("mounted")) {
|
||||
continue
|
||||
}
|
||||
|
||||
elemA.setAttribute(attrib.name, elemB.getAttribute(attrib.name))
|
||||
}
|
||||
}
|
||||
|
@ -61,4 +61,4 @@ nav-height = 3.11rem
|
||||
|
||||
// Timings
|
||||
fade-speed = 200ms
|
||||
transition-speed = 290ms
|
||||
transition-speed = 250ms
|
@ -62,9 +62,12 @@ button, .button
|
||||
// // box-shadow 0 0 6px alpha(mainColor, 20%)
|
||||
// border 1px solid main-color
|
||||
|
||||
// select
|
||||
// ui-element
|
||||
// font-size 1rem
|
||||
select
|
||||
ui-element
|
||||
appearance none
|
||||
-webkit-appearance none
|
||||
-moz-appearance none
|
||||
font-size 1rem
|
||||
// padding 0.5em 1em
|
||||
|
||||
label
|
||||
|
Loading…
Reference in New Issue
Block a user