Skip to content

Commit

Permalink
Merge pull request #50 from BryanMoslo/master
Browse files Browse the repository at this point in the history
Generating .plush.html files
  • Loading branch information
paganotoni authored Oct 3, 2019
2 parents 9265549 + c12ffd2 commit 324823c
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 15 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: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ require (
github.com/pkg/errors v0.8.1
github.com/spf13/cobra v0.0.5
)

2 changes: 1 addition & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -278,4 +278,4 @@ gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bl
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
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 324823c

Please sign in to comment.