Commit aef32b04 by Scott

SnowFlat: switch block ranking layout to inline-block

parent 2c8a2d07
......@@ -31,8 +31,8 @@
.qa-a-list-item:after, .qa-a-item-buttons:after,
.qa-c-item-buttons:after, .qa-c-item-clear:after,
.qam-footer-row:after, .qam-qa-list-meta-box:after,
.qa-nav-footer-list:after, .qa-footer-clear:after ,
.qa-part-ranking:after , .qa-ranking-item:after {
.qa-nav-footer-list:after, .qa-footer-clear:after,
.qa-part-ranking:after, .qa-ranking-item:after {
content: " ";
display: table;
clear: both;
......@@ -1522,16 +1522,31 @@ blockquote p {
}
}
.qa-ranking-item {
margin: 5px 0;
display: inline-block;
position: relative;
margin: 5px;
padding: 5px;
}
.qa-top-users-item {
width: 100%;
max-width: 320px;
}
.qa-top-tags-item {
width: 100%;
max-width: 150px;
}
@media only screen and (min-width: 992px) { /*Two column layout for Desktops and above*/
.qa-ranking-item {
width: 50%;
float: left;
}
.qa-top-users-item {
width: 48%;
max-width: none;
}
.qa-top-tags-item {
width: 23%;
max-width: none;
}
}
.qa-top-users-avatar .qa-avatar-link {
display: block;
float: left;
......
......@@ -46,7 +46,7 @@ class qa_html_theme extends qa_html_theme_base
// Size of the user avatar in the navigation bar
private $nav_bar_avatar_size = 32;
//to use new block layout in rankings
// use new block layout in rankings
protected $ranking_block_layout = true;
/**
......@@ -654,23 +654,4 @@ class qa_html_theme extends qa_html_theme_base
'</div>' .
'</div>';
}
public function ranking($ranking)
{
$this->part_title($ranking);
if (!isset($ranking['type']))
$ranking['type'] = 'items';
$class = 'qa-top-'.$ranking['type'];
// new block layout
foreach ($ranking['items'] as $item) {
$this->output('<div class="qa-ranking-item '.$class.'-item">');
$this->ranking_item($item, $class);
$this->output('</div>');
}
$this->part_footer($ranking);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment