re-hide advanced settings and show with collapsible

This commit is contained in:
Stephen Birarda 2018-01-31 15:26:54 -08:00
parent b650753e43
commit 3969288996
2 changed files with 19 additions and 1 deletions

View file

@ -24,6 +24,10 @@
<% return !value.deprecated %> <% return !value.deprecated %>
<% })[0] %> <% })[0] %>
<% var split_settings = _.partition(group.settings, function(value, index) { %>
<% return !value.advanced %>
<% }) %>
<% isGrouped = !!group.name %> <% isGrouped = !!group.name %>
<% panelID = isGrouped ? group.name : group.html_id %> <% panelID = isGrouped ? group.name : group.html_id %>
@ -35,10 +39,20 @@
<span class="badge"></span> <span class="badge"></span>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<% _.each(settings, function(setting) { %> <% _.each(split_settings[0], function(setting) { %>
<% keypath = isGrouped ? group.name + "." + setting.name : setting.name %> <% keypath = isGrouped ? group.name + "." + setting.name : setting.name %>
<%= getFormGroup(keypath, setting, values, false) %> <%= getFormGroup(keypath, setting, values, false) %>
<% }); %> <% }); %>
<% if (split_settings[1].length > 0) { %>
<button type="button" class="btn btn-default" data-toggle="collapse" data-target="#<%- panelID %>-advanced">Advanced Settings <span class="caret"></span></button>
<div id="<%- panelID %>-advanced" class="collapse advanced-settings-section">
<% _.each(split_settings[1], function(setting) { %>
<% keypath = isGrouped ? group.name + "." + setting.name : setting.name %>
<%= getFormGroup(keypath, setting, values, true) %>
<% }); %>
</div>
<% } %>
</div> </div>
</div> </div>
<% } %> <% } %>

View file

@ -426,3 +426,7 @@ ul.nav li.dropdown ul.dropdown-menu .divider {
position: relative; position: relative;
top: -1px; top: -1px;
} }
.advanced-settings-section {
margin-top: 20px;
}