JavaScript Jade conditional output different/conditional form attributes with same form body

I have a small issue with conditional rendering of some part of html in jade, doing my best not to duplicate code. I have the following jade bit

if(loggedIn && !search)
   form(action="/list/mine")
else if(search)
   form(action="/list/search", method="POST")
else
   form(action="/list/all")

   input(type="hidden" value=parseInt(next) name="skip" )
   input(type="submit" value="Next" class="pure-button pure-button-primary")

I want the above if to produce

form(action="/list/mine")
   input(type="hidden" value=parseInt(next) name="skip" )
   input(type="submit" value="Next" class="pure-button pure-button-primary")

Similarly else if, and else clauses (with different form values).

At the moment body of the form is output-ed only when else is valid, it makes sense why it does. For some reason, my mind give up on me.

How can I achieve conditional printing of form body with different form attributes without having to duplicate the form body? Pleas show a valid jade sample code if possible.

Answer:1

So here is what I have for a toggle switch I'm using off of https://metroui.org.ua/inputs.html What Im trying to do is change the label thats before the switch/checkbox to say checked or not checked. ...

So here is what I have for a toggle switch I'm using off of https://metroui.org.ua/inputs.html What Im trying to do is change the label thats before the switch/checkbox to say checked or not checked. ...

  1. html toggle switch status

Can anyone tell me about dynamic pages in wagtail? My use case is as following: I have a number of objects (images) on the main page When I click on image I'd like to be redirected to a page about ...

Can anyone tell me about dynamic pages in wagtail? My use case is as following: I have a number of objects (images) on the main page When I click on image I'd like to be redirected to a page about ...

  1. wagtail dynamic pages

At the begining of launching my app I am getting variables through django templates variables like so: var my_variable = '{{ variable }}'; But sometimes it takes more than one line and provide a ...

At the begining of launching my app I am getting variables through django templates variables like so: var my_variable = '{{ variable }}'; But sometimes it takes more than one line and provide a ...

  1. django template tags
  2. django template language
  3. django templateview
  4. django template does not exist
  5. django template comment
  6. django template if statement
  7. django template set variable
  8. django template example
  9. django template engine
  10. django template context
  11. django template extends
  12. django template dictionary
  13. django template if not
  14. django template for loop index
  15. django templates directory
  16. django template tutorial
  17. django template format date
  18. django template if and
  19. django templates free
  20. django template split

I'm looking to have a javascript bouncing ball in a responsive canvas. My goal is for the animation canvas to be the same size of the viewport in which it loads instead of having a fixed sized ...

I'm looking to have a javascript bouncing ball in a responsive canvas. My goal is for the animation canvas to be the same size of the viewport in which it loads instead of having a fixed sized ...

  1. javascript bouncing ball animation
  2. javascript bouncing ball code
  3. javascript bouncing ball with gravity
  4. javascript bouncing ball physics
  5. javascript bouncing ball
  6. javascript bouncing ball game
  7. js bouncing ball
  8. javascript bouncing ball example
  9. javascript canvas bouncing ball
  10. p5.js bouncing ball
  11. three.js bouncing ball
  12. react js bouncing ball