Skip to content

add new form input type "header"#866

Closed
fraenki wants to merge 1 commit intoopnsense:masterfrom
fraenki:forms_header
Closed

add new form input type "header"#866
fraenki wants to merge 1 commit intoopnsense:masterfrom
fraenki:forms_header

Conversation

@fraenki
Copy link
Member

@fraenki fraenki commented Mar 29, 2016

If I'm not mistaken there is currently no (easy) way to add a proper header for forms. This makes long forms rather confusing:

forms_info

This patch adds the new input type "header" to allow headers in forms:

    <field>
        <label>Tuning Options</label>
        <type>header</type>
    </field>

forms_header

(I'd be more happy to have a margin of just 10px instead of 15px, but I don't wanted to add a new css class just for this.)

@AdSchellevis
Copy link
Member

@fraenki you can use tabs to split content, I'm not fully sure about the headers in this case. If you don't use the tabs and want to divide the content within the same screen, a separate partial which renders the same structure in to different blocks might be better. (better spacing on the page)

@fraenki
Copy link
Member Author

fraenki commented Mar 29, 2016

@AdSchellevis Thanks for your response. :) I've decided to add this new type, because it's also the font size (and possibly font style) that matters in this case. To me this seemed like an easy way to achieve the goal without major drawbacks. Am I missing something?

you can use tabs to split content

I'm already using tabs for general application settings. But this form is used to create/edit new frontends for a Load Balancer – there can be many frontends. I don't see how I could use tabs in this case...

If you don't use the tabs and want to divide the content within the same screen, a separate partial which renders the same structure in to different blocks might be better.

Is there an example in the code somewhere that demonstrates this?
Still, this sounds like a lot work to simply make the form look more pretty. :(

@AdSchellevis
Copy link
Member

@fraenki I just don't like the broken striping very much, the idea is good. Do you mind if I move your idea into "base_form" so we can fix the tables a bit better?

@fichtner
Copy link
Member

I kind of agree with Ad here, two things are important:

  1. every section needs a caption/description, not just the added ones
  2. the sections are the stacked tabs, but...

As far as 2. goes I always felt that the stacked tabs aren't very intuitive and they could very well be rendered together on one page, which is what Frank is looking for. Maybe we could use a form render switch for this in the xml?

@fichtner
Copy link
Member

Note that "tabs" and "stacked tabs" are different things, the proxy pages make use of stacked tabs...

@AdSchellevis
Copy link
Member

@fichtner I guess the additional type from @fraenki should be fine here (only fix the presentation), the tabs can be made more intuitive at a later point in time.

@fraenki
Copy link
Member Author

fraenki commented Mar 29, 2016

@AdSchellevis No objections from my side :)

@AdSchellevis AdSchellevis self-assigned this Mar 29, 2016
AdSchellevis added a commit that referenced this pull request Mar 30, 2016
Example (from @fraenki):
<field>
        <label>Tuning Options</label>
        <type>header</type>
</field>
@AdSchellevis
Copy link
Member

@fraenki is this one 95522e0 good enough for you? (drop in replacement for this pull)

@fraenki
Copy link
Member Author

fraenki commented Mar 30, 2016

Looks good. Thanks, @AdSchellevis!

@fraenki fraenki closed this Mar 30, 2016
@AdSchellevis
Copy link
Member

@fraenki your welcome!

fichtner pushed a commit that referenced this pull request Apr 28, 2016
Example (from @fraenki):
<field>
        <label>Tuning Options</label>
        <type>header</type>
</field>

(cherry picked from commit 95522e0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants