responsive account lists

This commit is contained in:
Roland Gruber 2018-10-23 20:25:45 +02:00
parent b0edc4c6f9
commit a6f11073ca
3 changed files with 19 additions and 14 deletions

View File

@ -815,51 +815,52 @@ class lamList {
* @param int $tabindex HTML tabindex counter * @param int $tabindex HTML tabindex counter
*/ */
protected function listPrintButtons($createOnly) { protected function listPrintButtons($createOnly) {
$table = new htmlTable('100%'); $row = new htmlResponsiveRow();
$row->setCSSClasses(array('maxrow'));
$left = new htmlGroup(); $left = new htmlGroup();
// button part // button part
$left->alignment = htmlElement::ALIGN_LEFT;
if (checkIfWriteAccessIsAllowed($this->type->getId())) { if (checkIfWriteAccessIsAllowed($this->type->getId())) {
// add button // add button
if (checkIfNewEntriesAreAllowed($this->type->getId())) { if (checkIfNewEntriesAreAllowed($this->type->getId())) {
$newButton = new htmlButton('new', $this->labels['newEntry']); $newButton = new htmlButton('new', $this->labels['newEntry']);
$newButton->setIconClass('createButton'); $newButton->setIconClass('createButton');
$newButton->setCSSClasses(array('fullwidth-mobile-only'));
$left->addElement($newButton); $left->addElement($newButton);
} }
// delete button // delete button
if (!$createOnly && checkIfDeleteEntriesIsAllowed($this->type->getId())) { if (!$createOnly && checkIfDeleteEntriesIsAllowed($this->type->getId())) {
$left->addElement(new htmlSpacer('1px', null));
$delButton = new htmlButton('del', $this->labels['deleteEntry']); $delButton = new htmlButton('del', $this->labels['deleteEntry']);
$delButton->setIconClass('deleteButton'); $delButton->setIconClass('deleteButton');
$delButton->setCSSClasses(array('fullwidth-mobile-only'));
$left->addElement($delButton); $left->addElement($delButton);
} }
$toolSettings = $_SESSION['config']->getToolSettings(); $toolSettings = $_SESSION['config']->getToolSettings();
if ($this->type->getBaseType()->supportsFileUpload() && checkIfNewEntriesAreAllowed($this->type->getId()) if ($this->type->getBaseType()->supportsFileUpload() && checkIfNewEntriesAreAllowed($this->type->getId())
&& !(isset($toolSettings['tool_hide_toolFileUpload']) && ($toolSettings['tool_hide_toolFileUpload'] == 'true'))) { && !(isset($toolSettings['tool_hide_toolFileUpload']) && ($toolSettings['tool_hide_toolFileUpload'] == 'true'))) {
$left->addElement(new htmlSpacer('20px', null));
$uploadButton = new htmlButton('fileUpload', _('File upload')); $uploadButton = new htmlButton('fileUpload', _('File upload'));
$uploadButton->setIconClass('upButton'); $uploadButton->setIconClass('upButton');
$uploadButton->setCSSClasses(array('fullwidth-mobile-only'));
$left->addElement($uploadButton); $left->addElement($uploadButton);
} }
} }
// OU selection and settings // OU selection and settings
$right = new htmlGroup(); $right = new htmlResponsiveRow();
$right->alignment = htmlElement::ALIGN_RIGHT; $right->add($this->listShowOUSelection(), 12, 12, 10);
$right->addElement($this->listShowOUSelection()); $rightButtonGroup = new htmlGroup();
$refreshButton = new htmlButton('refresh', 'refresh.png', true); $refreshButton = new htmlButton('refresh', 'refresh.png', true);
$refreshButton->setTitle(_("Refresh")); $refreshButton->setTitle(_("Refresh"));
$right->addElement($refreshButton); $rightButtonGroup->addElement($refreshButton);
$right->addElement(new htmlSpacer('1px', null));
$settingsLink = new htmlLink('', '#', '../../graphics/tools.png'); $settingsLink = new htmlLink('', '#', '../../graphics/tools.png');
$settingsLink->setOnClick('listShowSettingsDialog(\'' . _('Change list settings') . '\', \'' . _('Ok') . '\', \'' . _('Cancel') . '\');'); $settingsLink->setOnClick('listShowSettingsDialog(\'' . _('Change list settings') . '\', \'' . _('Ok') . '\', \'' . _('Cancel') . '\');');
$settingsLink->setTitle(_('Change settings')); $settingsLink->setTitle(_('Change settings'));
$right->addElement($settingsLink); $rightButtonGroup->addElement($settingsLink);
$right->add($rightButtonGroup, 12, 12, 2);
$this->addExtraInputElementsToTopArea($left, $right); $this->addExtraInputElementsToTopArea($left, $right);
$table->addElement($left); $row->add($left, 12, 6, 6, 'text-left');
$table->addElement($right); $row->add($right, 12, 6, 6, 'text-right');
parseHtml(null, $table, array(), false, $this->tabindex, $this->type->getScope()); parseHtml(null, $row, array(), false, $this->tabindex, $this->type->getScope());
} }
/** /**

View File

@ -272,9 +272,9 @@ class lamDHCPList extends lamList {
*/ */
protected function addExtraInputElementsToTopArea(&$left, &$right) { protected function addExtraInputElementsToTopArea(&$left, &$right) {
if (checkIfWriteAccessIsAllowed($this->type->getId())) { if (checkIfWriteAccessIsAllowed($this->type->getId())) {
$left->addElement(new htmlSpacer('20px', null));
$dhcpButton = new htmlButton('dhcpDefaults', $this->labels['dhcpDefaults']); $dhcpButton = new htmlButton('dhcpDefaults', $this->labels['dhcpDefaults']);
$dhcpButton->setIconClass('settingsButton'); $dhcpButton->setIconClass('settingsButton');
$dhcpButton->setCSSClasses(array('fullwidth-mobile-only'));
$left->addElement($dhcpButton); $left->addElement($dhcpButton);
} }
} }

View File

@ -145,6 +145,10 @@ table.responsive-table td {
font-weight: bold; font-weight: bold;
} }
.fullwidth-mobile-only {
width: 100%;
}
} }
/* tablet */ /* tablet */