Skip to content

Commit

Permalink
Offline-Artikel/Kategorien in der Opacity reduzieren (#4645)
Browse files Browse the repository at this point in the history
Co-authored-by: Gregor Harlan <330436+gharlan@users.noreply.github.com>
  • Loading branch information
danspringer and gharlan committed Jun 19, 2021
1 parent f2e1a8f commit 27fe436
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 27 deletions.
20 changes: 7 additions & 13 deletions .tools/psalm/baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3031,29 +3031,23 @@
<code>$artStatusType[0]</code>
<code>$artStatusType[1]</code>
<code>$artStatusTypes[$sql-&gt;getValue('status')][0]</code>
<code>$artStatusTypes[$sql-&gt;getValue('status')][0]</code>
<code>$artStatusTypes[$sql-&gt;getValue('status')][1]</code>
<code>$artStatusTypes[$sql-&gt;getValue('status')][1]</code>
<code>$artStatusTypes[$sql-&gt;getValue('status')][2]</code>
<code>$artStatusTypes[$sql-&gt;getValue('status')][2]</code>
<code>$artStatusTypes[$status][0]</code>
<code>$artStatusTypes[$status][1]</code>
<code>$artStatusTypes[$status][2]</code>
<code>$catStatusType[0]</code>
<code>$catStatusType[1]</code>
<code>$catStatusTypes[$KAT-&gt;getValue('status')][0]</code>
<code>$catStatusTypes[$KAT-&gt;getValue('status')][1]</code>
<code>$catStatusTypes[$KAT-&gt;getValue('status')][2]</code>
<code>$catStatusTypes[$status][0]</code>
<code>$catStatusTypes[$status][1]</code>
<code>$catStatusTypes[$status][2]</code>
<code>$tEMPLATENAME[$sql-&gt;getValue('template_id')]</code>
<code>$tEMPLATENAME[$sql-&gt;getValue('template_id')]</code>
</MixedArrayAccess>
<MixedArrayOffset occurrences="11">
<code>$artStatusTypes[$sql-&gt;getValue('status')]</code>
<code>$artStatusTypes[$sql-&gt;getValue('status')]</code>
<code>$artStatusTypes[$sql-&gt;getValue('status')]</code>
<MixedArrayOffset occurrences="5">
<code>$artStatusTypes[$sql-&gt;getValue('status')]</code>
<code>$artStatusTypes[$sql-&gt;getValue('status')]</code>
<code>$artStatusTypes[$sql-&gt;getValue('status')]</code>
<code>$catStatusTypes[$KAT-&gt;getValue('status')]</code>
<code>$catStatusTypes[$KAT-&gt;getValue('status')]</code>
<code>$catStatusTypes[$KAT-&gt;getValue('status')]</code>
<code>$tEMPLATENAME[$sql-&gt;getValue('template_id')]</code>
<code>$tEMPLATENAME[$sql-&gt;getValue('template_id')]</code>
</MixedArrayOffset>
Expand Down

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion redaxo/src/addons/be_style/plugins/redaxo/scss/_typo.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ tr.mark {
.rex-text-offline {
color: $color-offline;
}

.rex-status[data-status="0"] td:not(.rex-table-action-no-dropdown, .rex-table-action-dropdown) {
opacity: 0.5;

&:hover {
opacity: 1;
}
}
.rex-page-header {
.page-header {
margin-top: 0;
Expand Down
30 changes: 18 additions & 12 deletions redaxo/src/addons/structure/pages/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
$KAT->setQuery('SELECT * FROM ' . rex::getTablePrefix() . 'article WHERE parent_id = ? AND startarticle=1 AND clang_id = ? ORDER BY catpriority LIMIT ' . $catPager->getCursor() . ',' . $catPager->getRowsPerPage(), [$structureContext->getCategoryId(), $structureContext->getClangId()]);
}

$trStatusClass = 'rex-status';
$echo = '';
// ---------- INLINE THE EDIT/ADD FORM
if ('add_cat' == $structureContext->getFunction() || 'edit_cat' == $structureContext->getFunction()) {
Expand Down Expand Up @@ -175,9 +176,11 @@
$katIconTitle = $katHasChildElements ? rex_i18n::msg('category_has_child_elements') : rex_i18n::msg('category_without_child_elements');
$katIconTd = '<td class="rex-table-icon"><a class="rex-link-expanded" href="' . $katLink . '" title="' . rex_escape($KAT->getValue('catname')) . '"><i class="rex-icon ' . $katIconClass . '" title="' . $katIconTitle . '"></i></a></td>';

$katStatus = $catStatusTypes[$KAT->getValue('status')][0];
$statusClass = $catStatusTypes[$KAT->getValue('status')][1];
$statusIcon = $catStatusTypes[$KAT->getValue('status')][2];
$status = (int) $KAT->getValue('status');
$katStatus = $catStatusTypes[$status][0];
$statusClass = $catStatusTypes[$status][1];
$statusIcon = $catStatusTypes[$status][2];
$dataCatStatus = 'data-status="'.$status.'"';

$tdLayoutClass = '';
if ($structureContext->hasCategoryPermission()) {
Expand Down Expand Up @@ -216,7 +219,7 @@
}

$echo .= '
<tr class="' . $class . '">
<tr class="' . $class . '" '.$dataCatStatus.'>
' . $katIconTd . '
<td class="rex-table-id" data-title="' . rex_i18n::msg('header_id') . '">' . $iCategoryId . '</td>
<td class="rex-table-category" data-title="' . rex_i18n::msg('header_category') . '"><input class="form-control" type="text" name="category-name" value="' . rex_escape($KAT->getValue('catname')) . '" class="rex-js-autofocus" autofocus /></td>
Expand All @@ -237,7 +240,7 @@
// --------------------- KATEGORIE WITH WRITE

$echo .= '
<tr>
<tr class="'.$trStatusClass.'" '.$dataCatStatus.'>
' . $katIconTd . '
<td class="rex-table-id" data-title="' . rex_i18n::msg('header_id') . '">' . $iCategoryId . '</td>
<td class="rex-table-category" data-title="' . rex_i18n::msg('header_category') . '"><a class="rex-link-expanded" href="' . $katLink . '">' . rex_escape($KAT->getValue('catname')) . '</a></td>
Expand All @@ -258,7 +261,7 @@
// --------------------- KATEGORIE WITH READ

$echo .= '
<tr>
<tr class="'.$trStatusClass.'" '.$dataCatStatus.'>
' . $katIconTd . '
<td class="rex-table-id" data-title="' . rex_i18n::msg('header_id') . '">' . $iCategoryId . '</td>
<td class="rex-table-category" data-title="' . rex_i18n::msg('header_category') . '"><a class="rex-link-expanded" href="' . $katLink . '">' . $KAT->getValue('catname') . '</a></td>
Expand Down Expand Up @@ -448,6 +451,7 @@
$class = ' rex-icon-article';
}
$dataArtid = 'data-article-id="'.$sql->getValue('id').'"';
$dataArtStatus = 'data-status="'.((int) $sql->getValue('status')).'"';

$classStartarticle = '';
if (1 == $sql->getValue('startarticle')) {
Expand All @@ -462,7 +466,7 @@
$templateSelect->setSelected($sql->getValue('template_id'));
$tmplTd = '<td class="rex-table-template" data-title="' . rex_i18n::msg('header_template') . '">' . $templateSelect->get() . '</td>';
}
$echo .= '<tr class="mark' . $classStartarticle . '">
$echo .= '<tr class="mark' . $classStartarticle . ' '.$trStatusClass.'">
<td class="rex-table-icon"><a class="rex-link-expanded" href="' . $structureContext->getContext()->getUrl(['page' => 'content/edit', 'article_id' => $sql->getValue('id')]) . '" title="' . rex_escape($sql->getValue('name')) . '"><i class="rex-icon' . $class . '"></i></a></td>
<td class="rex-table-id" data-title="' . rex_i18n::msg('header_id') . '">' . $sql->getValue('id') . '</td>
<td class="rex-table-article-name" data-title="' . rex_i18n::msg('header_article_name') . '"><input class="form-control" type="text" name="article-name" value="' . rex_escape($sql->getValue('name')) . '" autofocus /></td>
Expand All @@ -474,9 +478,11 @@
} elseif ($structureContext->hasCategoryPermission()) {
// --------------------- ARTIKEL NORMAL VIEW | EDIT AND ENTER

$articleStatus = $artStatusTypes[$sql->getValue('status')][0];
$articleClass = $artStatusTypes[$sql->getValue('status')][1];
$articleIcon = $artStatusTypes[$sql->getValue('status')][2];
$status = (int) $sql->getValue('status');
$articleStatus = $artStatusTypes[$status][0];
$articleClass = $artStatusTypes[$status][1];
$articleIcon = $artStatusTypes[$status][2];
$dataArtStatus = 'data-status="'.$status.'"';

$addExtra = '';
if ($canEdit) {
Expand Down Expand Up @@ -523,7 +529,7 @@
$tmplTd = '<td class="rex-table-template" data-title="' . rex_i18n::msg('header_template') . '">' . $tmpl . '</td>';
}

$echo .= '<tr '.$dataArtid.(('' != $classStartarticle) ? ' class="' . trim($classStartarticle) . '"' : '') . '>
$echo .= '<tr '.$dataArtStatus.' '.$dataArtid.(('' != $classStartarticle) ? ' class="' . trim($classStartarticle) . ' '.$trStatusClass.'"' : ' class="'.$trStatusClass.'"') . '>
<td class="rex-table-icon"><a class="rex-link-expanded" href="' . $editModeUrl . '" title="' . rex_escape($sql->getValue('name')) . '"><i class="rex-icon' . $class . '"></i></a></td>
<td class="rex-table-id" data-title="' . rex_i18n::msg('header_id') . '">' . $sql->getValue('id') . '</td>
<td class="rex-table-article-name" data-title="' . rex_i18n::msg('header_article_name') . '"><a class="rex-link-expanded" href="' . $editModeUrl . '">' . rex_escape($sql->getValue('name')) . '</a></td>
Expand All @@ -546,7 +552,7 @@
$tmplTd = '<td class="rex-table-template" data-title="' . rex_i18n::msg('header_template') . '">' . $tmpl . '</td>';
}

$echo .= '<tr '.$dataArtid.'>
$echo .= '<tr '.$dataArtStatus.' '.$dataArtid.' class="'.$trStatusClass.'">
<td class="rex-table-icon"><i class="rex-icon' . $class . '"></i></td>
<td class="rex-table-id" data-title="' . rex_i18n::msg('header_id') . '">' . $sql->getValue('id') . '</td>
<td class="rex-table-article-name" data-title="' . rex_i18n::msg('header_article_name') . '">' . rex_escape($sql->getValue('name')) . '</td>
Expand Down

0 comments on commit 27fe436

Please sign in to comment.