[ticket/11957] Responsive styles list

PHPBB3-11957
This commit is contained in:
Vjacheslav Trushkin 2013-10-26 11:56:03 +03:00
parent 7b3f63e8a3
commit 49e30b1243
3 changed files with 31 additions and 6 deletions

View file

@ -79,7 +79,7 @@
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF .styles_list --> <!-- IF .styles_list -->
<table cellspacing="1"> <table cellspacing="1" class="styles">
<thead> <thead>
<tr> <tr>
<th>{L_STYLE_NAME}</th> <th>{L_STYLE_NAME}</th>
@ -97,9 +97,9 @@
<!-- ELSE --> <!-- ELSE -->
<!-- IF $ROW_CLASS == 'row2a' --><!-- DEFINE $ROW_CLASS = 'row2b' --><!-- ELSE --><!-- DEFINE $ROW_CLASS = 'row2a' --><!-- ENDIF --> <!-- IF $ROW_CLASS == 'row2a' --><!-- DEFINE $ROW_CLASS = 'row2b' --><!-- ELSE --><!-- DEFINE $ROW_CLASS = 'row2a' --><!-- ENDIF -->
<!-- ENDIF --> <!-- ENDIF -->
<td class="{$ROW_CLASS}" style="padding-left: {styles_list.PADDING}px;"> <td class="{$ROW_CLASS}" style="padding-{S_CONTENT_FLOW_BEGIN}: {styles_list.PADDING}px;">
<!-- IF styles_list.STYLE_ID and styles_list.COMMENT == '' and styles_list.STYLE_ACTIVE --> <!-- IF styles_list.STYLE_ID and styles_list.COMMENT == '' and styles_list.STYLE_ACTIVE -->
<div class="default-style" style="display: none; float: right;"> <div class="default-style" style="display: none; float: {S_CONTENT_FLOW_END};">
<input class="radio" type="radio" name="default" value="{styles_list.STYLE_ID}"<!-- IF styles_list.DEFAULT --> checked="checked"<!-- ELSE --><!-- DEFINE $S_DEFAULT = 1 --><!-- ENDIF --> title="{L_STYLE_DEFAULT}" /> <input class="radio" type="radio" name="default" value="{styles_list.STYLE_ID}"<!-- IF styles_list.DEFAULT --> checked="checked"<!-- ELSE --><!-- DEFINE $S_DEFAULT = 1 --><!-- ENDIF --> title="{L_STYLE_DEFAULT}" />
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
@ -117,9 +117,9 @@
<!-- ENDIF --> <!-- ENDIF -->
</td> </td>
<!-- IF not STYLES_LIST_HIDE_COUNT --> <!-- IF not STYLES_LIST_HIDE_COUNT -->
<td class="{$ROW_CLASS}" style="text-align: center;">{styles_list.USERS}</td> <td class="{$ROW_CLASS} users">{styles_list.USERS}</td>
<!-- ENDIF --> <!-- ENDIF -->
<td class="{$ROW_CLASS}" style="text-align: center;"> <td class="{$ROW_CLASS} actions">
<!-- BEGIN actions --> <!-- BEGIN actions -->
<!-- IF styles_list.actions.S_ROW_COUNT > 0 --> | <!-- ENDIF --> <!-- IF styles_list.actions.S_ROW_COUNT > 0 --> | <!-- ENDIF -->
<!-- IF styles_list.actions.U_ACTION --> <!-- IF styles_list.actions.U_ACTION -->
@ -129,7 +129,7 @@
<!-- END actions --> <!-- END actions -->
</td> </td>
{styles_list.EXTRA} {styles_list.EXTRA}
<td class="{$ROW_CLASS}" width="20" style="text-align: center;"> <td class="{$ROW_CLASS} mark" width="20">
<!-- IF styles_list.STYLE_ID --> <!-- IF styles_list.STYLE_ID -->
<input class="checkbox" type="checkbox" name="ids[]" value="{styles_list.STYLE_ID}" /> <input class="checkbox" type="checkbox" name="ids[]" value="{styles_list.STYLE_ID}" />
<!-- ELSE --> <!-- ELSE -->

View file

@ -763,6 +763,11 @@ table.forums td.actions {
white-space: nowrap; white-space: nowrap;
} }
/* Styles list */
table.styles td.users, table.styles td.actions, table.styles td.mark {
text-align: center;
}
@media only screen and (max-width: 700px), only screen and (max-device-width: 700px) @media only screen and (max-width: 700px), only screen and (max-device-width: 700px)
{ {
table.responsive, table.responsive tbody, table.responsive tr, table.responsive td { table.responsive, table.responsive tbody, table.responsive tr, table.responsive td {
@ -889,6 +894,16 @@ table.forums td.actions {
.rtl table.responsive.forums td.actions { .rtl table.responsive.forums td.actions {
text-align: left !important; text-align: left !important;
} }
/* Styles list */
table.responsive.styles tr.responsive-style-row td:first-child {
padding-left: 4px !important;
padding-right: 4px !important;
}
table.responsive.styles td:first-child > dfn, table.responsive.styles td.actions > dfn {
display: none !important;
}
} }
/* General form styles /* General form styles

View file

@ -54,6 +54,16 @@ function parse_document(container)
$this.find('td:nth-child(' + (i + 1) + ')').addClass(column.prop('className')); $this.find('td:nth-child(' + (i + 1) + ')').addClass(column.prop('className'));
}); });
// Styles table
if ($this.hasClass('styles')) {
$this.find('td:first-child[style]').each(function() {
var style = $(this).attr('style');
if (style.length) {
$(this).parent('tr').attr('style', style.toLowerCase().replace('padding', 'margin')).addClass('responsive-style-row');
}
});
}
// Find each header // Find each header
if (!$this.data('no-responsive-header')) if (!$this.data('no-responsive-header'))
{ {