mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-09 21:08:53 +00:00
Merge remote-tracking branch 'remotes/cyberalien/ticket/11533' into develop
# By Vjacheslav Trushkin # Via Vjacheslav Trushkin * remotes/cyberalien/ticket/11533: [ticket/11533] Update unit tests [ticket/11533] Fix colspan and unnecessary tables [ticket/11533] Change list to table for notification settings [ticket/11533] Columns counter for notification settings
This commit is contained in:
commit
bcf7ea3310
4 changed files with 149 additions and 162 deletions
|
@ -200,6 +200,10 @@ class ucp_notifications
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$template->assign_vars(array(
|
||||||
|
strtoupper($block) . '_COLS' => sizeof($notification_methods) + 2,
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -9,44 +9,35 @@
|
||||||
<p>{TITLE_EXPLAIN}</p>
|
<p>{TITLE_EXPLAIN}</p>
|
||||||
|
|
||||||
<!-- IF MODE == 'notification_options' -->
|
<!-- IF MODE == 'notification_options' -->
|
||||||
<ul class="topiclist">
|
<table class="table1" cellspacing="1">
|
||||||
<li class="header">
|
<thead>
|
||||||
<dl>
|
<th>{L_NOTIFICATION_TYPE}</th>
|
||||||
<dt>{L_NOTIFICATION_TYPE}</dt>
|
<!-- BEGIN notification_methods -->
|
||||||
<!-- BEGIN notification_methods -->
|
<th class="mark">{notification_methods.NAME}</th>
|
||||||
<dd class="mark">{notification_methods.NAME}</dd>
|
<!-- END notification_methods -->
|
||||||
<!-- END notification_methods -->
|
<th class="mark">{L_NOTIFICATIONS}</th>
|
||||||
<dd class="mark">{L_NOTIFICATIONS}</dd>
|
</thead>
|
||||||
</dl>
|
<tbody>
|
||||||
</li>
|
<!-- BEGIN notification_types -->
|
||||||
</ul>
|
<!-- IF notification_types.GROUP_NAME -->
|
||||||
<ul class="topiclist cplist">
|
<tr class="bg3">
|
||||||
|
<td colspan="{NOTIFICATION_TYPES_COLS}">{notification_types.GROUP_NAME}</td>
|
||||||
<!-- BEGIN notification_types -->
|
</tr>
|
||||||
<!-- IF notification_types.GROUP_NAME -->
|
<!-- ELSE -->
|
||||||
<li class="row bg3">
|
<tr class="<!-- IF notification_types.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
|
||||||
<dl>
|
<td>
|
||||||
<dt>
|
|
||||||
{notification_types.GROUP_NAME}
|
|
||||||
</dt>
|
|
||||||
</dl>
|
|
||||||
</li>
|
|
||||||
<!-- ELSE -->
|
|
||||||
<li class="row<!-- IF notification_types.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
|
|
||||||
<dl>
|
|
||||||
<dt>
|
|
||||||
{notification_types.NAME}
|
{notification_types.NAME}
|
||||||
<!-- IF notification_types.EXPLAIN --><br /> {notification_types.EXPLAIN}<!-- ENDIF -->
|
<!-- IF notification_types.EXPLAIN --><br /> {notification_types.EXPLAIN}<!-- ENDIF -->
|
||||||
</dt>
|
</td>
|
||||||
<!-- BEGIN notification_methods -->
|
<!-- BEGIN notification_methods -->
|
||||||
<dd class="mark"><input type="checkbox" name="{notification_types.TYPE}_{notification_methods.METHOD}"<!-- IF notification_methods.SUBSCRIBED --> checked="checked"<!-- ENDIF --> /> <dfn>{notification_methods.NAME}</dfn></dd>
|
<td class="mark"><input type="checkbox" name="{notification_types.TYPE}_{notification_methods.METHOD}"<!-- IF notification_methods.SUBSCRIBED --> checked="checked"<!-- ENDIF --> /></td>
|
||||||
<!-- END notification_methods -->
|
<!-- END notification_methods -->
|
||||||
<dd class="mark"><input type="checkbox" name="{notification_types.TYPE}_notification"<!-- IF notification_types.SUBSCRIBED --> checked="checked"<!-- ENDIF --> /> <dfn>{L_NOTIFICATIONS}</dfn></dd>
|
<td class="mark"><input type="checkbox" name="{notification_types.TYPE}_notification"<!-- IF notification_types.SUBSCRIBED --> checked="checked"<!-- ENDIF --> /></td>
|
||||||
</dl>
|
</tr>
|
||||||
</li>
|
<!-- ENDIF -->
|
||||||
<!-- ENDIF -->
|
<!-- END notification_types -->
|
||||||
<!-- END notification_types -->
|
</tbody>
|
||||||
</ul>
|
</table>
|
||||||
<!-- ELSE -->
|
<!-- ELSE -->
|
||||||
<!-- IF .notification_list -->
|
<!-- IF .notification_list -->
|
||||||
<!-- IF .pagination or TOTAL_COUNT -->
|
<!-- IF .pagination or TOTAL_COUNT -->
|
||||||
|
|
|
@ -2,145 +2,137 @@
|
||||||
|
|
||||||
<form id="ucp" method="post" action="{S_UCP_ACTION}"{S_FORM_ENCTYPE}>
|
<form id="ucp" method="post" action="{S_UCP_ACTION}"{S_FORM_ENCTYPE}>
|
||||||
|
|
||||||
<table width="100%" cellspacing="1">
|
<!-- IF MODE == 'notification_options' -->
|
||||||
|
<table width="100%" cellspacing="1">
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="4">{TITLE}</th>
|
<th colspan="{NOTIFICATION_TYPES_COLS}">{TITLE}</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" colspan="4" align="center"><span class="genmed">{TITLE_EXPLAIN}</span></td>
|
<td class="row1" colspan="{NOTIFICATION_TYPES_COLS}" align="center"><span class="genmed">{TITLE_EXPLAIN}</span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{L_NOTIFICATION_TYPE}</th>
|
||||||
|
<th width="10%">{L_NOTIFICATIONS}</th>
|
||||||
|
<!-- BEGIN notification_methods -->
|
||||||
|
<th width="10%">{notification_methods.NAME}</th>
|
||||||
|
<!-- END notification_methods -->
|
||||||
</tr>
|
</tr>
|
||||||
<!-- IF MODE == 'notification_options' -->
|
|
||||||
<tr>
|
|
||||||
<th>{L_NOTIFICATION_TYPE}</th>
|
|
||||||
<th width="10%">{L_NOTIFICATIONS}</th>
|
|
||||||
<!-- BEGIN notification_methods -->
|
|
||||||
<th width="10%">{notification_methods.NAME}</th>
|
|
||||||
<!-- END notification_methods -->
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<!-- BEGIN notification_types -->
|
<!-- BEGIN notification_types -->
|
||||||
<!-- IF notification_types.GROUP_NAME -->
|
<!-- IF notification_types.GROUP_NAME -->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row3" colspan="3">{notification_types.GROUP_NAME}</td>
|
<td class="row3" colspan="{NOTIFICATION_TYPES_COLS}">{notification_types.GROUP_NAME}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- ELSE -->
|
<!-- ELSE -->
|
||||||
<!-- IF notification_types.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
|
<!-- IF notification_types.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
|
||||||
<td>
|
<td>
|
||||||
{notification_types.NAME}
|
{notification_types.NAME}
|
||||||
<!-- IF notification_types.EXPLAIN --><br /> {notification_types.EXPLAIN}<!-- ENDIF -->
|
<!-- IF notification_types.EXPLAIN --><br /> {notification_types.EXPLAIN}<!-- ENDIF -->
|
||||||
</td>
|
</td>
|
||||||
<td align="center"><input type="checkbox" name="{notification_types.TYPE}_notification"<!-- IF notification_types.SUBSCRIBED --> checked="checked"<!-- ENDIF --> /></td>
|
<td align="center"><input type="checkbox" name="{notification_types.TYPE}_notification"<!-- IF notification_types.SUBSCRIBED --> checked="checked"<!-- ENDIF --> /></td>
|
||||||
<!-- BEGIN notification_methods -->
|
<!-- BEGIN notification_methods -->
|
||||||
<td align="center"><input type="checkbox" name="{notification_types.TYPE}_{notification_methods.METHOD}"<!-- IF notification_methods.SUBSCRIBED --> checked="checked"<!-- ENDIF --> /></td>
|
<td align="center"><input type="checkbox" name="{notification_types.TYPE}_{notification_methods.METHOD}"<!-- IF notification_methods.SUBSCRIBED --> checked="checked"<!-- ENDIF --> /></td>
|
||||||
<!-- END notification_methods -->
|
<!-- END notification_methods -->
|
||||||
</tr>
|
</tr>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<!-- END notification_types -->
|
<!-- END notification_types -->
|
||||||
|
<tr>
|
||||||
|
<td class="cat" colspan="{NOTIFICATION_TYPES_COLS}" align="center">
|
||||||
|
<input type="hidden" name="form_time" value="{FORM_TIME}" />
|
||||||
|
{S_HIDDEN_FIELDS}
|
||||||
|
<input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" />
|
||||||
|
<input class="btnlite" type="reset" value="{L_RESET}" name="reset" />
|
||||||
|
{S_FORM_TOKEN}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<!-- ELSE -->
|
||||||
|
<table class="tablebg" width="100%" cellspacing="1" cellpadding="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="cat" colspan="3" align="center">
|
<td class="row1">
|
||||||
<input type="hidden" name="form_time" value="{FORM_TIME}" />
|
<table border="0" cellspacing="0" cellpadding="0" width="100%">
|
||||||
{S_HIDDEN_FIELDS}
|
|
||||||
<input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" />
|
|
||||||
<input class="btnlite" type="reset" value="{L_RESET}" name="reset" />
|
|
||||||
{S_FORM_TOKEN}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<!-- ELSE -->
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<table class="tablebg" width="100%" cellspacing="1" cellpadding="0">
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1">
|
<td align="{S_CONTENT_FLOW_BEGIN}">
|
||||||
<table border="0" cellspacing="0" cellpadding="0" width="100%">
|
<!-- IF TOTAL_COUNT -->
|
||||||
<tr>
|
<table width="100%" cellspacing="1">
|
||||||
<td align="{S_CONTENT_FLOW_BEGIN}">
|
<tr>
|
||||||
<!-- IF TOTAL_COUNT -->
|
<td class="nav" valign="middle" nowrap="nowrap"> {PAGE_NUMBER}</td>
|
||||||
<table width="100%" cellspacing="1">
|
<td class="gensmall" nowrap="nowrap" width="100%"> [ <b>{TOTAL_COUNT}</b> ] </td>
|
||||||
<tr>
|
|
||||||
<td class="nav" valign="middle" nowrap="nowrap"> {PAGE_NUMBER}</td>
|
|
||||||
<td class="gensmall" nowrap="nowrap" width="100%"> [ <b>{TOTAL_COUNT}</b> ] </td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<!-- ENDIF -->
|
|
||||||
</td>
|
|
||||||
<td align="{S_CONTENT_FLOW_END}"><!-- INCLUDE pagination.html --></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<div style="padding: 2px;"></div>
|
|
||||||
|
|
||||||
<div class="notification_list">
|
|
||||||
<table class="tablebg" width="100%" cellspacing="1">
|
|
||||||
<tr>
|
|
||||||
<td class="cat" colspan="3">
|
|
||||||
<table width="100%" cellspacing="0">
|
|
||||||
<tr class="nav">
|
|
||||||
<td align="{S_CONTENT_FLOW_END}" valign="middle"><!-- IF U_MARK_ALL --><a href="{U_MARK_ALL}">{L_NOTIFICATIONS_MARK_ALL_READ}</a><!-- ENDIF --></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
<!-- ENDIF -->
|
||||||
</tr>
|
</td>
|
||||||
<tr>
|
<td align="{S_CONTENT_FLOW_END}"><!-- INCLUDE pagination.html --></td>
|
||||||
<th colspan="2">{L_NOTIFICATIONS}</th>
|
</tr>
|
||||||
<th width="15%">{L_MARK_READ}</th>
|
</table>
|
||||||
</tr>
|
|
||||||
<!-- BEGIN notification_list -->
|
|
||||||
<tr class="row<!-- IF notification_list.UNREAD -->3<!-- ELSEIF notification_list.S_ROW_COUNT is even -->1<!-- ELSE -->2<!-- ENDIF -->">
|
|
||||||
<!-- IF notification_list.AVATAR -->
|
|
||||||
<td width="50px">
|
|
||||||
{notification_list.AVATAR}
|
|
||||||
</td>
|
|
||||||
<td valign="top">
|
|
||||||
<!-- ELSE -->
|
|
||||||
<td colspan="2" valign="top" height="50px">
|
|
||||||
<!-- ENDIF -->
|
|
||||||
<span class="gen">
|
|
||||||
<!-- IF notification_list.URL --><a href="<!-- IF notification_list.UNREAD -->{notification_list.U_MARK_READ}<!-- ELSE -->{notification_list.URL}<!-- ENDIF -->"><!-- ENDIF -->
|
|
||||||
<strong>{notification_list.FORMATTED_TITLE}</strong>
|
|
||||||
<!-- IF notification_list.URL --></a><!-- ENDIF --><br />
|
|
||||||
» {notification_list.TIME}
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
<td align="center">
|
|
||||||
<!-- IF notification_list.UNREAD --><input type="checkbox" name="mark[]" value="{notification_list.NOTIFICATION_ID}" /><!-- ENDIF -->
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<!-- END notification_list -->
|
|
||||||
<tr>
|
|
||||||
<td class="cat" colspan="3" align="center">
|
|
||||||
<input type="hidden" name="form_time" value="{FORM_TIME}" />
|
|
||||||
{S_HIDDEN_FIELDS}
|
|
||||||
<input class="btnmain" type="submit" name="submit" value="{L_MARK_READ}" />
|
|
||||||
{S_FORM_TOKEN}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div style="padding: 2px;"></div>
|
|
||||||
|
|
||||||
<!-- IF .pagination -->
|
|
||||||
<table class="tablebg" width="100%" cellspacing="1" cellpadding="0">
|
|
||||||
<tr>
|
|
||||||
<td class="row1">
|
|
||||||
<table border="0" cellspacing="0" cellpadding="0" width="100%">
|
|
||||||
<tr>
|
|
||||||
<td align="{S_CONTENT_FLOW_BEGIN}">
|
|
||||||
<!-- INCLUDE pagination.html -->
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<!-- ENDIF -->
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<div class="notification_list">
|
||||||
|
<table class="tablebg" width="100%" cellspacing="1">
|
||||||
|
<tr>
|
||||||
|
<td class="cat" colspan="3">
|
||||||
|
<table width="100%" cellspacing="0">
|
||||||
|
<tr class="nav">
|
||||||
|
<td align="{S_CONTENT_FLOW_END}" valign="middle"><!-- IF U_MARK_ALL --><a href="{U_MARK_ALL}">{L_NOTIFICATIONS_MARK_ALL_READ}</a><!-- ENDIF --></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th colspan="2">{L_NOTIFICATIONS}</th>
|
||||||
|
<th width="15%">{L_MARK_READ}</th>
|
||||||
|
</tr>
|
||||||
|
<!-- BEGIN notification_list -->
|
||||||
|
<tr class="row<!-- IF notification_list.UNREAD -->3<!-- ELSEIF notification_list.S_ROW_COUNT is even -->1<!-- ELSE -->2<!-- ENDIF -->">
|
||||||
|
<!-- IF notification_list.AVATAR -->
|
||||||
|
<td width="50px">
|
||||||
|
{notification_list.AVATAR}
|
||||||
|
</td>
|
||||||
|
<td valign="top">
|
||||||
|
<!-- ELSE -->
|
||||||
|
<td colspan="2" valign="top" height="50px">
|
||||||
|
<!-- ENDIF -->
|
||||||
|
<span class="gen">
|
||||||
|
<!-- IF notification_list.URL --><a href="<!-- IF notification_list.UNREAD -->{notification_list.U_MARK_READ}<!-- ELSE -->{notification_list.URL}<!-- ENDIF -->"><!-- ENDIF -->
|
||||||
|
<strong>{notification_list.FORMATTED_TITLE}</strong>
|
||||||
|
<!-- IF notification_list.URL --></a><!-- ENDIF --><br />
|
||||||
|
» {notification_list.TIME}
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
|
<!-- IF notification_list.UNREAD --><input type="checkbox" name="mark[]" value="{notification_list.NOTIFICATION_ID}" /><!-- ENDIF -->
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<!-- END notification_list -->
|
||||||
|
<tr>
|
||||||
|
<td class="cat" colspan="3" align="center">
|
||||||
|
<input type="hidden" name="form_time" value="{FORM_TIME}" />
|
||||||
|
{S_HIDDEN_FIELDS}
|
||||||
|
<input class="btnmain" type="submit" name="submit" value="{L_MARK_READ}" />
|
||||||
|
{S_FORM_TOKEN}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- IF .pagination -->
|
||||||
|
<table class="tablebg" width="100%" cellspacing="1" cellpadding="0">
|
||||||
|
<tr>
|
||||||
|
<td class="row1">
|
||||||
|
<table border="0" cellspacing="0" cellpadding="0" width="100%">
|
||||||
|
<tr>
|
||||||
|
<td align="{S_CONTENT_FLOW_BEGIN}">
|
||||||
|
<!-- INCLUDE pagination.html -->
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
</table>
|
<!-- ENDIF -->
|
||||||
|
|
||||||
<!-- IF .notifications -->
|
<!-- IF .notifications -->
|
||||||
<div class="gensmall" style="float: {S_CONTENT_FLOW_END}; padding-top: 2px;"><b><a href="#" onclick="$('#ucp input:checkbox').attr('checked', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="$('#ucp input:checkbox').attr('checked', false); return false;">{L_UNMARK_ALL}</a></b></div>
|
<div class="gensmall" style="float: {S_CONTENT_FLOW_END}; padding-top: 2px;"><b><a href="#" onclick="$('#ucp input:checkbox').attr('checked', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="$('#ucp input:checkbox').attr('checked', false); return false;">{L_UNMARK_ALL}</a></b></div>
|
||||||
|
|
|
@ -43,7 +43,7 @@ class phpbb_functional_notification_test extends phpbb_functional_test_case
|
||||||
$crawler = $this->request('GET', 'ucp.php?i=ucp_notifications&mode=notification_options');
|
$crawler = $this->request('GET', 'ucp.php?i=ucp_notifications&mode=notification_options');
|
||||||
$this->assert_response_success();
|
$this->assert_response_success();
|
||||||
|
|
||||||
$cplist = $crawler->filter('.cplist');
|
$cplist = $crawler->filter('.table1');
|
||||||
if ($expected_status)
|
if ($expected_status)
|
||||||
{
|
{
|
||||||
$this->assert_checkbox_is_checked($cplist, $checkbox_name);
|
$this->assert_checkbox_is_checked($cplist, $checkbox_name);
|
||||||
|
|
Loading…
Add table
Reference in a new issue