manage content, fix when ordered by postion

This commit is contained in:
Diego Najar 2018-08-28 19:23:21 +02:00
parent dac32fe532
commit aa95aedc8b
2 changed files with 32 additions and 9 deletions

View File

@ -217,3 +217,10 @@ div.sidebar .nav-item span.oi {
color: #6c757d !important; color: #6c757d !important;
} }
/*
Manage > Content
*/
td.child {
padding-left: 30px;
}

View File

@ -72,31 +72,47 @@ function table($type) {
if (!$page->isChild() || $type!='published') { if (!$page->isChild() || $type!='published') {
echo '<tr> echo '<tr>
<td> <td>
<a href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->key().'">' <div>
.($page->title()?$page->title():'<span>'.$L->g('Empty title').'</span> ') <a style="font-size: 1.1em" href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->key().'">'
.($page->title()?$page->title():'<span class="label-empty-title">'.$L->g('Empty title').'</span> ')
.'</a> .'</a>
</div>
<div>
<p style="font-size: 0.8em" class="m-0 text-uppercase text-muted">'.( ((ORDER_BY=='position') || ($type!='published'))?'Position: '.$page->position():$page->date(MANAGE_CONTENT_DATE_FORMAT) ).'</p>
</div>
</td>'; </td>';
$friendlyURL = Text::isEmpty($url->filters('page')) ? '/'.$page->key() : '/'.$url->filters('page').'/'.$page->key(); $friendlyURL = Text::isEmpty($url->filters('page')) ? '/'.$page->key() : '/'.$url->filters('page').'/'.$page->key();
echo '<td class="d-none d-lg-table-cell"><a target="_blank" href="'.$page->permalink().'">'.$friendlyURL.'</a></td>'; echo '<td class="d-none d-lg-table-cell"><a target="_blank" href="'.$page->permalink().'">'.$friendlyURL.'</a></td>';
echo '<td class="text-center d-none d-sm-table-cell">'.$page->position().'</td>'; echo '<td class="pt-3 text-center d-none d-sm-table-cell">'.PHP_EOL;
echo '<a class="btn btn-secondary btn-sm mb-1" href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->key().'"><span class="oi oi-pencil"></span> '.$L->g('Edit').'</a>'.PHP_EOL;
echo '<button type="button" class="btn btn-secondary btn-sm deletePageButton mb-1" data-toggle="modal" data-target="#jsdeletePageModal" data-key="'.$page->key().'"><span class="oi oi-trash"></span> '.$L->g('Delete').'</button>'.PHP_EOL;
echo '</td>';
echo '</tr>'; echo '</tr>';
foreach ($page->children() as $child) { foreach ($page->children() as $child) {
if ($child->published()) { if ($child->published()) {
echo '<tr> echo '<tr>
<td> <td class="child">
<a href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$child->key().'">' <div>
.($child->title()?$child->title():'<span>'.$L->g('Empty title').'</span> ') <a style="font-size: 1.1em" href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$child->key().'">'
.($child->title()?$child->title():'<span class="label-empty-title">'.$L->g('Empty title').'</span> ')
.'</a> .'</a>
</div>
<div>
<p style="font-size: 0.8em" class="m-0 text-uppercase text-muted">'.( ((ORDER_BY=='position') || ($type!='published'))?'Position: '.$child->position():$child->date(MANAGE_CONTENT_DATE_FORMAT) ).'</p>
</div>
</td>'; </td>';
$friendlyURL = Text::isEmpty($url->filters('page')) ? '/'.$child->key() : '/'.$url->filters('page').'/'.$child->key(); $friendlyURL = Text::isEmpty($url->filters('page')) ? '/'.$child->key() : '/'.$url->filters('page').'/'.$child->key();
echo '<td><a target="_blank" href="'.$child->permalink().'">'.$friendlyURL.'</a></td>'; echo '<td><a target="_blank" href="'.$child->permalink().'">'.$friendlyURL.'</a></td>';
echo '<td>'.$child->position().'</td>'; echo '<td class="pt-3 text-center d-none d-sm-table-cell">'.PHP_EOL;
echo '<a class="btn btn-secondary btn-sm mb-1" href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$child->key().'"><span class="oi oi-pencil"></span> '.$L->g('Edit').'</a>'.PHP_EOL;
echo '<button type="button" class="btn btn-secondary btn-sm deletePageButton mb-1" data-toggle="modal" data-target="#jsdeletePageModal" data-key="'.$child->key().'"><span class="oi oi-trash"></span> '.$L->g('Delete').'</button>'.PHP_EOL;
echo '</td>';
echo '</tr>'; echo '</tr>';
} }