Improve mobile layout (Android phones)

This commit is contained in:
Frédéric Guillot 2014-02-14 21:21:14 -05:00
parent 7346686e9a
commit da61d38249
10 changed files with 182 additions and 85 deletions

View File

@ -429,15 +429,12 @@ nav .active a {
text-decoration: underline; text-decoration: underline;
} }
.item-menu,
.items p { .items p {
color: #aaa; color: #aaa;
font-size: 70%; font-size: 70%;
} }
.items p a {
color: #aaa;
}
.items .preview { .items .preview {
line-height: 1.5em; line-height: 1.5em;
font-size: 100%; font-size: 100%;
@ -539,13 +536,35 @@ nav .active a {
display: block; display: block;
} }
.infos { ul.item-menu,
padding-bottom: 20px; ul.item-infos {
color: #ccc; margin: 0;
padding: 0;
color: #aaa;
} }
.item .infos a { .item-menu li,
color: #ccc; ul.item-infos li {
margin: 0;
padding-left: 7px;
padding-right: 5px;
display: inline;
border-right: 1px solid #ccc;
}
.item-menu li:first-child,
ul.item-infos li:first-child {
padding-left: 0;
}
.item-menu li:last-child,
ul.item-infos li:last-child {
border: none;
}
.item-menu a,
ul.item-infos a {
color: #aaa;
} }
span.downloading img { span.downloading img {
@ -565,7 +584,7 @@ span.downloading img {
text-align: center; text-align: center;
} }
.item .infos a.bookmark-icon { a.bookmark-icon {
color: #333; color: #333;
text-decoration: none; text-decoration: none;
} }
@ -605,6 +624,7 @@ iframe {
/* mobile design */ /* mobile design */
@media only screen and (max-width: 480px) { @media only screen and (max-width: 480px) {
ul li.hide-mobile,
.hide-mobile { .hide-mobile {
display: none; display: none;
} }
@ -640,9 +660,8 @@ iframe {
font-size: 0.75em; font-size: 0.75em;
} }
.item .infos { .item-infos {
font-size: 0.9em; font-size: 0.9em;
padding: 0;
} }
.item nav a { .item nav a {
@ -654,6 +673,13 @@ iframe {
color: #555; color: #555;
} }
.item-menu li,
ul.item-infos li {
padding-left: 0;
padding-right: 5px;
border: none;
}
section li { section li {
font-size: 0.85em; font-size: 0.85em;
} }

View File

@ -1,3 +1,4 @@
<li class="hide-mobile">
<?php if ($item['bookmark']): ?> <?php if ($item['bookmark']): ?>
<a <a
id="bookmark-<?= $item['id'] ?>" id="bookmark-<?= $item['id'] ?>"
@ -7,7 +8,7 @@
data-reverse-label="<?= t('bookmark') ?>" data-reverse-label="<?= t('bookmark') ?>"
> >
<?= t('remove bookmark') ?> <?= t('remove bookmark') ?>
</a> | </a>
<?php else: ?> <?php else: ?>
<a <a
id="bookmark-<?= $item['id'] ?>" id="bookmark-<?= $item['id'] ?>"
@ -17,5 +18,6 @@
data-reverse-label="<?= t('remove bookmark') ?>" data-reverse-label="<?= t('remove bookmark') ?>"
> >
<?= t('bookmark') ?> <?= t('bookmark') ?>
</a> | </a>
<?php endif ?> <?php endif ?>
</li>

View File

@ -49,26 +49,32 @@
<?php endif ?> <?php endif ?>
</h2> </h2>
<p> <ul class="item-menu">
<a href="<?= $feed['site_url'] ?>" rel="noreferrer" target="_blank"><?= Helper\get_host_from_url($feed['site_url']) ?></a> | <li>
<a href="<?= $feed['site_url'] ?>" rel="noreferrer" target="_blank"><?= Helper\get_host_from_url($feed['site_url']) ?></a>
<span class="hide-mobile"><a href="?action=confirm-remove-feed&amp;feed_id=<?= $feed['id'] ?>"><?= t('remove') ?></a> |</span> </li>
<li class="hide-mobile">
<a href="?action=confirm-remove-feed&amp;feed_id=<?= $feed['id'] ?>"><?= t('remove') ?></a>
</li>
<li class="hide-mobile">
<?php if ($feed['download_content']): ?> <?php if ($feed['download_content']): ?>
<span class="hide-mobile"><a href="?action=disable-grabber-feed&amp;feed_id=<?= $feed['id'] ?>"><strong><?= t('disable full content') ?></strong></a> |</span> <a href="?action=disable-grabber-feed&amp;feed_id=<?= $feed['id'] ?>"><strong><?= t('disable full content') ?></strong></a>
<?php else: ?> <?php else: ?>
<span class="hide-mobile"><a href="?action=enable-grabber-feed&amp;feed_id=<?= $feed['id'] ?>"><?= t('enable full content') ?></a> |</span> <a href="?action=enable-grabber-feed&amp;feed_id=<?= $feed['id'] ?>"><?= t('enable full content') ?></a>
<?php endif ?> <?php endif ?>
</li>
<li class="hide-mobile">
<?php if ($feed['enabled']): ?> <?php if ($feed['enabled']): ?>
<span class="hide-mobile"><a href="?action=confirm-disable-feed&amp;feed_id=<?= $feed['id'] ?>"><?= t('disable') ?></a> |</span> <a href="?action=confirm-disable-feed&amp;feed_id=<?= $feed['id'] ?>"><?= t('disable') ?></a>
<a href="?action=refresh-feed&amp;feed_id=<?= $feed['id'] ?>" data-feed-id="<?= $feed['id'] ?>" data-action="refresh-feed"><?= t('refresh') ?></a> | <a href="?action=refresh-feed&amp;feed_id=<?= $feed['id'] ?>" data-feed-id="<?= $feed['id'] ?>" data-action="refresh-feed"><?= t('refresh') ?></a>
<?php else: ?> <?php else: ?>
<span class="hide-mobile"><a href="?action=enable-feed&amp;feed_id=<?= $feed['id'] ?>"><?= t('enable') ?></a> |</span> <a href="?action=enable-feed&amp;feed_id=<?= $feed['id'] ?>"><?= t('enable') ?></a>
<?php endif ?> <?php endif ?>
</li>
<span class="hide-mobile"><a href="?action=edit-feed&amp;feed_id=<?= $feed['id'] ?>"><?= t('edit') ?></a></span> <li class="hide-mobile">
</p> <a href="?action=edit-feed&amp;feed_id=<?= $feed['id'] ?>"><?= t('edit') ?></a>
</li>
</ul>
</article> </article>
<?php endforeach ?> <?php endforeach ?>
</section> </section>

View File

@ -8,7 +8,7 @@
> >
<h2> <h2>
<?= $item['bookmark'] ? '<span id="bookmark-icon-'.$item['id'].'">★ </span>' : '' ?> <?= $item['bookmark'] ? '<span id="bookmark-icon-'.$item['id'].'">★ </span>' : '' ?>
<?= $item['status'] === 'read' ? '<span id="read-icon-'.$item['id'].'"> </span>' : '' ?> <?= $item['status'] === 'read' ? '<span id="read-icon-'.$item['id'].'"> </span>' : '' ?>
<a <a
href="?action=show&amp;menu=<?= $menu ?>&amp;id=<?= $item['id'] ?>" href="?action=show&amp;menu=<?= $menu ?>&amp;id=<?= $item['id'] ?>"
data-item-id="<?= $item['id'] ?>" data-item-id="<?= $item['id'] ?>"
@ -21,29 +21,21 @@
<p class="preview"> <p class="preview">
<?= Helper\escape(Helper\summary(strip_tags($item['content']), 50, 300)) ?> <?= Helper\escape(Helper\summary(strip_tags($item['content']), 50, 300)) ?>
</p> </p>
<p> <ul class="item-menu">
<li>
<?php if (! isset($item['feed_title'])): ?> <?php if (! isset($item['feed_title'])): ?>
<?= Helper\get_host_from_url($item['url']) ?> | <?= Helper\get_host_from_url($item['url']) ?>
<?php else: ?> <?php else: ?>
<a href="?action=feed-items&amp;feed_id=<?= $item['feed_id'] ?>" title="<?= t('Show only this subscription') ?>"><?= Helper\escape($item['feed_title']) ?></a> | <a href="?action=feed-items&amp;feed_id=<?= $item['feed_id'] ?>" title="<?= t('Show only this subscription') ?>"><?= Helper\escape($item['feed_title']) ?></a>
<?php endif ?> <?php endif ?>
</li>
<span class="hide-mobile"> <li class="hide-mobile">
<?= dt('%e %B %Y %k:%M', $item['updated']) ?> | <?= dt('%e %B %Y %k:%M', $item['updated']) ?>
</li>
<li class="hide-mobile">
<a href="<?= $item['url'] ?>" id="original-<?= $item['id'] ?>" rel="noreferrer" target="_blank" data-item-id="<?= $item['id'] ?>"><?= t('original link') ?></a>
</li>
<?= \PicoTools\Template\load('bookmark_links', array('item' => $item, 'menu' => $menu, 'offset' => $offset, 'source' => '')) ?> <?= \PicoTools\Template\load('bookmark_links', array('item' => $item, 'menu' => $menu, 'offset' => $offset, 'source' => '')) ?>
<a
href="<?= $item['url'] ?>"
id="original-<?= $item['id'] ?>"
rel="noreferrer"
target="_blank"
data-item-id="<?= $item['id'] ?>"
>
<?= t('original link') ?>
</a> |
</span>
<?= \PicoTools\Template\load('status_links', array('item' => $item, 'redirect' => $menu, 'offset' => $offset)) ?> <?= \PicoTools\Template\load('status_links', array('item' => $item, 'redirect' => $menu, 'offset' => $offset)) ?>
</ul>
</p>
</article> </article>

View File

@ -37,7 +37,7 @@
<a href="?action=logout"><?= t('logout') ?></a> <a href="?action=logout"><?= t('logout') ?></a>
</li> </li>
<li class="<?= isset($menu) && $menu === 'more' ? 'active hide-desktop' : 'hide-desktop' ?>"> <li class="<?= isset($menu) && $menu === 'more' ? 'active hide-desktop' : 'hide-desktop' ?>">
<a href="?action=more"><?= t(' menu') ?></a> <a href="?action=more"><?= t(' menu') ?></a>
</li> </li>
</ul> </ul>
</nav> </nav>

View File

@ -36,7 +36,8 @@
</a> </a>
</h1> </h1>
<p class="infos"> <ul class="item-infos">
<li>
<?php if ($item['bookmark']): ?> <?php if ($item['bookmark']): ?>
<a <a
id="bookmark-<?=$item['id'] ?>" id="bookmark-<?=$item['id'] ?>"
@ -55,12 +56,15 @@
data-action="bookmark" data-action="bookmark"
data-item-id="<?= $item['id'] ?>" data-item-id="<?= $item['id'] ?>"
></a> ></a>
<?php endif ?> | <?php endif ?>
</li>
<a href="?action=feed-items&amp;feed_id=<?= $feed['id'] ?>"><?= Helper\escape($feed['title']) ?></a> | <li>
<a href="?action=feed-items&amp;feed_id=<?= $feed['id'] ?>"><?= Helper\escape($feed['title']) ?></a>
<span class="hide-mobile"><?= dt('%e %B %Y %k:%M', $item['updated']) ?> |</span> </li>
<li class="hide-mobile">
<?= dt('%e %B %Y %k:%M', $item['updated']) ?>
</li>
<li class="hide-mobile">
<span id="download-item" <span id="download-item"
data-item-id="<?= $item['id'] ?>" data-item-id="<?= $item['id'] ?>"
data-failure-message="<?= t('unable to fetch content') ?>" data-failure-message="<?= t('unable to fetch content') ?>"
@ -70,7 +74,8 @@
<?= t('download content') ?> <?= t('download content') ?>
</a> </a>
</span> </span>
</p> </li>
</ul>
<div id="item-content"> <div id="item-content">
<?= $item['content'] ?> <?= $item['content'] ?>

View File

@ -1,11 +1,7 @@
<span class="hide-mobile"> <li class="hide-mobile">
<a <a href="?action=mark-item-removed&amp;id=<?= $item['id'] ?>&amp;offset=<?= $offset ?>&amp;redirect=<?= $redirect ?>&amp;feed_id=<?= $item['feed_id'] ?>"><?= t('remove') ?></a>
href="?action=mark-item-removed&amp;id=<?= $item['id'] ?>&amp;offset=<?= $offset ?>&amp;redirect=<?= $redirect ?>&amp;feed_id=<?= $item['feed_id'] ?>" </li>
> <li>
<?= t('remove') ?>
</a> |
</span>
<?php if ($item['status'] == 'unread'): ?> <?php if ($item['status'] == 'unread'): ?>
<a <a
id="status-<?= $item['id'] ?>" id="status-<?= $item['id'] ?>"
@ -27,3 +23,4 @@
<?= t('mark as unread') ?> <?= t('mark as unread') ?>
</a> </a>
<?php endif ?> <?php endif ?>
</li>

View File

@ -4612,6 +4612,32 @@ section .alert ul {
padding-left: 0; padding-left: 0;
} }
ul.item-menu,
ul.item-infos {
margin: 0;
padding: 0;
color: #428bca;
}
.item-menu li,
ul.item-infos li {
margin: 0;
padding-left: 7px;
padding-right: 5px;
display: inline;
border-right: 1px solid #ccc;
}
.item-menu li:first-child,
ul.item-infos li:first-child {
padding-left: 0;
}
.item-menu li:last-child,
ul.item-infos li:last-child {
border: none;
}
@media (max-width:1200px) { @media (max-width:1200px) {
.hide-mobile { .hide-mobile {
display: none !important; display: none !important;

View File

@ -4612,6 +4612,32 @@ section .alert ul {
padding-left: 0; padding-left: 0;
} }
ul.item-menu,
ul.item-infos {
margin: 0;
padding: 0;
color: #2a9fd6;
}
.item-menu li,
ul.item-infos li {
margin: 0;
padding-left: 7px;
padding-right: 5px;
display: inline;
border-right: 1px solid #ccc;
}
.item-menu li:first-child,
ul.item-infos li:first-child {
padding-left: 0;
}
.item-menu li:last-child,
ul.item-infos li:last-child {
border: none;
}
@media (max-width:1200px) { @media (max-width:1200px) {
.hide-mobile { .hide-mobile {
display: none !important; display: none !important;

View File

@ -79,6 +79,22 @@ iframe {
padding: 3px; padding: 3px;
} }
ul.item-menu,
ul.item-infos {
padding: 0;
}
ul.item-menu li,
ul.item-infos li {
margin: 0;
padding-right: 5px;
display: inline;
}
a.bookmark-icon {
text-decoration: none;
}
/* desktop design */ /* desktop design */
@media only screen and (min-width: 480px) { @media only screen and (min-width: 480px) {
@ -90,6 +106,7 @@ iframe {
/* mobile design */ /* mobile design */
@media only screen and (max-width: 480px) { @media only screen and (max-width: 480px) {
ul li.hide-mobile,
.hide-mobile { .hide-mobile {
display: none; display: none;
} }