Skip to content

Commit

Permalink
Fix HTMX examples
Browse files Browse the repository at this point in the history
  • Loading branch information
sake92 committed Oct 9, 2024
1 parent 7a83b07 commit ae94819
Show file tree
Hide file tree
Showing 18 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion examples/scala-cli/htmx/htmx_active_search.sc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ object views {
trait BasePage extends HtmlPage with HtmxDependencies

class ContactsViewPage(contacts: Seq[Contact]) extends BasePage:
override def bodyContent = div(
override def pageContent = div(
h1("Active Search example"),
span(cls := "htmx-indicator")(
img(src := "/img/bars.svg"),
Expand Down
10 changes: 5 additions & 5 deletions examples/scala-cli/htmx/htmx_animations.sc
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import ba.sake.sharaf.*, routing.*
trait ExamplePage extends HtmlPage with HtmxDependencies

object IndexView extends ExamplePage:
override def bodyContent = ul(
override def pageContent = ul(
li(a(href := "color-throb")("Color throb")),
li(a(href := "fade-out-on-swap")("Fade Out On Swap")),
li(a(href := "fade-in-on-addition")("Fade In On Addition")),
li(a(href := "request-in-flight")("Request In Flight"))
)

object ColorThrobView extends ExamplePage:
override def bodyContent = snippet("red")
override def pageContent = snippet("red")

def snippet(color: String) = div(
id := "color-demo", // must stay same!
Expand All @@ -38,7 +38,7 @@ object ColorThrobView extends ExamplePage:
""")

object FadeOutOnSwapView extends ExamplePage:
override def bodyContent = button(
override def pageContent = button(
cls := "fade-me-out",
hx.delete := "/fade_out_demo",
hx.swap := "outerHTML swap:1s"
Expand All @@ -52,7 +52,7 @@ object FadeOutOnSwapView extends ExamplePage:
""")

object FadeInOnAdditionView extends ExamplePage:
override def bodyContent = theButton
override def pageContent = theButton

val theButton = button(
id := "fade-me-in",
Expand All @@ -71,7 +71,7 @@ object FadeInOnAdditionView extends ExamplePage:
""")

object RequestInFlightView extends ExamplePage:
override def bodyContent = form(
override def pageContent = form(
hx.post := "/request-in-flight-name",
hx.swap := "outerHTML"
)(
Expand Down
2 changes: 1 addition & 1 deletion examples/scala-cli/htmx/htmx_bulk_update.sc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ object views {
trait BasePage extends HtmlPage with HtmxDependencies

class ContactsViewPage(contacts: Seq[Contact]) extends BasePage {
override def bodyContent = div(
override def pageContent = div(
h1("Bulk Updating example"),
div(hx.include := "#checked-contacts", hx.target := "#tbody")(
button(hx.put := "/activate")("Activate"),
Expand Down
2 changes: 1 addition & 1 deletion examples/scala-cli/htmx/htmx_cascading_selects.sc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import ba.sake.querson.QueryStringRW
import ba.sake.sharaf.*, routing.*

class IndexView(make: CarMake) extends HtmlPage with HtmxDependencies:
override def bodyContent = div(
override def pageContent = div(
div(
label("Make"),
select(
Expand Down
2 changes: 1 addition & 1 deletion examples/scala-cli/htmx/htmx_click_edit.sc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ object views {
trait BasePage extends HtmlPage with HtmxDependencies

class ContactViewPage(formData: ContactForm) extends BasePage:
override def bodyContent = div(
override def pageContent = div(
h1("Click to Edit example"),
contactView(formData)
)
Expand Down
2 changes: 1 addition & 1 deletion examples/scala-cli/htmx/htmx_click_to_load.sc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ object views {
trait BasePage extends HtmlPage with HtmxDependencies

class ContactsViewPage(contacts: Seq[Contact], page: Int) extends BasePage:
override def bodyContent = div(
override def pageContent = div(
h1("Click to Load example"),
table(
thead(tr(th("ID"), th("Name"), th("Email"))),
Expand Down
2 changes: 1 addition & 1 deletion examples/scala-cli/htmx/htmx_delete_row.sc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ object views {
trait BasePage extends HtmlPage with HtmxDependencies

class ContactsViewPage(contacts: Seq[Contact]) extends BasePage:
override def bodyContent = div(
override def pageContent = div(
h1("Delete Row example"),
table()(
thead(tr(th("Name"), th("Email"), th(""))),
Expand Down
2 changes: 1 addition & 1 deletion examples/scala-cli/htmx/htmx_dialogs_bootstrap.sc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ba.sake.hepek.htmx.*
import ba.sake.sharaf.*, routing.*

object IndexView extends BootstrapPage with HtmxDependencies:
override def bodyContent = div(
override def pageContent = div(
button(
hx.get := "/modal",
hx.trigger := "click",
Expand Down
2 changes: 1 addition & 1 deletion examples/scala-cli/htmx/htmx_dialogs_bootstrap_form.sc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import ba.sake.formson.FormDataRW
import ba.sake.sharaf.*, routing.*

object IndexView extends BootstrapPage with HtmxDependencies:
override def bodyContent = div(
override def pageContent = div(
button(
hx.get := "/modal",
hx.trigger := "click",
Expand Down
2 changes: 1 addition & 1 deletion examples/scala-cli/htmx/htmx_dialogs_browser.sc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import ba.sake.hepek.htmx.*
import ba.sake.sharaf.*, routing.*

object IndexView extends HtmlPage with HtmxDependencies:
override def bodyContent = div(
override def pageContent = div(
button(
hx.post := "/submit",
hx.prompt := "Enter a string",
Expand Down
2 changes: 1 addition & 1 deletion examples/scala-cli/htmx/htmx_edit_row.sc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ object views {
trait BasePage extends HtmlPage with HtmxDependencies

class ContactsViewPage(contacts: Seq[Contact]) extends BasePage:
override def bodyContent = div(
override def pageContent = div(
h1("Click to Edit example"),
table(
thead(tr(th("Name"), th("Email"), th())),
Expand Down
2 changes: 1 addition & 1 deletion examples/scala-cli/htmx/htmx_file_upload_js.sc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import ba.sake.sharaf.*, routing.*
// https://htmx.org/examples/file-upload/

object IndexView extends HtmlPage with HtmxDependencies:
override def bodyContent = form(
override def pageContent = form(
id := "form",
hx.encoding := "multipart/form-data",
hx.post := "/upload",
Expand Down
2 changes: 1 addition & 1 deletion examples/scala-cli/htmx/htmx_infinite_scroll.sc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ object views {
trait BasePage extends HtmlPage with HtmxDependencies

class ContactsViewPage(contacts: Seq[Contact], page: Int) extends BasePage:
override def bodyContent = div(
override def pageContent = div(
h1("Infinite Scroll example"),
table(hx.indicator := ".htmx-indicator")(
thead(tr(th("ID"), th("Name"), th("Email"))),
Expand Down
2 changes: 1 addition & 1 deletion examples/scala-cli/htmx/htmx_inline_validation.sc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ object views {
import ba.sake.hepek.htmx.*

class IndexView(formData: ContactForm) extends HtmlPage with HtmxDependencies:
override def bodyContent = div(
override def pageContent = div(
h3("Inline Validation example"),
p("Only valid email is [email protected]"),
contactForm(formData)
Expand Down
2 changes: 1 addition & 1 deletion examples/scala-cli/htmx/htmx_lazy_load.sc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ba.sake.hepek.htmx.*
import ba.sake.sharaf.*, routing.*

object IndexView extends HtmlPage with HtmxDependencies:
override def bodyContent = div(hx.get := "/graph", hx.trigger := "load")(
override def pageContent = div(hx.get := "/graph", hx.trigger := "load")(
img(src := "/img/bars.svg", alt := "Result loading...", cls := "htmx-indicator")
)

Expand Down
2 changes: 1 addition & 1 deletion examples/scala-cli/htmx/htmx_load_snippet.sc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import ba.sake.hepek.htmx.*
import ba.sake.sharaf.*, routing.*

object IndexView extends HtmlPage with HtmxDependencies:
override def bodyContent =
override def pageContent =
button(hx.post := "/html-snippet", hx.swap := "outerHTML")("Click here!")

val routes = Routes:
Expand Down
2 changes: 1 addition & 1 deletion examples/scala-cli/htmx/htmx_progress_bar.sc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import ba.sake.sharaf.*, routing.*
import ba.sake.sharaf.htmx.ResponseHeaders

object IndexView extends HtmlPage with HtmxDependencies:
override def bodyContent =
override def pageContent =
div(hx.target := "this", hx.swap := "outerHTML")(
h3("Start Progress"),
button(hx.post := "/start")("Start Job")
Expand Down
2 changes: 1 addition & 1 deletion examples/scala-cli/htmx/htmx_tabs_hateoas.sc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import ba.sake.hepek.htmx.*
import ba.sake.sharaf.*, routing.*

object IndexView extends HtmlPage with HtmxDependencies:
override def bodyContent =
override def pageContent =
div(id := "tabs", hx.get := "/tab1", hx.trigger := "load delay:100ms", hx.target := "#tabs", hx.swap := "innerHTML")

def tabSnippet(tabNum: Int) = div(
Expand Down

0 comments on commit ae94819

Please sign in to comment.