Skip to content

Commit

Permalink
Added ability to show help (i) icons to explain admin functionality t…
Browse files Browse the repository at this point in the history
…o users
  • Loading branch information
nickdekruijk committed Jul 26, 2022
1 parent 26c21fb commit 037f637
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/Controllers/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -542,4 +542,13 @@ public function rows($columnId, $column)
$response .= '</table>';
return $response;
}

public function help(array $section): string
{
$help = $this->locale('help', $section, null);
if ($help) {
$help = '<span class="help"><i class="fa fa-info-circle"></i><span>' . $help . '</span></span>';
}
return $help;
}
}
8 changes: 8 additions & 0 deletions src/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,14 @@ TABLE.report TR:hover > TD {background-color:#0cb;border-color:#0cb}
.browse #listview {top:0;left:0}
.browse #editview {top:0}

.help I {font-size:16px;margin-left:5px;vertical-align:-1px;opacity:0.6}
.help:hover I {color:#0cb;opacity:1}
.help SPAN {display:none;position:absolute;z-index:9999;color:#000;background-color:#0cb;white-space:normal;font-size:15px;font-weight:400;line-height:1.3;padding:10px;border-radius:3px;margin:-7px 10px;box-shadow:rgba(0,0,0,0.5) 0 3px 6px;max-width:600px}
.help SPAN::before {content:'';position:absolute;border:7px solid transparent;border-right-color:#0cb;left:-14px}
.help:hover SPAN {display:inline-block}
HEADER .help SPAN {position:fixed;margin-top:10px}
HEADER .help I {font-size:inherit}

.ui-datepicker {font-size:0.9em !important;font-family: inherit !important}
.ui-widget button {font-family: inherit !important}

Expand Down
1 change: 1 addition & 0 deletions src/views/base.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
@if (request()->root && $lp->module('sub_navigation'))
({{$lp->model()->find(request()->root)[$lp->module('sub_navigation')]}})
@endif
{!! $lp->help($lp->module()) !!}
</h2>
</header>
@yield('view')
Expand Down
2 changes: 1 addition & 1 deletion src/views/model.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<input type="hidden" name="{{ $id }}" value="0">
<input type="checkbox" name="{{ $id }}" id="input_{{ $id }}" value="1">
@endif
{{ $lp->locale('title', $column, $id) }}</label>
{{ $lp->locale('title', $column, $id) }}{!! $lp->help($column) !!}</label>
@if ($column['type'] == 'string' || $column['type'] == 'password' || $column['type'] == 'date' || $column['type'] == 'datetime' || $column['type'] == 'number')
<input class="{{ $column['type'] == 'date' ? 'datepicker' : '' }}{{ $column['type'] == 'datetime' ? 'datetimepicker' : '' }}" type="{{ $column['type']=='string' || $column['type'] == 'date' || $column['type'] == 'datetime'?'text':$column['type'] }}" name="{{ $id }}" id="input_{{ $id }}" placeholder="{{ $lp->locale('placeholder', $column, '') }}">
@if (isset($column['validate']) && in_array('confirmed',explode('|', $column['validate'])))
Expand Down

0 comments on commit 037f637

Please sign in to comment.