Implement friendly names across entire project scope.

This commit is contained in:
Tim 2015-06-29 21:53:41 +02:00
parent e7b305a1d5
commit 6f7194593b
8 changed files with 121 additions and 66 deletions

View file

@ -30,7 +30,7 @@ from plexpy import helpers
<tr>
<th class="never" align='left' id="id">ID</th>
<th class="all" align='left' id="time">Time</th>
<th class="all" align='left' id="user">User</th>
<th class="all" align='left' id="friendly_name">User</th>
<th class="desktop" align='left' id="platform">Platform</th>
<th class="desktop" align='left' id="ip_address">IP Address</th>
<th class="min-tablet" align='left' id="title">Title</th>
@ -41,6 +41,7 @@ from plexpy import helpers
<th class="desktop" align='left' id="percent_complete">Completed</th>
<th class="never" align='left' id="rating_key">RatingKey</th>
<th class="never" align='left' id="xml"></th>
<th class="never" align='left' id="user"></th>
</tr>
</thead>
<tbody>

View file

@ -189,7 +189,7 @@ from plexpy import helpers
<tr>
<th class="never" align='left' id="id">ID</th>
<th class="all" align='left' id="time">Time</th>
<th class="all" align='left' id="user">User</th>
<th class="all" align='left' id="friendly_name">User</th>
<th class="desktop" align='left' id="platform">Platform</th>
<th class="desktop" align='left' id="ip_address">IP Address</th>
<th class="min-tablet" align='left' id="title">Title</th>
@ -200,6 +200,7 @@ from plexpy import helpers
<th class="desktop" align='left' id="percent_complete">Completed</th>
<th class="never" align='left' id="rating_key">RatingKey</th>
<th class="never" align='left' id="xml"></th>
<th class="never" align='left' id="user"></th>
</tr>
</thead>
<tbody>

View file

@ -53,10 +53,10 @@ history_table_options = {
},
{
"targets": [2],
"data":"user",
"data":"friendly_name",
"createdCell": function (td, cellData, rowData, row, col) {
if (cellData !== '') {
$(td).html('<a href="user?user=' + cellData + '">' + cellData + '</a>');
$(td).html('<a href="user?user=' + rowData['user'] + '">' + cellData + '</a>');
} else {
$(td).html(cellData);
}
@ -162,7 +162,14 @@ history_table_options = {
"data":"xml",
"searchable":false,
"visible":false
},
{
"targets": [13],
"data":"user",
"searchable":false,
"visible":false
}
],
"drawCallback": function (settings) {
// Jump to top of page
@ -187,7 +194,7 @@ $('#history_table').on('click', 'td.modal-control', function () {
function showStreamDetails() {
$.ajax({
url: 'get_stream_data',
data: {row_id: rowData['id'], user: rowData['user']},
data: {row_id: rowData['id'], user: rowData['friendly_name']},
cache: false,
async: true,
complete: function(xhr, status) {

View file

@ -18,12 +18,8 @@ users_list_table_options = {
"ajax": {
"url": "get_user_list"
},
"bLengthChange": true,
"bInfo": true,
"bAutoWidth": true,
"aaSorting": [[ 0, "asc" ]],
"bStateSave": true,
"bSortClasses": true,
"autoWidth": true,
"stateSave": true,
"sPaginationType": "bootstrap",
"columnDefs": [
{
@ -42,10 +38,10 @@ users_list_table_options = {
},
{
"targets": [1],
"data": "user",
"data": "friendly_name",
"createdCell": function (td, cellData, rowData, row, col) {
if (cellData !== '') {
$(td).html('<a href="user?user=' + cellData + '">' + cellData + '</a>');
$(td).html('<a href="user?user=' + rowData['user'] + '">' + cellData + '</a>');
} else {
$(td).html(cellData);
}
@ -66,7 +62,14 @@ users_list_table_options = {
{
"targets": [4],
"data": "plays"
},
{
"targets": [5],
"data": "user",
"searchable": false,
"visible": false
}
],
"drawCallback": function (settings) {
// Jump to top of page

View file

@ -177,7 +177,7 @@ from plexpy import helpers
<tr>
<th class="never" align='left' id="id">ID</th>
<th class="all" align='left' id="time">Time</th>
<th class="never" align='left' id="user">User</th>
<th class="never" align='left' id="friendly_name">User</th>
<th class="min-tablet" align='left' id="platform">Platform</th>
<th class="desktop" align='left' id="ip_address">IP Address</th>
<th class="min-tablet" align='left' id="title">Title</th>
@ -188,6 +188,7 @@ from plexpy import helpers
<th class="desktop" align='left' id="percent_complete">Completed</th>
<th class="never" align='left' id="rating_key">RatingKey</th>
<th class="never" align='left' id="xml"></th>
<th class="never" align='left' id="user"></th>
</tr>
</thead>
<tbody>

View file

@ -28,10 +28,11 @@ from plexpy import helpers
<thead>
<tr>
<th class="all" align="right" id="avatar"></th>
<th class="all" align="left" id="username">User</th>
<th class="all" align="left" id="friendly_name">User</th>
<th class="min-tablet" align="left" id="last_seen">Last Seen</th>
<th class="min-tablet" align="left" id="last_known_ip">Last Known IP</th>
<th class="min-tablet" align="left" id="total_plays">Total Plays</th>
<th class="never" align="left" id="user"></th>
</tr>
</thead>
<tbody>