Skip to content

Commit

Permalink
updating file names to use .plush.html extension
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanMoslo committed Sep 14, 2019
1 parent 0096f0d commit fa569cf
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion filetests/aditional_fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"PhoneNumber"
]
},{
"path": "templates/users/new.html",
"path": "templates/users/new.plush.html",
"contains": [
"<%= f.InputTag(\"FirstName\", {}) %>",
"<%= f.InputTag(\"LastName\", {}) %>",
Expand Down
6 changes: 3 additions & 3 deletions genny/auth/a_auth-packr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions genny/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func New(args []string) (*genny.Generator, error) {
ctx.Set("attrs", fields)

g.Transformer(plushgen.Transformer(ctx))
g.Transformer(genny.NewTransformer(".html", newUserHTMLTransformer))
g.Transformer(genny.NewTransformer(".plush.html", newUserHTMLTransformer))
g.Transformer(genny.NewTransformer(".fizz", migrationsTransformer(time.Now())))

g.RunFn(func(r *genny.Runner) error {
Expand Down Expand Up @@ -91,7 +91,7 @@ func New(args []string) (*genny.Generator, error) {
}

func newUserHTMLTransformer(f genny.File) (genny.File, error) {
if f.Name() != filepath.Join("templates", "users", "new.html") {
if f.Name() != filepath.Join("templates", "users", "new.plush.html") {
return f, nil
}

Expand Down
4 changes: 2 additions & 2 deletions genny/auth/templates/actions/auth.go.plush
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
// AuthNew loads the signin page
func AuthNew(c buffalo.Context) error {
c.Set("user", models.User{})
return c.Render(200, r.HTML("auth/new.html"))
return c.Render(200, r.HTML("auth/new.plush.html"))
}

// AuthCreate attempts to log the user in with an existing account.
Expand All @@ -37,7 +37,7 @@ func AuthCreate(c buffalo.Context) error {
verrs := validate.NewErrors()
verrs.Add("email", "invalid email/password")
c.Set("errors", verrs)
return c.Render(422, r.HTML("auth/new.html"))
return c.Render(422, r.HTML("auth/new.plush.html"))
}

if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions genny/auth/templates/actions/users.go.plush
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
func UsersNew(c buffalo.Context) error {
u := models.User{}
c.Set("user", u)
return c.Render(200, r.HTML("users/new.html"))
return c.Render(200, r.HTML("users/new.plush.html"))
}

// UsersCreate registers a new user with the application.
Expand All @@ -29,7 +29,7 @@ func UsersCreate(c buffalo.Context) error {
if verrs.HasAny() {
c.Set("user", u)
c.Set("errors", verrs)
return c.Render(200, r.HTML("users/new.html"))
return c.Render(200, r.HTML("users/new.plush.html"))
}

c.Session().Set("current_user_id", u.ID)
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ require (
github.com/gobuffalo/packr/v2 v2.0.1
github.com/gobuffalo/plush v3.7.33+incompatible
github.com/gobuffalo/plushgen v0.0.0-20190224160205-347ea233336e
github.com/gobuffalo/tags v2.1.0+incompatible // indirect
github.com/gobuffalo/uuid v2.0.5+incompatible // indirect
github.com/gobuffalo/validate v2.0.3+incompatible // indirect
github.com/pkg/errors v0.8.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ github.com/gobuffalo/tags v2.0.11+incompatible/go.mod h1:9XmhOkyaB7UzvuY4UoZO4s6
github.com/gobuffalo/tags v2.0.14+incompatible/go.mod h1:9XmhOkyaB7UzvuY4UoZO4s67q8/xRMVJEaakauVQYeY=
github.com/gobuffalo/tags v2.0.15+incompatible h1:qc5hMXPsXD+zYPSlNgqzlpVW7z/+GJEVCqn245BEUIY=
github.com/gobuffalo/tags v2.0.15+incompatible/go.mod h1:9XmhOkyaB7UzvuY4UoZO4s67q8/xRMVJEaakauVQYeY=
github.com/gobuffalo/tags v2.1.0+incompatible h1:qQjj3n2RtHxfooqXQ4/A9SsEfZ7/7guv8cp/GdAPa+Y=
github.com/gobuffalo/tags v2.1.0+incompatible/go.mod h1:9XmhOkyaB7UzvuY4UoZO4s67q8/xRMVJEaakauVQYeY=
github.com/gobuffalo/uuid v2.0.3+incompatible/go.mod h1:ErhIzkRhm0FtRuiE/PeORqcw4cVi1RtSpnwYrxuvkfE=
github.com/gobuffalo/uuid v2.0.4+incompatible/go.mod h1:ErhIzkRhm0FtRuiE/PeORqcw4cVi1RtSpnwYrxuvkfE=
github.com/gobuffalo/uuid v2.0.5+incompatible h1:c5uWRuEnYggYCrT9AJm0U2v1QTG7OVDAvxhj8tIV5Gc=
Expand Down
6 changes: 3 additions & 3 deletions packrd/packed-packr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fa569cf

Please sign in to comment.