NHSDigital / ndr_ui

National Disease Registers standard Rails UI
MIT License
0 stars 11 forks source link

panel_helper options need be able to include panel-title and panel-body #19

Open suezhou opened 6 years ago

suezhou commented 6 years ago

With current panel-helper

<%= bootstrap_panel_tag 'Apples', class: 'panel-warning', id: 'fruit' do %>
  Check it out!!
<% end %>

will generate the following code

<div id="fruit" class="panel panel-warning">
  <div class="panel-heading">Apples</div>
  Check it out!!
</div>

And most of the time, we need to manually apply panel-title class for the bold heading and panel-body class or bootstrap_panel_body_tag method for the indentation. I think we need to accept options like panel-title: true and panel-body: true so it will generate the following code in one go:

<div id="fruit" class="panel panel-warning">
  <div class="panel-heading">
    <h3 class="panel-title">Apples</div>
  </div>
  <div class="panel-body">
    Check it out!!
  </div>
</div>
timgentry commented 5 years ago

With the body of a panel being a panel-body or a table I have no issue with explicitly defining it at the moment. I would be tempted to have panel-body: true as the default, which is a breaking change and something to be avoided at the moment, I think.