chg: [UI] Use standardised view for sharging group

pull/6700/head
Jakub Onderka 2020-12-05 20:24:06 +01:00
parent 7092994258
commit a3364f66c3
2 changed files with 33 additions and 45 deletions

View File

@ -1,36 +1,26 @@
<div class="roles view">
<h2><?php echo __('Sharing Group');?></h2>
<h2><?= __('Sharing Group %s', $sg['SharingGroup']['name']);?></h2>
<div class="row-fluid"><div class="span8" style="margin:0">
<?php
$fields = array('id', 'uuid', 'name', 'releasability', 'description', 'active');
$tableData = [
['key' => __('ID'), 'value' => $sg['SharingGroup']['id']],
['key' => __('UUID'), 'value' => $sg['SharingGroup']['uuid'], 'value_class' => 'quickSelect'],
['key' => __('Name'), 'value' => $sg['SharingGroup']['name']],
['key' => __('Releasability'), 'value' => $sg['SharingGroup']['releasability']],
['key' => __('Description'), 'value' => $sg['SharingGroup']['description']],
['key' => __('Selectable'), 'boolean' => $sg['SharingGroup']['active']],
['key' => __('Created by'), 'html' => $this->OrgImg->getNameWithImg($sg)],
];
if ($sg['SharingGroup']['sync_user_id']) {
$tableData[] = [
'key' => __('Synced by'),
'html' => $this->OrgImg->getNameWithImg($sg),
];
}
echo $this->element('genericElements/viewMetaTable', ['table_data' => $tableData]);
?>
<dl>
<?php
foreach ($fields as $f):
?>
<dt><?php
if ($f != 'active') echo ucfirst($f);
else echo __('Selectable');
?></dt>
<dd>
<?php
if ($f !== 'active') echo h($sg['SharingGroup'][$f]);
else echo '<span class="' . ($sg['SharingGroup'][$f] ? 'icon-ok' : 'icon-remove') . '"></span>';
?>&nbsp;
</dd>
<?php
endforeach;
?>
<dt><?php echo __('Created by');?></dt>
<dd><a href="<?php echo $baseurl; ?>/organisations/view/<?php echo $sg['Organisation']['id']; ?>"><?php echo h($sg['Organisation']['name']); ?></a></dd>
<?php
if ($sg['SharingGroup']['sync_user_id']):
?>
<dt><?php echo __('Synced by');?></dt>
<dd><a href="<?php echo $baseurl; ?>/organisations/view/<?php echo $sg['Organisation']['id']; ?>"><?php echo h($sg['Organisation']['name']); ?></a></dd>
<?php
endif;
?>
</dl><br />
</div></div>
<br />
<div class="row" style="width:100%;">
<?php
if (isset($sg['SharingGroupOrg'])):
@ -39,17 +29,17 @@
<b><?php echo __('Organisations');?></b>
<table class="table table-striped table-hover table-condensed">
<tr>
<th><?php echo __('Name');?></th>
<th><?php echo __('Local');?></th>
<th><?php echo __('Extend');?></th>
<th><?= __('Name') ?></th>
<th><?= __('Is local') ?></th>
<th><?= __('Can extend') ?></th>
</tr>
<?php
foreach ($sg['SharingGroupOrg'] as $sgo):
?>
<tr>
<td><a href="<?php echo $baseurl; ?>/organisations/view/<?php echo h($sgo['Organisation']['id']); ?>"><?php echo h($sgo['Organisation']['name']); ?></a></td>
<td><span class="<?php echo ($sgo['Organisation']['local'] ? 'icon-ok' : 'icon-remove'); ?>"></span></td>
<td><span class="<?php echo ($sgo['extend'] ? 'icon-ok' : 'icon-remove'); ?>"></span></td>
<td><span class="<?= $sgo['Organisation']['local'] ? 'fas fa-check' : 'fas fa-times' ?>"></span></td>
<td><span class="<?= $sgo['extend'] ? 'fas fa-check' : 'fas fa-times' ?>"></span></td>
</tr>
<?php
endforeach;
@ -64,16 +54,16 @@
<b>Instances</b>
<table class="table table-striped table-hover table-condensed">
<tr>
<th><?php echo __('Name');?></th>
<th><?php echo __('Url');?></th>
<th><?php echo __('All orgs');?></th>
<th><?= __('Name') ?></th>
<th><?= __('URL') ?></th>
<th><?= __('All orgs') ?></th>
</tr>
<?php
foreach ($sg['SharingGroupServer'] as $sgs): ?>
<tr>
<td><?php echo h($sgs['Server']['name']); ?></td>
<td><?php echo h($sgs['Server']['url']); ?></td>
<td><span class="<?php echo ($sgs['all_orgs'] ? 'icon-ok' : 'icon-remove'); ?>"></span></td>
<td><?= h($sgs['Server']['name']) ?></td>
<td><?= h($sgs['Server']['url']) ?></td>
<td><span class="<?= $sgs['all_orgs'] ? 'fas fa-check' : 'fas fa-times' ?>"></span></td>
</tr>
<?php
endforeach;
@ -85,6 +75,4 @@
?>
</div>
</div>
<?php
echo $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'globalActions', 'menuItem' => 'viewSG'));
?>
<?= $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'globalActions', 'menuItem' => 'viewSG'));

View File

@ -2680,6 +2680,6 @@ a.orgImg {
background-repeat: no-repeat;
background-size: 20px;
padding-left: 25px;
padding-top: 2px;
padding-top: 3px;
padding-bottom: 2px;
}