#3: Removed the dynamic-ness of the album permissions so I have more control over the layout
This commit is contained in:
parent
ac2a24187d
commit
33275a8733
@ -14,6 +14,19 @@ class ThemeHelper
|
||||
return $this->getThemeName();
|
||||
}
|
||||
|
||||
public function getPermission($allPermissions, $section, $description)
|
||||
{
|
||||
foreach ($allPermissions as $permission)
|
||||
{
|
||||
if (strtolower($permission->section) == strtolower($section) && strtolower($permission->description) == strtolower($description))
|
||||
{
|
||||
return $permission;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function hasStylesheet()
|
||||
{
|
||||
$cssFilename = sprintf('%s/%s/theme.css', $this->getThemePublicPath(), $this->getThemeName());
|
||||
|
@ -8,15 +8,24 @@
|
||||
<div class="card-block">
|
||||
<p style="margin-bottom: 20px;"><a class="select-all" href="#">Select All</a> · <a class="select-none" href="">Select None</a></p>
|
||||
|
||||
@foreach ($all_permissions as $permission)
|
||||
@if ($object_id == 'anonymous' && $permission->section == 'album' && $permission->description != 'list' && $permission->description != 'view')
|
||||
@continue
|
||||
@endif
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<h5>Album Permissions</h5>
|
||||
|
||||
@php ($permission = Theme::getPermission($all_permissions, 'album', 'list'))
|
||||
<div class="checkbox">
|
||||
<label for="permission|{{ $key_id }}|{{ $permission->id }}">
|
||||
<input id="permission|{{ $key_id }}|{{ $permission->id }}" name="permissions[{{ $object_id }}][]" value="{{ $permission->id }}" type="checkbox"{{ call_user_func($callback, $callback_object, $permission) ? ' checked="checked"' : '' }} /> {{ trans(sprintf('permissions.%s.%s', $permission->section, $permission->description)) }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@foreach ($all_permissions as $permission)
|
||||
@if ($object_id == 'anonymous' && $permission->section == 'album' && $permission->description != 'list' && $permission->description != 'view')
|
||||
@continue
|
||||
@endif
|
||||
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user