Commit e707b833 by Scott

Scrap tables on users/tags (ranking) pages

Use inline-block instead
parent 58d78167
...@@ -307,7 +307,7 @@ ...@@ -307,7 +307,7 @@
'page_size_tag_qs' => 20, 'page_size_tag_qs' => 20,
'page_size_tags' => 30, 'page_size_tags' => 30,
'page_size_una_qs' => 20, 'page_size_una_qs' => 20,
'page_size_users' => 20, 'page_size_users' => 30,
'page_size_wall' => 10, 'page_size_wall' => 10,
'pages_prev_next' => 3, 'pages_prev_next' => 3,
'permit_anon_view_ips' => QA_PERMIT_EDITORS, 'permit_anon_view_ips' => QA_PERMIT_EDITORS,
......
...@@ -58,19 +58,24 @@ ...@@ -58,19 +58,24 @@
); );
if (count($users)) { if (count($users)) {
foreach ($users as $userid => $user) foreach ($users as $userid => $user) {
$qa_content['ranking']['items'][]=array( if (QA_FINAL_EXTERNAL_USERS)
'label' => $avatarhtml = qa_get_external_avatar_html($user['userid'], qa_opt('avatar_users_size'), true);
(QA_FINAL_EXTERNAL_USERS else {
? qa_get_external_avatar_html($user['userid'], qa_opt('avatar_users_size'), true) $avatarhtml = qa_get_user_avatar_html($user['flags'], $user['email'], $user['handle'],
: qa_get_user_avatar_html($user['flags'], $user['email'], $user['handle'], $user['avatarblobid'], $user['avatarwidth'], $user['avatarheight'], qa_opt('avatar_users_size'), true);
$user['avatarblobid'], $user['avatarwidth'], $user['avatarheight'], qa_opt('avatar_users_size'), true) }
).' '.$usershtml[$user['userid']],
// avatar and handle now listed separately for use in themes
$qa_content['ranking']['items'][] = array(
'avatar' => $avatarhtml,
'label' => $usershtml[$user['userid']],
'score' => qa_html(number_format($user['points'])), 'score' => qa_html(number_format($user['points'])),
'raw' => $user, 'raw' => $user,
); );
}
} else }
else
$qa_content['title']=qa_lang_html('main/no_active_users'); $qa_content['title']=qa_lang_html('main/no_active_users');
$qa_content['page_links']=qa_html_page_links(qa_request(), $start, $pagesize, $usercount, qa_opt('pages_prev_next')); $qa_content['page_links']=qa_html_page_links(qa_request(), $start, $pagesize, $usercount, qa_opt('pages_prev_next'));
......
...@@ -1248,73 +1248,44 @@ ...@@ -1248,73 +1248,44 @@
{ {
$this->part_title($ranking); $this->part_title($ranking);
$class=(@$ranking['type']=='users') ? 'qa-top-users' : 'qa-top-tags'; if (!isset($ranking['type']))
$ranking['type'] = 'items';
$class = 'qa-top-'.$ranking['type'];
$rows=min($ranking['rows'], count($ranking['items'])); foreach ($ranking['items'] as $item) {
$this->output('<span class="qa-ranking-item '.$class.'-item">');
if ($rows>0) { $this->ranking_item($item, $class);
$this->output('<table class="'.$class.'-table">'); $this->output('</span>');
$columns=ceil(count($ranking['items'])/$rows);
for ($row=0; $row<$rows; $row++) {
$this->set_context('ranking_row', $row);
$this->output('<tr>');
for ($column=0; $column<$columns; $column++) {
$this->set_context('ranking_column', $column);
$this->ranking_item(@$ranking['items'][$column*$rows+$row], $class, $column>0);
}
$this->clear_context('ranking_column');
$this->output('</tr>');
}
$this->clear_context('ranking_row');
$this->output('</table>');
} }
} }
public function ranking_item($item, $class, $spacer) public function ranking_item($item, $class, $spacer=false) // $spacer is deprecated
{ {
if ($spacer) if (isset($item['count']))
$this->ranking_spacer($class); $this->ranking_count($item, $class);
if (empty($item)) {
$this->ranking_spacer($class);
$this->ranking_spacer($class);
} else {
if (isset($item['count']))
$this->ranking_count($item, $class);
$this->ranking_label($item, $class); if (isset($item['avatar']))
$this->avatar($item, $class);
if (isset($item['score'])) $this->ranking_label($item, $class);
$this->ranking_score($item, $class);
}
}
public function ranking_spacer($class) if (isset($item['score']))
{ $this->ranking_score($item, $class);
$this->output('<td class="'.$class.'-spacer">&nbsp;</td>');
} }
public function ranking_count($item, $class) public function ranking_count($item, $class)
{ {
$this->output('<td class="'.$class.'-count">'.$item['count'].' &#215;'.'</td>'); $this->output('<span class="'.$class.'-count">'.$item['count'].' &#215;'.'</span>');
} }
public function ranking_label($item, $class) public function ranking_label($item, $class)
{ {
$this->output('<td class="'.$class.'-label">'.$item['label'].'</td>'); $this->output('<span class="'.$class.'-label">'.$item['label'].'</span>');
} }
public function ranking_score($item, $class) public function ranking_score($item, $class)
{ {
$this->output('<td class="'.$class.'-score">'.$item['score'].'</td>'); $this->output('<span class="'.$class.'-score">'.$item['score'].'</span>');
} }
public function message_list_and_form($list) public function message_list_and_form($list)
...@@ -1613,10 +1584,14 @@ ...@@ -1613,10 +1584,14 @@
$this->output_split(@$post['views'], 'qa-view-count'); $this->output_split(@$post['views'], 'qa-view-count');
} }
public function avatar($post, $class) public function avatar($item, $class, $prefix=null)
{ {
if (isset($post['avatar'])) if (isset($item['avatar'])) {
$this->output('<span class="'.$class.'-avatar">', $post['avatar'], '</span>'); if (isset($prefix))
$this->output($prefix);
$this->output('<span class="'.$class.'-avatar">', $item['avatar'], '</span>');
}
} }
public function a_selection($post) public function a_selection($post)
......
...@@ -305,16 +305,14 @@ h2 {font-size:22px; color:#c659ab; padding-top:12px; clear:both;} ...@@ -305,16 +305,14 @@ h2 {font-size:22px; color:#c659ab; padding-top:12px; clear:both;}
/* Tags, users and categories */ /* Tags, users and categories */
.qa-top-tags-table {float:left; border-collapse:collapse; margin-bottom:1em;} .qa-ranking-item { display:inline-block; margin:0 5px 15px 0; padding:3px; vertical-align:top; width:220px; line-height:1.3; }
.qa-top-tags-count {border:1px solid #C0B600; border-right:1px dashed #E9E697; color:#8D006A; text-align:right; padding:6px 8px 6px 12px;} .qa-top-users-item { border:1px solid #c0b600; background:#ffffe6; }
.qa-top-tags-label {border:1px solid #C0B600; border-left:none; background:#FFFFE6; padding:4px 16px 0 8px;} .qa-top-users-avatar { float:left; margin-right:6px; }
.qa-top-tags-label .qa-tag-link {font-weight:normal;} .qa-top-users-label, .qa-top-users-score { display:block; }
.qa-top-tags-spacer {padding:0 4px;}
.qa-top-tags-item { width:170px; border:1px solid #c0b600; background:#ffffe6; }
.qa-top-users-table {float:left; border-collapse:collapse; margin-bottom:1em;} .qa-top-tags-count { display:inline-block; min-width:40px; text-align:right; padding-right:3px; }
.qa-top-users-label {border:1px solid #C0B600; border-right:1px dashed #c1c5a9; padding:6px 16px 6px 12px; text-align:left;} .qa-top-tags-label { display:inline-block; }
.qa-top-users-score {background:#ffffe6; border-color:#C0B600; border-style:solid solid solid none; border-width:1px; color:#8D006A; padding:6px 12px; text-align:right;}
.qa-top-users-spacer {padding:0 4px;}
.qa-browse-cat-list {list-style:none; padding:0; margin:0; margin-left:2em;} .qa-browse-cat-list {list-style:none; padding:0; margin:0; margin-left:2em;}
.qa-browse-cat-list-1 {font-size:18px; margin-top:1em;} .qa-browse-cat-list-1 {font-size:18px; margin-top:1em;}
......
...@@ -280,16 +280,14 @@ h2 {font-size:16px; padding-top:12px; clear:both;} ...@@ -280,16 +280,14 @@ h2 {font-size:16px; padding-top:12px; clear:both;}
/* Tags, users and categories */ /* Tags, users and categories */
.qa-top-tags-table {float:left; border-collapse:collapse; margin-bottom:1em;} .qa-ranking-item { display:inline-block; margin:0 5px 15px 0; padding:3px; vertical-align:top; width:220px; line-height:1.3; }
.qa-top-tags-count {border:1px solid #658296; border-right:1px dashed #c1ced6; color:#235272; text-align:right; padding:6px 8px 6px 12px;} .qa-top-users-item { border:1px solid #c1c5a9; background:#e9ebde; }
.qa-top-tags-label {border:1px solid #658296; border-left:none; background:#e7eff4; padding:3px 16px 0px 8px;} .qa-top-users-avatar { float:left; margin-right:6px; }
.qa-top-tags-label .qa-tag-link {font-weight:normal;} .qa-top-users-label, .qa-top-users-score { display:block; }
.qa-top-tags-spacer {padding:0 4px;}
.qa-top-tags-item { width:170px; border:1px solid #658296; background:#e7eff4; }
.qa-top-users-table {float:left; border-collapse:collapse; margin-bottom:1em;} .qa-top-tags-count { display:inline-block; min-width:40px; text-align:right; padding-right:3px; }
.qa-top-users-label {border:1px solid #c1c5a9; border-right:1px dashed #c1c5a9; padding:6px 16px 6px 12px; text-align:left;} .qa-top-tags-label { display:inline-block; }
.qa-top-users-score {border:1px solid #c1c5a9; border-left:none; background:#e9ebde; color:#414944; text-align:right; padding:6px 12px;}
.qa-top-users-spacer {padding:0 4px;}
.qa-browse-cat-list {list-style:none; padding:0; margin:0; margin-left:2.5em;} .qa-browse-cat-list {list-style:none; padding:0; margin:0; margin-left:2.5em;}
.qa-browse-cat-list-1 {font-size:16px;} .qa-browse-cat-list-1 {font-size:16px;}
......
...@@ -1779,64 +1779,46 @@ div.header-banner { ...@@ -1779,64 +1779,46 @@ div.header-banner {
text-decoration: underline; text-decoration: underline;
} }
/* Tags, users and categories */
.qa-top-tags-table {
float: left;
border-collapse: collapse;
margin-bottom: 1em;
}
.qa-top-tags-count {
border: 1px solid #ccc;
border-right: 1px dashed #aaa;
color: #fff;
text-align: right;
padding: 6px 8px 6px 12px;
background: #0179b5;
font-weight: 700;
}
.qa-top-tags-label { /* Tags and Users ranking */
background: #fff;
padding: 4px 16px 0 8px;
}
.qa-top-tags-label .qa-tag-link { .qa-ranking-item {
font-weight: 400; display: inline-block;
margin: 0 5px 15px 0;
vertical-align: top;
width: 220px;
min-height: 30px;
line-height: 1.3;
} }
.qa-top-tags-spacer { .qa-top-users-item {
padding: 0 4px;
} }
.qa-top-users-avatar {
.qa-top-users-table {
float: left; float: left;
border-collapse: collapse; margin-right: 6px;
margin-bottom: 1em;
} }
.qa-top-users-label { .qa-top-users-label {
border: 1px solid #ddd; display: block;
border-right: 1px solid #ddd;
text-align: left;
padding: 6px 16px 6px 12px;
background: #fff;
} }
.qa-top-users-score { .qa-top-users-score {
background: #0179b5; display: block;
color: #fff;
font-weight: bold;
text-align: right;
border-color: #ddd;
border-style: solid solid solid none;
border-width: 1px;
padding: 6px 12px;
} }
.qa-top-users-spacer { .qa-top-tags-item {
padding: 0 4px; width: 165px;
}
.qa-top-tags-count {
display: inline-block;
min-width: 40px;
text-align: right;
padding-right: 3px;
} }
.qa-top-tags-label {
display: inline-block;
}
/* Categories */
.qa-browse-cat-list { .qa-browse-cat-list {
list-style: none; list-style: none;
......
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