Skip to content

Commit 8b0af50

Browse files
committed
When viewing the schema, highlight Structural and non-Structural classes
1 parent f0eaff7 commit 8b0af50

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

resources/views/fragment/schema/objectclasses.blade.php

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22
<div class="col-12 col-xl-3">
33
<select id="objectclass" class="form-control">
44
<option value="-all-">-all-</option>
5-
@foreach ($objectclasses as $o)
6-
<option value="{{ $o->name_lc }}">{{ $o->name }}</option>
5+
@foreach($objectclasses->groupBy(fn($item)=>$item->isStructural()) as $oo)
6+
<optgroup label="{{ __($oo->first()->isStructural() ? 'Structural' : 'Auxillary') }} Object Class"></optgroup>
7+
@foreach($oo as $o)
8+
<option value="{{ $o->name_lc }}">{{ $o->name }}</option>
9+
@endforeach
710
@endforeach
811
</select>
912
</div>
1013

1114
<div class="col-12 col-xl-9">
12-
@foreach ($objectclasses as $o)
15+
@foreach($objectclasses as $o)
1316
<span id="oc-{{ $o->name_lc }}">
1417
<table class="schema table table-sm table-bordered table-striped">
1518
<thead>
@@ -32,10 +35,10 @@
3235
<td>@lang('Inherits from')</td>
3336
<td colspan="3">
3437
<strong>
35-
@if ($o->sup->count() === 0)
38+
@if($o->sup->count() === 0)
3639
@lang('(none)')
3740
@else
38-
@foreach ($o->sup as $sup)
41+
@foreach($o->sup as $sup)
3942
@if($loop->index)</strong> <strong>@endif
4043
<a class="objectclass" id="{{ strtolower($sup) }}" href="#{{ strtolower($sup) }}">{{ $sup }}</a>
4144
@endforeach
@@ -48,12 +51,12 @@
4851
<td>@lang('Parent to')</td>
4952
<td colspan="3">
5053
<strong>
51-
@if (strtolower($o->name) === 'top')
54+
@if(strtolower($o->name) === 'top')
5255
<a class="objectclass" id="-all-">(all)</a>
53-
@elseif (! $o->getChildObjectClasses()->count())
56+
@elseif(! $o->getChildObjectClasses()->count())
5457
@lang('(none)')
5558
@else
56-
@foreach ($o->getChildObjectClasses() as $childoc)
59+
@foreach($o->getChildObjectClasses() as $childoc)
5760
@if($loop->index)</strong> <strong>@endif
5861
<a class="objectclass" id="{{ strtolower($childoc) }}" href="#{{ strtolower($childoc) }}">{{ $childoc }}</a>
5962
@endforeach
@@ -75,7 +78,7 @@
7578
<tr>
7679
<td>
7780
<ul class="ps-3" style="list-style-type: square;">
78-
@foreach ($o->getMustAttrs(TRUE) as $oo)
81+
@foreach($o->getMustAttrs(TRUE) as $oo)
7982
<li>{{ $oo->name }} @if($oo->source !== $o->name)[<strong><a class="objectclass" id="{{ strtolower($oo->source) }}" href="#{{ strtolower($oo->source) }}">{{ $oo->source }}</a></strong>]@endif</li>
8083
@endforeach
8184
</ul>
@@ -97,7 +100,7 @@
97100
<tr>
98101
<td>
99102
<ul class="ps-3" style="list-style-type: square;">
100-
@foreach ($o->getMayAttrs(TRUE) as $oo)
103+
@foreach($o->getMayAttrs(TRUE) as $oo)
101104
<li>{{ $oo->name }} @if($oo->source !== $o->name)[<strong><a class="objectclass" id="{{ strtolower($oo->source) }}" href="#{{ strtolower($oo->source) }}">{{ $oo->source }}</a></strong>]@endif</li>
102105
@endforeach
103106
</ul>

0 commit comments

Comments
 (0)