Refactor features pages
- Create frio template for admin features page - Fix header hierarchy
This commit is contained in:
parent
fd89572606
commit
6bb210ff7a
6 changed files with 68 additions and 44 deletions
|
@ -64,15 +64,14 @@ class Features extends BaseAdmin
|
||||||
{
|
{
|
||||||
parent::content($parameters);
|
parent::content($parameters);
|
||||||
|
|
||||||
$arr = [];
|
$features = [];
|
||||||
$features = Feature::get(false);
|
|
||||||
|
|
||||||
foreach ($features as $fname => $fdata) {
|
foreach (Feature::get(false) as $fname => $fdata) {
|
||||||
$arr[$fname] = [];
|
$features[$fname] = [];
|
||||||
$arr[$fname][0] = $fdata[0];
|
$features[$fname][0] = $fdata[0];
|
||||||
foreach (array_slice($fdata, 1) as $f) {
|
foreach (array_slice($fdata, 1) as $f) {
|
||||||
$set = DI::config()->get('feature', $f[0], $f[3]);
|
$set = DI::config()->get('feature', $f[0], $f[3]);
|
||||||
$arr[$fname][1][] = [
|
$features[$fname][1][] = [
|
||||||
['feature_' . $f[0], $f[1], $set, $f[2]],
|
['feature_' . $f[0], $f[1], $set, $f[2]],
|
||||||
['featurelock_' . $f[0], DI::l10n()->t('Lock feature %s', $f[1]), $f[4], '']
|
['featurelock_' . $f[0], DI::l10n()->t('Lock feature %s', $f[1]), $f[4], '']
|
||||||
];
|
];
|
||||||
|
@ -82,9 +81,10 @@ class Features extends BaseAdmin
|
||||||
$tpl = Renderer::getMarkupTemplate('admin/features.tpl');
|
$tpl = Renderer::getMarkupTemplate('admin/features.tpl');
|
||||||
$o = Renderer::replaceMacros($tpl, [
|
$o = Renderer::replaceMacros($tpl, [
|
||||||
'$form_security_token' => parent::getFormSecurityToken("admin_manage_features"),
|
'$form_security_token' => parent::getFormSecurityToken("admin_manage_features"),
|
||||||
'$title' => DI::l10n()->t('Manage Additional Features'),
|
'$baseurl' => DI::baseUrl()->get(true),
|
||||||
'$features' => $arr,
|
'$title' => DI::l10n()->t('Manage Additional Features'),
|
||||||
'$submit' => DI::l10n()->t('Save Settings'),
|
'$features' => $features,
|
||||||
|
'$submit' => DI::l10n()->t('Save Settings'),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
|
|
||||||
<div id="adminpage">
|
<div id="adminpage">
|
||||||
<h1>{{$title}}</h1>
|
<h1>{{$title}}</h1>
|
||||||
|
|
||||||
<form action="admin/features" method="post" autocomplete="off">
|
<form action="{{$baseurl}}/admin/features" method="post" autocomplete="off">
|
||||||
<input type='hidden' name='form_security_token' value='{{$form_security_token}}'>
|
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
|
||||||
|
|
||||||
{{foreach $features as $g => $f}}
|
{{foreach $features as $g => $f}}
|
||||||
<h3 class="settings-heading"><a href="javascript:;">{{$f.0}}</a></h3>
|
<h2 class="settings-heading"><a href="javascript:;">{{$f.0}}</a></h2>
|
||||||
|
|
||||||
<div class="settings-content-block">
|
<div class="settings-content-block">
|
||||||
{{foreach $f.1 as $fcat}}
|
{{foreach $f.1 as $fcat}}
|
||||||
|
|
|
@ -1,22 +1,18 @@
|
||||||
|
|
||||||
<h1>{{$title}}</h1>
|
<h1>{{$title}}</h1>
|
||||||
|
|
||||||
|
|
||||||
<form action="settings/features" method="post" autocomplete="off">
|
<form action="settings/features" method="post" autocomplete="off">
|
||||||
<input type='hidden' name='form_security_token' value='{{$form_security_token}}'>
|
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
|
||||||
|
|
||||||
{{foreach $features as $f}}
|
{{foreach $features as $f}}
|
||||||
<h3 class="settings-heading"><a href="javascript:;">{{$f.0}}</a></h3>
|
<h2 class="settings-heading"><a href="javascript:;">{{$f.0}}</a></h2>
|
||||||
<div class="settings-content-block">
|
<div class="settings-content-block">
|
||||||
|
|
||||||
{{foreach $f.1 as $fcat}}
|
|
||||||
{{include file="field_checkbox.tpl" field=$fcat}}
|
|
||||||
{{/foreach}}
|
|
||||||
<div class="settings-submit-wrapper" >
|
|
||||||
<input type="submit" name="submit" class="settings-features-submit" value="{{$submit}}" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{/foreach}}
|
|
||||||
|
|
||||||
|
{{foreach $f.1 as $fcat}}
|
||||||
|
{{include file="field_checkbox.tpl" field=$fcat}}
|
||||||
|
{{/foreach}}
|
||||||
|
<div class="settings-submit-wrapper">
|
||||||
|
<input type="submit" name="submit" class="settings-features-submit" value="{{$submit}}"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{/foreach}}
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
|
@ -2875,7 +2875,7 @@ details.profile-jot-net[open] summary:before {
|
||||||
|
|
||||||
/* Emulates Bootstrap display */
|
/* Emulates Bootstrap display */
|
||||||
.settings-block {
|
.settings-block {
|
||||||
margin: 0 -15px 5px;
|
margin: 0 0 5px;
|
||||||
color: #333;
|
color: #333;
|
||||||
background-color: rgba(255,255,255,0.95);
|
background-color: rgba(255,255,255,0.95);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
|
34
view/theme/frio/templates/admin/features.tpl
Normal file
34
view/theme/frio/templates/admin/features.tpl
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
<div class="generic-page-wrapper">
|
||||||
|
<h1>{{$title}}</h1>
|
||||||
|
<form action="{{$baseurl}}/admin/features" method="post" autocomplete="off">
|
||||||
|
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
|
||||||
|
{{* We organize the settings in collapsable panel-groups *}}
|
||||||
|
<div class="panel-group panel-group-settings" id="settings" role="tablist" aria-multiselectable="true">
|
||||||
|
{{foreach $features as $g => $f}}
|
||||||
|
<div class="panel">
|
||||||
|
<div class="section-subtitle-wrapper panel-heading" role="tab" id="{{$g}}-settings-title">
|
||||||
|
<h2>
|
||||||
|
<a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#settings" href="#{{$g}}-settings-content" aria-expanded="true" aria-controls="{{$g}}-settings-content">
|
||||||
|
{{$f.0}}
|
||||||
|
</a>
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
<div id="{{$g}}-settings-content" class="panel-collapse collapse" role="tabpanel" aria-labelledby="{{$g}}-settings-title">
|
||||||
|
<div class="panel-body">
|
||||||
|
{{foreach $f.1 as $fcat}}
|
||||||
|
<div class="settings-block">
|
||||||
|
{{include file="field_checkbox.tpl" field=$fcat.0}}
|
||||||
|
{{include file="field_checkbox.tpl" field=$fcat.1}}
|
||||||
|
</div>
|
||||||
|
{{/foreach}}
|
||||||
|
</div>
|
||||||
|
<div class="panel-footer">
|
||||||
|
<button type="submit" name="submit" class="btn btn-primary" value="{{$submit}}">{{$submit}}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{/foreach}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
|
@ -1,31 +1,26 @@
|
||||||
<div class="generic-page-wrapper">
|
<div class="generic-page-wrapper">
|
||||||
{{* include the title template for the settings title *}}
|
<h1>{{$title}}</h1>
|
||||||
{{include file="section_title.tpl" title=$title }}
|
|
||||||
|
|
||||||
|
|
||||||
<form action="settings/features" method="post" autocomplete="off">
|
<form action="settings/features" method="post" autocomplete="off">
|
||||||
<input type='hidden' name='form_security_token' value='{{$form_security_token}}'>
|
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
|
||||||
{{* We organize the settings in collapsable panel-groups *}}
|
{{* We organize the settings in collapsable panel-groups *}}
|
||||||
<div class="panel-group panel-group-settings" id="settings" role="tablist" aria-multiselectable="true">
|
<div class="panel-group panel-group-settings" id="settings" role="tablist" aria-multiselectable="true">
|
||||||
{{foreach $features as $g => $f}}
|
{{foreach $features as $g => $f}}
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
<div class="section-subtitle-wrapper" role="tab" id="{{$g}}-settings-title">
|
<div class="section-subtitle-wrapper panel-heading" role="tab" id="{{$g}}-settings-title">
|
||||||
<h4>
|
<h2>
|
||||||
<a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#settings" href="#{{$g}}-settings-content" aria-expanded="true" aria-controls="{{$g}}-settings-content">
|
<a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#settings" href="#{{$g}}-settings-content" aria-expanded="true" aria-controls="{{$g}}-settings-content">
|
||||||
{{$f.0}}
|
{{$f.0}}
|
||||||
</a>
|
</a>
|
||||||
</h4>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
<div id="{{$g}}-settings-content" class="panel-collapse collapse" role="tabpanel" aria-labelledby="{{$g}}-settings-title">
|
<div id="{{$g}}-settings-content" class="panel-collapse collapse" role="tabpanel" aria-labelledby="{{$g}}-settings-title">
|
||||||
<div class="section-content-tools-wrapper">
|
<div class="panel-body">
|
||||||
{{foreach $f.1 as $fcat}}
|
{{foreach $f.1 as $fcat}}
|
||||||
{{include file="field_checkbox.tpl" field=$fcat}}
|
{{include file="field_checkbox.tpl" field=$fcat}}
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
|
</div>
|
||||||
<div class="form-group pull-right settings-submit-wrapper" >
|
<div class="panel-footer">
|
||||||
<button type="submit" name="submit" class="btn btn-primary" value="{{$submit}}">{{$submit}}</button>
|
<button type="submit" name="submit" class="btn btn-primary" value="{{$submit}}">{{$submit}}</button>
|
||||||
</div>
|
|
||||||
<div class="clear"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue