Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve templates:form-control #51

Merged
merged 3 commits into from
Sep 11, 2020
Merged

Conversation

bwbohl
Copy link
Contributor

@bwbohl bwbohl commented Jul 15, 2020

adds a switch case for the xhtml:form element itself for externally supplying the form/@action via templating.

adds a switch case for the xhtml:form element itself for externally supplying the `form/@action` via templating.
content/templates.xql Outdated Show resolved Hide resolved
before this commit it used the reques:get-parameter function
@bwbohl bwbohl requested a review from joewiz July 16, 2020 19:39
@joewiz
Copy link
Member

joewiz commented Jul 16, 2020

@bwbohl Could you explain the relationship between the origin parameter and the form/@action attribute? Is this a standard relationship, or something specific to your application?

@bwbohl
Copy link
Contributor Author

bwbohl commented Jul 20, 2020

@bwbohl Could you explain the relationship between the origin parameter and the form/@action attribute? Is this a standard relationship, or something specific to your application?

good point!
The main reason for introducing the switch case for the form element was me using https://github.com/eXist-db/existdb-login. The login.html example there obviously has the idea of providing a redirect origin for the form in order to return the user to the page originally requested on successful login, cf. https://github.com/eXist-db/existdb-login/blob/ebc61d08010f8e7c739345c951c43c1b2fc2ccac/login.html#L24

But you are right the parameter obviously should not have an application-specific name; function-specific might be preferable to make it more general. So probably renaming it to action or form-action instead if origin here might be preferable. What name should we pick?

@bwbohl
Copy link
Contributor Author

bwbohl commented Jul 21, 2020

Ok, just renamed the requested parameter to form-action hope that suits you ;-)

@bwbohl
Copy link
Contributor Author

bwbohl commented Sep 11, 2020

any chance this get's integrated?

Copy link
Member

@wolfgangmm wolfgangmm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks all good to me, thanks.

@joewiz
Copy link
Member

joewiz commented Sep 11, 2020

@bwbohl Sorry for the delay. Thank you for checking in on the status! It looks good to me too.

@joewiz joewiz merged commit 63d81c5 into eXist-db:master Sep 11, 2020
@dizzzz
Copy link
Member

dizzzz commented Sep 12, 2020

Is there any documentation on how to use this?

@bwbohl
Copy link
Contributor Author

bwbohl commented Sep 25, 2020

Is there any documentation on how to use this?

Not at the moment, as is true for almost all functions in the templates module, probably this should be tackled in general

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants