f1320cca by Kevin Burton

updating styling on merge users

1 parent 9833e4db
......@@ -475,3 +475,5 @@ input.dp-applied {
.cbv-report-list tbody tr.odd td { background-color: #f5f5f5; }
.cbv-report-list thead th { background-color: #e1e1e1;border-bottom:1px solid #e8e8e8; }
.cbv-report-list tbody td { border-bottom:1px solid #e8e8e8; min-width: 120px;}
#user-list-from { display: block; }
......
......@@ -1012,7 +1012,7 @@ class Actions {
}
// Initialize
$html = '<table><thead><tr><th>First Name</th><th>Last Name</th><th>Member ID</th><th>Email</th></tr></thead><tbody>';
$html = '<table cellspacing="0" class="widefat post fixed merge-table" width="100%"><thead><tr><th>First Name</th><th>Last Name</th><th>Member ID</th><th>Email</th></tr></thead><tbody>';
$i = 0;
// Check for search term in first_name, last_name, user_login, and user_email, but only if user status is not 'terminated'
......@@ -1044,7 +1044,7 @@ class Actions {
$html .= <<<HTML
<tr>
<td><input type="radio" name="merge_user_{$direction}" value="{$user['ID']}" />{$user['first_name']}</td>
<td><input type="radio" name="merge_user_{$direction}" value="{$user['ID']}" />&nbsp;{$user['first_name']}</td>
<td>{$user['last_name']}</td>
<td>{$user['member_id']}</td>
<td>{$user['user_email']}</td>
......@@ -1152,7 +1152,7 @@ HTML;
update_user_meta($to_user->ID, $key, $val);
// Build a table of data
$html .= "\n\t<tr><td>$key: $val</td></tr>";
$html .= "\n\t<tr><td width='150'>$key</td><td>$val</td></tr>";
}
if (! empty($from_user->user_email)) {
// Transfer old user's profile preference email address (work, home, etc.) to new user's user_email field
......@@ -1173,7 +1173,7 @@ HTML;
update_user_meta($from_user->ID, 'merged_to', $to_user->ID);
update_user_meta($from_user->ID, 'datetime_merged', time());
$html = '<thead><tr><th>Changed:</th></tr></thead><tbody>' .
$html = '<thead><tr><th colspan="2">Merge successful. Here are all the changes:</th></tr></thead><tbody>' .
$html .
'</tbody>';
......
......@@ -54,10 +54,7 @@ h4 {
}
.changed {
float: left;
width: 250px;
margin-top: 5px;
border: 1px solid green;
clear: both;
display: none;
}
......@@ -99,8 +96,8 @@ h4 {
<table cellspacing="0" class="widefat post fixed merge-table">
<thead>
<tr>
<th><label for="search_user_from">Merge <strong><em>FROM</em></strong> User:</label></th>
<th><label for="search_user_to">Merge <strong><em>TO</em></strong> User:</label></th>
<th width="50%"><label for="search_user_from">Merge <strong><em>FROM</em></strong> User:</label></th>
<th width="50%"><label for="search_user_to">Merge <strong><em>TO</em></strong> User:</label></th>
</tr>
</thead>
<tbody>
......@@ -108,24 +105,26 @@ h4 {
<td>
<div class="merge-users">
<input class="clear" type="text" name="search_user_from" value="<?php echo $_POST['search_user_from'] ?>" />
<input type="button" name="btn_user_from" value="Search" />
<div id="user-list-from"></div>
<input type="button" name="btn_user_from" value="Search" />&nbsp;<img id="search_user_from_spinner" class="spinners" src="/wp-content/tz-tools/com/Branding/images/spinner.gif" style="display:none;" />
</div>
</td>
<td>
<div class="merge-users">
<input class="clear" type="text" name="search_user_to" value="<?php echo $_POST['search_user_to'] ?>" />
<input type="button" name="btn_user_to" value="Search" />
<div id="user-list-to"></div>
<input type="button" name="btn_user_to" value="Search" />&nbsp;<img id="search_user_to_spinner" class="spinners" src="/wp-content/tz-tools/com/Branding/images/spinner.gif" style="display:none;" />
</div>
</td>
</tr>
<tr>
<td><div id="user-list-from"></div></td>
<td><div id="user-list-to"></div></td>
</tr>
</tbody>
</table>
<div id="field-list" class="changed">
<h6>Success!</h6>
<table></table>
<table cellspacing="0" class="widefat post fixed merge-table"></table>
</div>
<div style="clear:both;"></div>
......@@ -153,14 +152,18 @@ var $form = $('#admin-search-merge-form');
var $field_list = $('#field-list');
var $error_container = $('.validation-errors');
var $from_spinner = $('#search_user_from_spinner');
var $to_spinner = $('#search_user_to_spinner');
$('[name=btn_user_from]').click(function() {
$from_spinner.show();
$which_user_search.val("from");
$do_search.val("yes");
$form.submit();
});
$('[name=btn_user_to]').click(function() {
$to_spinner.show();
$which_user_search.val("to");
$do_search.val("yes");
$form.submit();
......@@ -183,6 +186,7 @@ $(function() {
type: 'post',
data: ({ajax:"yes", action: 'admin_search_merge_users'}),
success: function(data) {
$('.spinners').hide();
if (data.success == "false") {
$('h6', $error_container).html("OOPS...");
$('ul', $error_container).html(data.msg);
......