Merge branch 'im-mi-tag-tables' into develop

autocomplete
Shish 6 years ago
commit 4ed28e2db7
  1. 106
      ext/tag_list/theme.php
  2. 14
      themes/danbooru/style.css
  3. 15
      themes/danbooru2/style.css
  4. 14
      themes/default/style.css
  5. 19
      themes/futaba/style.css
  6. 15
      themes/lite/style.css
  7. 14
      themes/material/style.css
  8. 16
      themes/warm/style.css

@ -35,6 +35,29 @@ class TagListTheme extends Themelet {
// =======================================================================
protected function get_tag_list_preamble() {
global $config;
$tag_info_link_is_visible = !is_null($config->get_string('info_link'));
$tag_count_is_visible = $config->get_bool("tag_list_numbers");
return '
<table class="tag_list sortable">
<colgroup>' .
($tag_info_link_is_visible ? '<col class="tag_info_link_column">' : '') .
('<col class="tag_name_column">') .
($tag_count_is_visible ? '<col class="tag_count_column">' : '') . '
</colgroup>
<thead>
<tr>' .
($tag_info_link_is_visible ? '<th class="tag_info_link_cell"></th>' : '') .
('<th class="tag_name_cell">Tag</th>') .
($tag_count_is_visible ? '<th class="tag_count_cell">#</th>' : '') . '
</tr>
</thead>
<tbody>';
}
/*
* $tag_infos = array(
* array('tag' => $tag, 'count' => $number_of_uses),
@ -61,9 +84,9 @@ class TagListTheme extends Themelet {
$category = $split[0];
$tag_html = $split[1];
if(!isset($tag_categories_html[$category])) {
$tag_categories_html[$category] = '';
$tag_categories_html[$category] = $this->get_tag_list_preamble();
}
$tag_categories_html[$category] .= $tag_html . '<br />';
$tag_categories_html[$category] .= "<tr>$tag_html</tr>";
if(!isset($tag_categories_count[$category])) {
$tag_categories_count[$category] = 0;
@ -71,6 +94,10 @@ class TagListTheme extends Themelet {
$tag_categories_count[$category] += 1;
}
foreach(array_keys($tag_categories_html) as $category) {
$tag_categories_html[$category] .= '</tbody></table>';
}
asort($tag_categories_html);
if(isset($tag_categories_html[' '])) $main_html = $tag_categories_html[' ']; else $main_html = null;
unset($tag_categories_html[' ']);
@ -99,10 +126,8 @@ class TagListTheme extends Themelet {
* ...
* )
*/
public function display_related_block(Page $page, $tag_infos) {
global $config;
if($config->get_string('tag_list_related_sort') == 'alphabetical') asort($tag_infos);
private function get_tag_list_html($tag_infos, $sort) {
if($sort == 'alphabetical') asort($tag_infos);
if(class_exists('TagCategories')) {
$this->tagcategories = new TagCategories;
@ -111,15 +136,32 @@ class TagListTheme extends Themelet {
else {
$tag_category_dict = array();
}
$main_html = '';
$main_html = $this->get_tag_list_preamble();
foreach($tag_infos as $row) {
$split = $this->return_tag($row, $tag_category_dict);
//$category = $split[0];
$tag_html = $split[1];
$main_html .= $tag_html . '<br />';
$main_html .= "<tr>$tag_html</tr>";
}
$main_html .= '</tbody></table>';
return $main_html;
}
/*
* $tag_infos = array(
* array('tag' => $tag, 'count' => $number_of_uses),
* ...
* )
*/
public function display_related_block(Page $page, $tag_infos) {
global $config;
$main_html = $this->get_tag_list_html(
$tag_infos, $config->get_string('tag_list_related_sort'));
if($config->get_string('tag_list_image_type')=="tags") {
$page->add_block(new Block("Tags", $main_html, "left", 10));
}
@ -138,25 +180,10 @@ class TagListTheme extends Themelet {
public function display_popular_block(Page $page, $tag_infos) {
global $config;
if($config->get_string('tag_list_popular_sort') == 'alphabetical') asort($tag_infos);
if(class_exists('TagCategories')) {
$this->tagcategories = new TagCategories;
$tag_category_dict = $this->tagcategories->getKeyedDict();
}
else {
$tag_category_dict = array();
}
$main_html = '';
foreach($tag_infos as $row) {
$split = self::return_tag($row, $tag_category_dict);
//$category = $split[0];
$tag_html = $split[1];
$main_html .= $tag_html . '<br />';
}
$main_html = $this->get_tag_list_html(
$tag_infos, $config->get_string('tag_list_popular_sort'));
$main_html .= "&nbsp;<br><a class='more' href='".make_link("tags")."'>Full List</a>\n";
$page->add_block(new Block("Popular Tags", $main_html, "left", 60));
}
@ -170,25 +197,10 @@ class TagListTheme extends Themelet {
public function display_refine_block(Page $page, $tag_infos, $search) {
global $config;
if($config->get_string('tag_list_popular_sort') == 'alphabetical') asort($tag_infos);
if(class_exists('TagCategories')) {
$this->tagcategories = new TagCategories;
$tag_category_dict = $this->tagcategories->getKeyedDict();
}
else {
$tag_category_dict = array();
}
$main_html = '';
foreach($tag_infos as $row) {
$split = self::return_tag($row, $tag_category_dict);
//$category = $split[0];
$tag_html = $split[1];
$main_html .= $tag_html . '<br />';
}
$main_html = $this->get_tag_list_html(
$tag_infos, $config->get_string('tag_list_popular_sort'));
$main_html .= "&nbsp;<br><a class='more' href='".make_link("tags")."'>Full List</a>\n";
$page->add_block(new Block("refine Search", $main_html, "left", 60));
}
@ -217,13 +229,13 @@ class TagListTheme extends Themelet {
// if($n++) $display_html .= "\n<br/>";
if(!is_null($config->get_string('info_link'))) {
$link = html_escape(str_replace('$tag', url_escape($tag), $config->get_string('info_link')));
$display_html .= ' <a class="tag_info_link'.$tag_category_css.'" '.$tag_category_style.'href="'.$link.'">?</a>';
$display_html .= '<td class="tag_info_link_cell"> <a class="tag_info_link'.$tag_category_css.'" '.$tag_category_style.'href="'.$link.'">?</a></td>';
}
$link = $this->tag_link($row['tag']);
$display_html .= ' <a class="tag_name'.$tag_category_css.'" '.$tag_category_style.'href="'.$link.'">'.$h_tag_no_underscores.'</a>';
$display_html .= '<td class="tag_name_cell"> <a class="tag_name'.$tag_category_css.'" '.$tag_category_style.'href="'.$link.'">'.$h_tag_no_underscores.'</a></td>';
if($config->get_bool("tag_list_numbers")) {
$display_html .= " <span class='tag_count'>$count</span>";
$display_html .= "<td class='tag_count_cell'> <span class='tag_count'>$count</span></td>";
}
return array($category, $display_html);

@ -132,6 +132,20 @@ overflow:hidden;
text-align:left;
width:150px;
}
TABLE.tag_list {
border-collapse: collapse;
}
TABLE.tag_list>THEAD {
display: none;
}
TABLE.tag_list>TBODY>TR>TD {
display: inline;
padding: 0;
line-height: 1em;
}
TABLE.tag_list>TBODY>TR>TD:after {
content: " ";
}
.tag_count {
color:#AAAAAA;
}

@ -152,6 +152,21 @@ max-width:150px;
width:15rem;
text-align:left;
}
TABLE.tag_list {
width: auto;
border-collapse: collapse;
}
TABLE.tag_list>THEAD {
display: none;
}
TABLE.tag_list>TBODY>TR>TD {
display: inline;
padding: 0;
line-height: 1em;
}
TABLE.tag_list>TBODY>TR>TD:after {
content: " ";
}
.tag_count {
display:inline-block;
margin-left:0.4rem;

@ -96,6 +96,20 @@ NAV SELECT {
padding: 0px;
}
TABLE.tag_list {
border-collapse: collapse;
}
TABLE.tag_list>THEAD {
display: none;
}
TABLE.tag_list>TBODY>TR>TD {
display: inline;
padding: 0;
}
TABLE.tag_list>TBODY>TR>TD:after {
content: " ";
}
.more:after {
content: " >>>";
}

@ -61,6 +61,25 @@ TD {
vertical-align: top;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* the navigation bar, and all its blocks *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
TABLE.tag_list {
border-collapse: collapse;
}
TABLE.tag_list>THEAD {
display: none;
}
TABLE.tag_list>TBODY>TR>TD {
display: inline;
padding: 0;
line-height: 1em;
}
TABLE.tag_list>TBODY>TR>TD:after {
content: " ";
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* specific page types *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

@ -218,6 +218,21 @@ NAV SELECT {
text-align: left;
}
TABLE.tag_list {
border-collapse: collapse;
}
TABLE.tag_list>THEAD {
display: none;
}
TABLE.tag_list>TBODY>TR>TD {
display: inline;
padding: 0;
line-height: 1em;
}
TABLE.tag_list>TBODY>TR>TD:after {
content: " ";
}
.more:after {
content: " >>>";
}

@ -1,3 +1,17 @@
.nav-card{
min-height: 3em;
}
TABLE.tag_list {
border-collapse: collapse;
}
TABLE.tag_list>THEAD {
display: none;
}
TABLE.tag_list>TBODY>TR>TD {
display: inline;
padding: 0;
line-height: 1em;
}
TABLE.tag_list>TBODY>TR>TD:after {
content: " ";
}

@ -117,6 +117,22 @@ NAV SELECT {
padding: 0px;
}
TABLE.tag_list {
width: 100%;
border-collapse: collapse;
}
TABLE.tag_list>THEAD {
display: none;
}
TABLE.tag_list>TBODY>TR>TD {
display: inline;
padding: 0;
line-height: 1em;
}
TABLE.tag_list>TBODY>TR>TD:after {
content: " ";
}
.more:after {
content: " >>>";
}

Loading…
Cancel
Save