From 734131d75053bd27fbe4f3b1292e81c4fc16abe3 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Sat, 19 Oct 2013 21:01:25 +0300 Subject: [ticket/11552] Responsive member list Responsive member list and better responsive tables PHPBB3-11552 --- phpBB/styles/prosilver/template/forum_fn.js | 66 ++++++++++++++++++++++ phpBB/styles/prosilver/template/mcp_front.html | 2 +- phpBB/styles/prosilver/template/mcp_logs.html | 2 +- .../styles/prosilver/template/mcp_warn_front.html | 4 +- phpBB/styles/prosilver/template/mcp_warn_list.html | 2 +- .../styles/prosilver/template/memberlist_body.html | 4 +- phpBB/styles/prosilver/template/search_body.html | 2 +- 7 files changed, 74 insertions(+), 8 deletions(-) (limited to 'phpBB/styles/prosilver/template') diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index a6cb378246..97f99a5e52 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -533,6 +533,72 @@ function insert_single_user(formId, user) $(window).resize(check); }); + // Responsive tables + $('table.table1').not('.not-responsive').each(function() { + var $this = $(this), + th = $this.find('thead > tr > th'), + columns = th.length, + headers = [], + totalHeaders = 0, + i, headersLength; + + // Find each header + th.each(function() { + var cell = $(this), + colspan = parseInt(cell.attr('colspan')), + dfn = cell.attr('data-dfn'), + text = dfn ? dfn : cell.text(); + + colspan = isNaN(colspan) || colspan < 1 ? 1 : colspan; + + for (i=0; i + $this.addClass('responsive'); + + if (totalHeaders < 2) { + $this.addClass('show-header'); + return; + } + + $this.find('tbody > tr').each(function() { + var row = $(this), + cells = row.children('td'), + column = 0; + + if (cells.length == 1) { + row.addClass('big-column'); + return; + } + + cells.each(function() { + var cell = $(this), + colspan = parseInt(cell.attr('colspan')), + text = cell.text().trim(); + + if (headersLength <= column) { + return; + } + + if (text.length && text !== '-') { + cell.prepend('' + headers[column] + ''); + } + else { + cell.addClass('empty'); + } + + colspan = isNaN(colspan) || colspan < 1 ? 1 : colspan; + column += colspan; + }); + }); + }); + // Responsive link lists $('.linklist:not(.navlinks, .skip-responsive)').each(function() { var $this = $(this), diff --git a/phpBB/styles/prosilver/template/mcp_front.html b/phpBB/styles/prosilver/template/mcp_front.html index fd224f80bc..402cfe029a 100644 --- a/phpBB/styles/prosilver/template/mcp_front.html +++ b/phpBB/styles/prosilver/template/mcp_front.html @@ -147,7 +147,7 @@

{L_LATEST_LOGS}

- +
diff --git a/phpBB/styles/prosilver/template/mcp_logs.html b/phpBB/styles/prosilver/template/mcp_logs.html index 658e8cf97f..492c8cf201 100644 --- a/phpBB/styles/prosilver/template/mcp_logs.html +++ b/phpBB/styles/prosilver/template/mcp_logs.html @@ -21,7 +21,7 @@ -
{L_ACTION}
+
diff --git a/phpBB/styles/prosilver/template/mcp_warn_front.html b/phpBB/styles/prosilver/template/mcp_warn_front.html index 1ede323720..5a332cf202 100644 --- a/phpBB/styles/prosilver/template/mcp_warn_front.html +++ b/phpBB/styles/prosilver/template/mcp_warn_front.html @@ -33,7 +33,7 @@

{L_MOST_WARNINGS}

-
{L_USERNAME}
+
@@ -67,7 +67,7 @@

{L_LATEST_WARNINGS}

-
{L_USERNAME}
+
diff --git a/phpBB/styles/prosilver/template/mcp_warn_list.html b/phpBB/styles/prosilver/template/mcp_warn_list.html index 61e449b5b5..cdf2aecc0e 100644 --- a/phpBB/styles/prosilver/template/mcp_warn_list.html +++ b/phpBB/styles/prosilver/template/mcp_warn_list.html @@ -21,7 +21,7 @@ -
{L_USERNAME}
+
diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html index 46b35eae2c..f4190d7931 100644 --- a/phpBB/styles/prosilver/template/memberlist_body.html +++ b/phpBB/styles/prosilver/template/memberlist_body.html @@ -28,7 +28,7 @@
-
{L_USERNAME}
- + diff --git a/phpBB/styles/prosilver/template/search_body.html b/phpBB/styles/prosilver/template/search_body.html index d4c1f98a2a..7229e5a5dc 100644 --- a/phpBB/styles/prosilver/template/search_body.html +++ b/phpBB/styles/prosilver/template/search_body.html @@ -105,7 +105,7 @@ - + -- cgit v1.2.1
{L_RANK}{L_GROUP_LEADER}{L_USERNAME}{L_RANK}{L_GROUP_LEADER}{L_USERNAME} {L_POSTS} {L_WEBSITE}{L_COMMA_SEPARATOR}{L_LOCATION} {L_JOINED}
{recentsearch.KEYWORDS} {recentsearch.TIME}{recentsearch.TIME}