Strip whitespace before sending newsletters

This commit is contained in:
JonnyWong16 2018-05-11 19:18:05 -07:00
commit 85772cdd83
3 changed files with 636 additions and 869 deletions

View file

@ -68,17 +68,14 @@
width: 100%; width: 100%;
} }
/* Set a max-width, and make it display as block so it will automatically stretch to that width, but will also shrink down on a phone or something */
.container { .container {
display: block; display: block;
margin: 0 auto !important; margin: 0 auto !important;
/* makes it centered */
max-width: 1042px; max-width: 1042px;
padding: 10px; padding: 10px;
width: 1042px; width: 1042px;
} }
/* This should also be a block element, so that it will fill 100% of the .container */
.content { .content {
box-sizing: border-box; box-sizing: border-box;
display: block; display: block;
@ -172,88 +169,9 @@
text-decoration: underline; text-decoration: underline;
} }
/* -------------------------------------
BUTTONS
------------------------------------- */
.btn {
box-sizing: border-box;
width: 100%;
}
.btn > tbody > tr > td {
padding-bottom: 15px;
}
.btn table {
width: auto;
}
.btn table td {
background-color: #ffffff;
border-radius: 5px;
text-align: center;
}
.btn a {
background-color: #ffffff;
border: solid 1px #3498db;
border-radius: 5px;
box-sizing: border-box;
color: #3498db;
cursor: pointer;
display: inline-block;
font-size: 14px;
font-weight: bold;
margin: 0;
padding: 12px 25px;
text-decoration: none;
text-transform: capitalize;
}
.btn-primary table td {
background-color: #3498db;
}
.btn-primary a {
background-color: #3498db;
border-color: #3498db;
color: #ffffff;
}
/* ------------------------------------- /* -------------------------------------
OTHER STYLES THAT MIGHT BE USEFUL OTHER STYLES THAT MIGHT BE USEFUL
------------------------------------- */ ------------------------------------- */
.last {
margin-bottom: 0;
}
.first {
margin-top: 0;
}
.align-center {
text-align: center;
}
.align-right {
text-align: right;
}
.align-left {
text-align: left;
}
.clear {
clear: both;
}
.mt0 {
margin-top: 0;
}
.mb0 {
margin-bottom: 0;
}
.mb5 { .mb5 {
margin-bottom: 5px; margin-bottom: 5px;
} }
@ -263,9 +181,6 @@
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
} }
.clear {
clear: both;
}
.preheader { .preheader {
color: transparent; color: transparent;
@ -324,6 +239,7 @@
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
/* ------------------------------------- /* -------------------------------------
MEDIA SECTIONS MEDIA SECTIONS
------------------------------------- */ ------------------------------------- */
@ -378,6 +294,7 @@
font-size: 20px; font-size: 20px;
text-transform: uppercase; text-transform: uppercase;
} }
/* ------------------------------------- /* -------------------------------------
MEDIA CARDS MEDIA CARDS
------------------------------------- */ ------------------------------------- */
@ -480,21 +397,21 @@
padding-left: 5px; padding-left: 5px;
} }
.card-info-footer .badge-container { .card-info-footer .badge-container {
max-width: 265px; max-width: 260px;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.card-info-footer .star-rating-container { .card-info-footer .star-rating-container {
width: 60px; width: 65px;
vertical-align: bottom;
padding-right: 5px;
} }
.card-info-footer .star-rating { .card-info-footer .star-rating {
margin-left: 4px;
font-size: 0.8rem; font-size: 0.8rem;
line-height: 1rem; line-height: 1rem;
width: 0.5rem; width: 0.5rem;
display: inline-block; display: inline-block;
vertical-align: bottom;
} }
.star-rating.full { .star-rating.full {
color: #E5A00D; color: #E5A00D;
@ -505,6 +422,7 @@
.badge { .badge {
display: inline-block; display: inline-block;
min-width: 10px; min-width: 10px;
margin-right: 4px;
padding: 3px 7px; padding: 3px 7px;
font-size: 11px; font-size: 11px;
line-height: 1; line-height: 1;
@ -609,20 +527,11 @@
line-height: inherit !important; line-height: inherit !important;
text-decoration: none !important; text-decoration: none !important;
} }
.btn-primary table td:hover {
background-color: #34495e !important;
}
.btn-primary a:hover {
background-color: #34495e !important;
border-color: #34495e !important;
}
} }
</style> </style>
</head> </head>
<body class=""> <body>
% if preview and service and service != 'self-hosted': % if preview and service and service != 'self-hosted':
<div class="local-preview-note"><p>Note: Local preview images only - images will be uploaded to ${service.capitalize()} when the newsletter is sent.</p></div> <!-- IGNORE SAVE --> <div class="local-preview-note"><p>Note: Local preview images only - images will be uploaded to ${service.capitalize()} when the newsletter is sent.</p></div> <!-- IGNORE SAVE -->
% elif preview and not service: % elif preview and not service:
@ -632,19 +541,13 @@
<tr> <tr>
<td class="container"> <td class="container">
<div class="content"> <div class="content">
<!-- START CENTERED WHITE CONTAINER -->
<span class="preheader">Tautulli Newsletter - ${subject}</span> <span class="preheader">Tautulli Newsletter - ${subject}</span>
% if base_url and not preview: % if base_url and not preview:
<div class="view-full"> <!-- IGNORE SAVE --> <div class="view-full"> <!-- IGNORE SAVE -->
<a href="${base_url + uuid}" title="View full newsletter" target="_blank">Click here to view the full newsletter.</a> <!-- IGNORE SAVE --> <a href="${base_url + uuid}" title="View full newsletter" target="_blank">Click here to view the full newsletter.</a> <!-- IGNORE SAVE -->
</div> <!-- IGNORE SAVE --> </div> <!-- IGNORE SAVE -->
% endif % endif
<table border="0" cellpadding="3" cellspacing="0" class="main"> <table border="0" cellpadding="3" cellspacing="0" class="main">
<!-- START MAIN CONTENT AREA -->
<tr> <tr>
<td class="wrapper"> <td class="wrapper">
<div class="header"> <div class="header">
@ -654,7 +557,6 @@
<div class="dates">${parameters['start_date']} - ${parameters['end_date']}</div> <div class="dates">${parameters['start_date']} - ${parameters['end_date']}</div>
</td> </td>
</tr> </tr>
% if message: % if message:
<tr> <tr>
<td class="wrapper"> <td class="wrapper">
@ -663,7 +565,6 @@
</td> </td>
</tr> </tr>
% endif % endif
% if recently_added.get('movie'): % if recently_added.get('movie'):
<tr> <tr>
<td class="wrapper"> <td class="wrapper">
@ -679,12 +580,10 @@
<tr> <tr>
<td> <td>
<table border="0" cellpadding="0" cellspacing="0"> <table border="0" cellpadding="0" cellspacing="0">
<tbody>
% for movie_a, movie_b in grouper(recently_added['movie'], 2): % for movie_a, movie_b in grouper(recently_added['movie'], 2):
<tr> <tr>
<td> <td>
<table border="0" cellpadding="0" cellspacing="0" width="100%"> <table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr> <tr>
% for movie in (movie_a, movie_b): % for movie in (movie_a, movie_b):
% if movie: % if movie:
@ -693,11 +592,9 @@
% endif % endif
<td align="center" valign="top" class="card-instance movie"> <td align="center" valign="top" class="card-instance movie">
<table border="0" cellpadding="0" cellspacing="3" width="100%" class="card-background" style="background-image: url(${(base_url_image + movie['art_hash']) if base_url_image else movie['art_url']});"> <table border="0" cellpadding="0" cellspacing="3" width="100%" class="card-background" style="background-image: url(${(base_url_image + movie['art_hash']) if base_url_image else movie['art_url']});">
<tbody>
<tr> <tr>
<td class="card-poster-container"> <td class="card-poster-container">
<table border="0" cellpadding="0" cellspacing="0" class="card-poster" style="background-image: url(${(base_url_image + movie['thumb_hash']) if base_url_image else movie['poster_url']})"> <table border="0" cellpadding="0" cellspacing="0" class="card-poster" style="background-image: url(${(base_url_image + movie['thumb_hash']) if base_url_image else movie['poster_url']})">
<tbody>
<tr> <tr>
<td> <td>
<a href="${parameters['pms_web_url']}#!/server/${parameters['pms_identifier']}/details?key=%2Flibrary%2Fmetadata%2F${movie['rating_key']}" title="${movie['title']}" target="_blank"> <a href="${parameters['pms_web_url']}#!/server/${parameters['pms_identifier']}/details?key=%2Flibrary%2Fmetadata%2F${movie['rating_key']}" title="${movie['title']}" target="_blank">
@ -705,12 +602,10 @@
</a> </a>
</td> </td>
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
<td class="card-info-container"> <td class="card-info-container">
<table border="0" cellpadding="0" cellspacing="0" class="card-info-container-table"> <table border="0" cellpadding="0" cellspacing="0" class="card-info-container-table">
<tbody>
<tr> <tr>
<td class="card-info-title nowrap"> <td class="card-info-title nowrap">
<a href="${parameters['pms_web_url']}#!/server/${parameters['pms_identifier']}/details?key=%2Flibrary%2Fmetadata%2F${movie['rating_key']}" title="${movie['title']}" target="_blank">${movie['title']}</a> <a href="${parameters['pms_web_url']}#!/server/${parameters['pms_identifier']}/details?key=%2Flibrary%2Fmetadata%2F${movie['rating_key']}" title="${movie['title']}" target="_blank">${movie['title']}</a>
@ -731,43 +626,47 @@
<tr> <tr>
<td class="card-info-footer nowrap"> <td class="card-info-footer nowrap">
<table border="0" cellpadding="0" cellspacing="0"> <table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr> <tr>
<td class="badge-container"> <td class="badge-container">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
% if movie['year']: % if movie['year']:
<span class="badge" title="${movie['year']}">${movie['year']}</span> <td class="badge" title="${movie['year']}">${movie['year']}</td>
% endif % endif
% if movie['duration']: % if movie['duration']:
<% duration = int(int(movie['duration'])/60000) %> <% duration = int(int(movie['duration'])/60000) %>
<span class="badge" title="${duration} mins">${duration} mins</span> <td class="badge" title="${duration} mins">${duration} mins</td>
% endif % endif
% if movie['genres']: % if movie['genres']:
% for genre in movie['genres'][:2]: % for genre in movie['genres'][:]:
<span class="badge" title="${genre}">${genre}</span> <td class="badge" title="${genre}">${genre}</td>
% endfor % endfor
% endif % endif
</tr>
</table>
</td> </td>
% if movie['rating']: % if movie['rating']:
<% rating = int(round(float(movie['rating']) / 2)) %> <% rating = int(round(float(movie['rating']) / 2)) %>
<td class="star-rating-container" title="${int(float(movie['rating'])/0.1)}%" align="right"> <td class="star-rating-container" title="${int(float(movie['rating'])/0.1)}%" align="right">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
% for _ in range(rating): % for _ in range(rating):
<span class="star-rating full">&#9733;</span> <td class="star-rating full">&#9733;</td>
% endfor % endfor
% for _ in range(5-rating): % for _ in range(5-rating):
<span class="star-rating empty">&#9734;</span> <td class="star-rating empty">&#9734;</td>
% endfor % endfor
</tr>
</table>
</td> </td>
% endif % endif
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
% if not movie_b: % if not movie_b:
@ -776,12 +675,10 @@
% endif % endif
% endfor % endfor
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
</tr> </tr>
% endfor % endfor
</tbody>
</table> </table>
</td> </td>
</tr> </tr>
@ -803,12 +700,10 @@
<tr> <tr>
<td> <td>
<table border="0" cellpadding="0" cellspacing="0"> <table border="0" cellpadding="0" cellspacing="0">
<tbody>
% for show_a, show_b in grouper(recently_added['show'], 2): % for show_a, show_b in grouper(recently_added['show'], 2):
<tr> <tr>
<td> <td>
<table border="0" cellpadding="0" cellspacing="0" width="100%"> <table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr> <tr>
% for show in (show_a, show_b): % for show in (show_a, show_b):
% if show: % if show:
@ -826,11 +721,9 @@
%> %>
<td align="center" valign="top" class="card-instance show"> <td align="center" valign="top" class="card-instance show">
<table border="0" cellpadding="0" cellspacing="3" width="100%" class="card-background" style="background-image: url(${(base_url_image + show['art_hash']) if base_url_image else show['art_url']});"> <table border="0" cellpadding="0" cellspacing="3" width="100%" class="card-background" style="background-image: url(${(base_url_image + show['art_hash']) if base_url_image else show['art_url']});">
<tbody>
<tr> <tr>
<td class="card-poster-container"> <td class="card-poster-container">
<table border="0" cellpadding="0" cellspacing="0" class="card-poster" style="background-image: url(${(base_url_image + show['thumb_hash']) if base_url_image else show['poster_url']})"> <table border="0" cellpadding="0" cellspacing="0" class="card-poster" style="background-image: url(${(base_url_image + show['thumb_hash']) if base_url_image else show['poster_url']})">
<tbody>
<tr> <tr>
<td> <td>
<a href="${parameters['pms_web_url']}#!/server/${parameters['pms_identifier']}/details?key=%2Flibrary%2Fmetadata%2F${link_rating_key}" title="${show['title']}" target="_blank"> <a href="${parameters['pms_web_url']}#!/server/${parameters['pms_identifier']}/details?key=%2Flibrary%2Fmetadata%2F${link_rating_key}" title="${show['title']}" target="_blank">
@ -838,12 +731,10 @@
</a> </a>
</td> </td>
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
<td class="card-info-container"> <td class="card-info-container">
<table border="0" cellpadding="0" cellspacing="0" class="card-info-container-table"> <table border="0" cellpadding="0" cellspacing="0" class="card-info-container-table">
<tbody>
<tr> <tr>
<td class="card-info-title nowrap"> <td class="card-info-title nowrap">
<a href="${parameters['pms_web_url']}#!/server/${parameters['pms_identifier']}/details?key=%2Flibrary%2Fmetadata%2F${link_rating_key}" title="${show['title']}" target="_blank">${show['title']}</a> <a href="${parameters['pms_web_url']}#!/server/${parameters['pms_identifier']}/details?key=%2Flibrary%2Fmetadata%2F${link_rating_key}" title="${show['title']}" target="_blank">${show['title']}</a>
@ -860,11 +751,10 @@
</p> </p>
<p class="nowrap mb5"> <p class="nowrap mb5">
% for i, season in enumerate(show['season'][:8]): % for i, season in enumerate(show['season'][:8]):
Season ${season['media_index']} &middot;
% if season['episode_count'] == 1: % if season['episode_count'] == 1:
Episode ${season['episode'][0]['media_index']} - ${season['episode'][0]['title']} Season ${season['media_index']} &middot; Episode ${season['episode'][0]['media_index']} - ${season['episode'][0]['title']}
% else: % else:
Episodes ${season['episode_range']} Season ${season['media_index']} &middot; Episodes ${season['episode_range']}
% endif % endif
% if i < min(show['season_count'], 7): % if i < min(show['season_count'], 7):
<br> <br>
@ -888,43 +778,47 @@
<tr> <tr>
<td class="card-info-footer nowrap"> <td class="card-info-footer nowrap">
<table border="0" cellpadding="0" cellspacing="0"> <table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr> <tr>
<td class="badge-container"> <td class="badge-container">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
% if show['year']: % if show['year']:
<span class="badge" title="${show['year']}">${show['year']}</span> <td class="badge" title="${show['year']}">${show['year']}</td>
% endif % endif
% if show['duration']: % if show['duration']:
<% duration = int(int(show['duration'])/60000) %> <% duration = int(int(show['duration'])/60000) %>
<span class="badge" title="${duration} mins">${duration} mins</span> <td class="badge" title="${duration} mins">${duration} mins</td>
% endif % endif
% if show['genres']: % if show['genres']:
% for genre in show['genres'][:2]: % for genre in show['genres'][:2]:
<span class="badge" title="${genre}">${genre}</span> <td class="badge" title="${genre}">${genre}</td>
% endfor % endfor
% endif % endif
</tr>
</table>
</td> </td>
% if show['rating']: % if show['rating']:
<% rating = int(round(float(show['rating']) / 2)) %> <% rating = int(round(float(show['rating']) / 2)) %>
<td class="star-rating-container" title="${int(float(show['rating'])/0.1)}%" align="right"> <td class="star-rating-container" title="${int(float(show['rating'])/0.1)}%" align="right">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
% for _ in range(rating): % for _ in range(rating):
<span class="star-rating full">&#9733;</span> <td class="star-rating full">&#9733;</td>
% endfor % endfor
% for _ in range(5-rating): % for _ in range(5-rating):
<span class="star-rating empty">&#9734;</span> <td class="star-rating empty">&#9734;</td>
% endfor % endfor
</tr>
</table>
</td> </td>
% endif % endif
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
% if not show_b: % if not show_b:
@ -933,12 +827,10 @@
% endif % endif
% endfor % endfor
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
</tr> </tr>
% endfor % endfor
</tbody>
</table> </table>
</td> </td>
</tr> </tr>
@ -960,12 +852,10 @@
<tr> <tr>
<td> <td>
<table border="0" cellpadding="0" cellspacing="0"> <table border="0" cellpadding="0" cellspacing="0">
<tbody>
% for album_a, album_b in grouper([a for artist in recently_added['artist'] for a in artist['album']], 2): % for album_a, album_b in grouper([a for artist in recently_added['artist'] for a in artist['album']], 2):
<tr> <tr>
<td> <td>
<table border="0" cellpadding="0" cellspacing="0" width="100%"> <table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr> <tr>
% for album in (album_a, album_b): % for album in (album_a, album_b):
% if album: % if album:
@ -974,11 +864,9 @@
% endif % endif
<td align="center" valign="top" class="card-instance album"> <td align="center" valign="top" class="card-instance album">
<table border="0" cellpadding="0" cellspacing="3" width="100%" class="card-background" style="background-image: url(${(base_url_image + album['art_hash']) if base_url_image else album['art_url']});"> <table border="0" cellpadding="0" cellspacing="3" width="100%" class="card-background" style="background-image: url(${(base_url_image + album['art_hash']) if base_url_image else album['art_url']});">
<tbody>
<tr> <tr>
<td class="card-poster-container"> <td class="card-poster-container">
<table border="0" cellpadding="0" cellspacing="0" class="card-poster" style="background-image: url(${(base_url_image + album['thumb_hash']) if base_url_image else album['poster_url']})"> <table border="0" cellpadding="0" cellspacing="0" class="card-poster" style="background-image: url(${(base_url_image + album['thumb_hash']) if base_url_image else album['poster_url']})">
<tbody>
<tr> <tr>
<td> <td>
<a href="${parameters['pms_web_url']}#!/server/${parameters['pms_identifier']}/details?key=%2Flibrary%2Fmetadata%2F${album['rating_key']}" title="${album['title']}" target="_blank"> <a href="${parameters['pms_web_url']}#!/server/${parameters['pms_identifier']}/details?key=%2Flibrary%2Fmetadata%2F${album['rating_key']}" title="${album['title']}" target="_blank">
@ -986,12 +874,10 @@
</a> </a>
</td> </td>
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
<td class="card-info-container"> <td class="card-info-container">
<table border="0" cellpadding="0" cellspacing="0" class="card-info-container-table"> <table border="0" cellpadding="0" cellspacing="0" class="card-info-container-table">
<tbody>
<tr> <tr>
<td class="card-info-title nowrap"> <td class="card-info-title nowrap">
<a href="${parameters['pms_web_url']}#!/server/${parameters['pms_identifier']}/details?key=%2Flibrary%2Fmetadata%2F${album['rating_key']}" title="${album['title']}" target="_blank">${album['title']}</a> <a href="${parameters['pms_web_url']}#!/server/${parameters['pms_identifier']}/details?key=%2Flibrary%2Fmetadata%2F${album['rating_key']}" title="${album['title']}" target="_blank">${album['title']}</a>
@ -1012,39 +898,43 @@
<tr> <tr>
<td class="card-info-footer nowrap"> <td class="card-info-footer nowrap">
<table border="0" cellpadding="0" cellspacing="0"> <table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr> <tr>
<td class="badge-container"> <td class="badge-container">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
% if album['year']: % if album['year']:
<span class="badge" title="${album['year']}">${album['year']}</span> <td class="badge" title="${album['year']}">${album['year']}</td>
% endif % endif
% if album['genres']: % if album['genres']:
% for genre in album['genres'][:2]: % for genre in album['genres'][:2]:
<span class="badge" title="${genre}">${genre}</span> <td class="badge" title="${genre}">${genre}</td>
% endfor % endfor
% endif % endif
</tr>
</table>
</td> </td>
% if album['rating']: % if album['rating']:
<% rating = int(round(float(album['rating']) / 2)) %> <% rating = int(round(float(album['rating']) / 2)) %>
<td class="star-rating-container" title="${int(float(album['rating'])/0.1)}%" align="right"> <td class="star-rating-container" title="${int(float(album['rating'])/0.1)}%" align="right">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
% for _ in range(rating): % for _ in range(rating):
<span class="star-rating full">&#9733;</span> <td class="star-rating full">&#9733;</td>
% endfor % endfor
% for _ in range(5-rating): % for _ in range(5-rating):
<span class="star-rating empty">&#9734;</span> <td class="star-rating empty">&#9734;</td>
% endfor % endfor
</tr>
</table>
</td> </td>
% endif % endif
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
% if not album_b: % if not album_b:
@ -1053,31 +943,23 @@
% endif % endif
% endfor % endfor
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
</tr> </tr>
% endfor % endfor
</tbody>
</table> </table>
</td> </td>
</tr> </tr>
% endif % endif
<tr> <tr>
<td class="footer"> <td class="footer">
<!-- START FOOTER -->
<div class="footer-bar"></div> <div class="footer-bar"></div>
<div class="content-block powered-by"> <div class="content-block powered-by">
Newsletter generated by <a href="http://tautulli.com" target="_blank">Tautulli</a>. Newsletter generated by <a href="http://tautulli.com" target="_blank">Tautulli</a>.
</div> </div>
<!-- END FOOTER -->
</td> </td>
</tr> </tr>
<!-- END MAIN CONTENT AREA -->
</table> </table>
<!-- END CENTERED WHITE CONTAINER -->
</div> </div>
</td> </td>
</tr> </tr>

View file

@ -68,17 +68,14 @@
width: 100%; width: 100%;
} }
/* Set a max-width, and make it display as block so it will automatically stretch to that width, but will also shrink down on a phone or something */
.container { .container {
display: block; display: block;
margin: 0 auto !important; margin: 0 auto !important;
/* makes it centered */
max-width: 1042px; max-width: 1042px;
padding: 10px; padding: 10px;
width: 1042px; width: 1042px;
} }
/* This should also be a block element, so that it will fill 100% of the .container */
.content { .content {
box-sizing: border-box; box-sizing: border-box;
display: block; display: block;
@ -172,88 +169,9 @@
text-decoration: underline; text-decoration: underline;
} }
/* -------------------------------------
BUTTONS
------------------------------------- */
.btn {
box-sizing: border-box;
width: 100%;
}
.btn > tbody > tr > td {
padding-bottom: 15px;
}
.btn table {
width: auto;
}
.btn table td {
background-color: #ffffff;
border-radius: 5px;
text-align: center;
}
.btn a {
background-color: #ffffff;
border: solid 1px #3498db;
border-radius: 5px;
box-sizing: border-box;
color: #3498db;
cursor: pointer;
display: inline-block;
font-size: 14px;
font-weight: bold;
margin: 0;
padding: 12px 25px;
text-decoration: none;
text-transform: capitalize;
}
.btn-primary table td {
background-color: #3498db;
}
.btn-primary a {
background-color: #3498db;
border-color: #3498db;
color: #ffffff;
}
/* ------------------------------------- /* -------------------------------------
OTHER STYLES THAT MIGHT BE USEFUL OTHER STYLES THAT MIGHT BE USEFUL
------------------------------------- */ ------------------------------------- */
.last {
margin-bottom: 0;
}
.first {
margin-top: 0;
}
.align-center {
text-align: center;
}
.align-right {
text-align: right;
}
.align-left {
text-align: left;
}
.clear {
clear: both;
}
.mt0 {
margin-top: 0;
}
.mb0 {
margin-bottom: 0;
}
.mb5 { .mb5 {
margin-bottom: 5px; margin-bottom: 5px;
} }
@ -263,9 +181,6 @@
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
} }
.clear {
clear: both;
}
.preheader { .preheader {
color: transparent; color: transparent;
@ -324,6 +239,7 @@
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
/* ------------------------------------- /* -------------------------------------
MEDIA SECTIONS MEDIA SECTIONS
------------------------------------- */ ------------------------------------- */
@ -378,6 +294,7 @@
font-size: 20px; font-size: 20px;
text-transform: uppercase; text-transform: uppercase;
} }
/* ------------------------------------- /* -------------------------------------
MEDIA CARDS MEDIA CARDS
------------------------------------- */ ------------------------------------- */
@ -480,21 +397,21 @@
padding-left: 5px; padding-left: 5px;
} }
.card-info-footer .badge-container { .card-info-footer .badge-container {
max-width: 265px; max-width: 260px;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.card-info-footer .star-rating-container { .card-info-footer .star-rating-container {
width: 60px; width: 65px;
vertical-align: bottom;
padding-right: 5px;
} }
.card-info-footer .star-rating { .card-info-footer .star-rating {
margin-left: 4px;
font-size: 0.8rem; font-size: 0.8rem;
line-height: 1rem; line-height: 1rem;
width: 0.5rem; width: 0.5rem;
display: inline-block; display: inline-block;
vertical-align: bottom;
} }
.star-rating.full { .star-rating.full {
color: #E5A00D; color: #E5A00D;
@ -505,6 +422,7 @@
.badge { .badge {
display: inline-block; display: inline-block;
min-width: 10px; min-width: 10px;
margin-right: 4px;
padding: 3px 7px; padding: 3px 7px;
font-size: 11px; font-size: 11px;
line-height: 1; line-height: 1;
@ -609,21 +527,12 @@
line-height: inherit !important; line-height: inherit !important;
text-decoration: none !important; text-decoration: none !important;
} }
.btn-primary table td:hover {
background-color: #34495e !important;
}
.btn-primary a:hover {
background-color: #34495e !important;
border-color: #34495e !important;
}
} }
</style> </style>
</head> </head>
<body class="" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;-webkit-font-smoothing: antialiased;font-size: 14px;line-height: 1.4;margin: 0;padding: 0;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;"> <body style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;-webkit-font-smoothing: antialiased;font-size: 14px;line-height: 1.4;margin: 0;padding: 0;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">
% if preview and service and service != 'self-hosted' : % if preview and service and service != 'self-hosted':
<div class="local-preview-note" style="text-align: center;padding-top: 10px;"><p style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-weight: 400;margin: 0;color: #282A2D;font-size: 12px;">Note: Local preview images only - images will be uploaded to ${service.capitalize()} when the newsletter is sent.</p></div> <!-- IGNORE SAVE --> <div class="local-preview-note" style="text-align: center;padding-top: 10px;"><p style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-weight: 400;margin: 0;color: #282A2D;font-size: 12px;">Note: Local preview images only - images will be uploaded to ${service.capitalize()} when the newsletter is sent.</p></div> <!-- IGNORE SAVE -->
% elif preview and not service: % elif preview and not service:
<div class="local-preview-note" style="text-align: center;padding-top: 10px;"><p style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-weight: 400;margin: 0;color: #282A2D;font-size: 12px;">Warning: The Image Hosting setting must be enabled for images to display on the newsletter.</p></div> <!-- IGNORE SAVE --> <div class="local-preview-note" style="text-align: center;padding-top: 10px;"><p style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-weight: 400;margin: 0;color: #282A2D;font-size: 12px;">Warning: The Image Hosting setting must be enabled for images to display on the newsletter.</p></div> <!-- IGNORE SAVE -->
@ -632,19 +541,13 @@
<tr> <tr>
<td class="container" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;display: block;max-width: 1042px;padding: 10px;width: 1042px;margin: 0 auto !important;"> <td class="container" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;display: block;max-width: 1042px;padding: 10px;width: 1042px;margin: 0 auto !important;">
<div class="content" style="box-sizing: border-box;display: block;margin: 0 auto;max-width: 1037px;padding: 10px;"> <div class="content" style="box-sizing: border-box;display: block;margin: 0 auto;max-width: 1037px;padding: 10px;">
<!-- START CENTERED WHITE CONTAINER -->
<span class="preheader" style="color: transparent;display: none;height: 0;max-height: 0;max-width: 0;opacity: 0;overflow: hidden;mso-hide: all;visibility: hidden;width: 0;">Tautulli Newsletter - ${subject}</span> <span class="preheader" style="color: transparent;display: none;height: 0;max-height: 0;max-width: 0;opacity: 0;overflow: hidden;mso-hide: all;visibility: hidden;width: 0;">Tautulli Newsletter - ${subject}</span>
% if base_url and not preview: % if base_url and not preview:
<div class="view-full" style="clear: both;color: #282A2D;font-size: 12px;margin-bottom: 10px;text-align: center;width: 100%;"> <!-- IGNORE SAVE --> <div class="view-full" style="clear: both;color: #282A2D;font-size: 12px;margin-bottom: 10px;text-align: center;width: 100%;"> <!-- IGNORE SAVE -->
<a href="${base_url + uuid}" title="View full newsletter" target="_blank" style="text-decoration: underline;color: #282A2D;">Click here to view the full newsletter.</a> <!-- IGNORE SAVE --> <a href="${base_url + uuid}" title="View full newsletter" target="_blank" style="text-decoration: underline;color: #282A2D;">Click here to view the full newsletter.</a> <!-- IGNORE SAVE -->
</div> <!-- IGNORE SAVE --> </div> <!-- IGNORE SAVE -->
% endif % endif
<table border="0" cellpadding="3" cellspacing="0" class="main" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;background: #282A2D;border-radius: 3px;color: #ffffff;"> <table border="0" cellpadding="3" cellspacing="0" class="main" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;background: #282A2D;border-radius: 3px;color: #ffffff;">
<!-- START MAIN CONTENT AREA -->
<tr> <tr>
<td class="wrapper" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;box-sizing: border-box;padding: 5px;overflow: auto;"> <td class="wrapper" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;box-sizing: border-box;padding: 5px;overflow: auto;">
<div class="header" style="width: 100%;height: 90px;text-align: center;"> <div class="header" style="width: 100%;height: 90px;text-align: center;">
@ -654,7 +557,6 @@
<div class="dates" style="color: #aaaaaa;font-size: 20px;text-align: center;">${parameters['start_date']} - ${parameters['end_date']}</div> <div class="dates" style="color: #aaaaaa;font-size: 20px;text-align: center;">${parameters['start_date']} - ${parameters['end_date']}</div>
</td> </td>
</tr> </tr>
% if message: % if message:
<tr> <tr>
<td class="wrapper" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;box-sizing: border-box;padding: 5px;overflow: auto;"> <td class="wrapper" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;box-sizing: border-box;padding: 5px;overflow: auto;">
@ -663,7 +565,6 @@
</td> </td>
</tr> </tr>
% endif % endif
% if recently_added.get('movie'): % if recently_added.get('movie'):
<tr> <tr>
<td class="wrapper" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;box-sizing: border-box;padding: 5px;overflow: auto;"> <td class="wrapper" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;box-sizing: border-box;padding: 5px;overflow: auto;">
@ -679,12 +580,10 @@
<tr> <tr>
<td style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;"> <td style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;"> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;">
<tbody>
% for movie_a, movie_b in grouper(recently_added['movie'], 2): % for movie_a, movie_b in grouper(recently_added['movie'], 2):
<tr> <tr>
<td style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;"> <td style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;">
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;"> <table border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;">
<tbody>
<tr> <tr>
% for movie in (movie_a, movie_b): % for movie in (movie_a, movie_b):
% if movie: % if movie:
@ -693,11 +592,9 @@
% endif % endif
<td align="center" valign="top" class="card-instance movie" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 12px;vertical-align: top;overflow: hidden;padding: 3px;width: 502px;min-width: 502px;max-width: 502px;height: 233px;"> <td align="center" valign="top" class="card-instance movie" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 12px;vertical-align: top;overflow: hidden;padding: 3px;width: 502px;min-width: 502px;max-width: 502px;height: 233px;">
<table border="0" cellpadding="0" cellspacing="3" width="100%" class="card-background" style="background-image: url(${(base_url_image + movie['art_hash']) if base_url_image else movie['art_url']});border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;background-color: #282828;background-position: center;background-size: cover;background-repeat: no-repeat;background-clip: padding-box;border: 1px solid rgba(255,255,255,.1);"> <table border="0" cellpadding="0" cellspacing="3" width="100%" class="card-background" style="background-image: url(${(base_url_image + movie['art_hash']) if base_url_image else movie['art_url']});border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;background-color: #282828;background-position: center;background-size: cover;background-repeat: no-repeat;background-clip: padding-box;border: 1px solid rgba(255,255,255,.1);">
<tbody>
<tr> <tr>
<td class="card-poster-container" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;width: 152px;min-width: 152px;height: 227px;"> <td class="card-poster-container" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;width: 152px;min-width: 152px;height: 227px;">
<table border="0" cellpadding="0" cellspacing="0" class="card-poster" style="background-image: url(${(base_url_image + movie['thumb_hash']) if base_url_image else movie['poster_url']});border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;background-color: #3F4245;background-position: center;background-size: cover;background-repeat: no-repeat;background-clip: padding-box;border: 1px solid rgba(255,255,255,.1);"> <table border="0" cellpadding="0" cellspacing="0" class="card-poster" style="background-image: url(${(base_url_image + movie['thumb_hash']) if base_url_image else movie['poster_url']});border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;background-color: #3F4245;background-position: center;background-size: cover;background-repeat: no-repeat;background-clip: padding-box;border: 1px solid rgba(255,255,255,.1);">
<tbody>
<tr> <tr>
<td style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;"> <td style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;">
<a href="${parameters['pms_web_url']}#!/server/${parameters['pms_identifier']}/details?key=%2Flibrary%2Fmetadata%2F${movie['rating_key']}" title="${movie['title']}" target="_blank" style="text-decoration: underline;"> <a href="${parameters['pms_web_url']}#!/server/${parameters['pms_identifier']}/details?key=%2Flibrary%2Fmetadata%2F${movie['rating_key']}" title="${movie['title']}" target="_blank" style="text-decoration: underline;">
@ -705,12 +602,10 @@
</a> </a>
</td> </td>
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
<td class="card-info-container" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;padding-left: 4px;text-align: left;height: 227px;"> <td class="card-info-container" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;padding-left: 4px;text-align: left;height: 227px;">
<table border="0" cellpadding="0" cellspacing="0" class="card-info-container-table" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;height: 100%;"> <table border="0" cellpadding="0" cellspacing="0" class="card-info-container-table" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;height: 100%;">
<tbody>
<tr> <tr>
<td class="card-info-title nowrap" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 0.9rem;vertical-align: top;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;border-bottom: 1px solid rgba(255, 255, 255, .1);line-height: 1.2rem;padding: 5px;"> <td class="card-info-title nowrap" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 0.9rem;vertical-align: top;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;border-bottom: 1px solid rgba(255, 255, 255, .1);line-height: 1.2rem;padding: 5px;">
<a href="${parameters['pms_web_url']}#!/server/${parameters['pms_identifier']}/details?key=%2Flibrary%2Fmetadata%2F${movie['rating_key']}" title="${movie['title']}" target="_blank" style="text-decoration: none;color: #ffffff;">${movie['title']}</a> <a href="${parameters['pms_web_url']}#!/server/${parameters['pms_identifier']}/details?key=%2Flibrary%2Fmetadata%2F${movie['rating_key']}" title="${movie['title']}" target="_blank" style="text-decoration: none;color: #ffffff;">${movie['title']}</a>
@ -731,43 +626,47 @@
<tr> <tr>
<td class="card-info-footer nowrap" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 0.6rem;vertical-align: top;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;padding-top: 0px;padding-right: 5px;padding-bottom: 5px;padding-left: 5px;"> <td class="card-info-footer nowrap" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 0.6rem;vertical-align: top;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;padding-top: 0px;padding-right: 5px;padding-bottom: 5px;padding-left: 5px;">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;"> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;">
<tbody>
<tr> <tr>
<td class="badge-container" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;max-width: 265px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"> <td class="badge-container" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;max-width: 260px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;">
<tr>
% if movie['year']: % if movie['year']:
<span class="badge" title="${movie['year']}" style="display: inline-block;min-width: 10px;padding: 3px 7px;font-size: 11px;line-height: 1;text-align: center;white-space: nowrap;vertical-align: middle;background-color: rgba(0, 0, 0, .25);border-radius: 2px;text-overflow: ellipsis;overflow: hidden;color: #ffffff;">${movie['year']}</span> <td class="badge" title="${movie['year']}" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 11px;vertical-align: middle;display: inline-block;min-width: 10px;margin-right: 4px;padding: 3px 7px;line-height: 1;text-align: center;white-space: nowrap;background-color: rgba(0, 0, 0, .25);border-radius: 2px;text-overflow: ellipsis;overflow: hidden;color: #ffffff;">${movie['year']}</td>
% endif % endif
% if movie['duration']: % if movie['duration']:
<% duration = int(int(movie['duration'])/60000) %> <% duration = int(int(movie['duration'])/60000) %>
<span class="badge" title="${duration} mins" style="display: inline-block;min-width: 10px;padding: 3px 7px;font-size: 11px;line-height: 1;text-align: center;white-space: nowrap;vertical-align: middle;background-color: rgba(0, 0, 0, .25);border-radius: 2px;text-overflow: ellipsis;overflow: hidden;color: #ffffff;">${duration} mins</span> <td class="badge" title="${duration} mins" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 11px;vertical-align: middle;display: inline-block;min-width: 10px;margin-right: 4px;padding: 3px 7px;line-height: 1;text-align: center;white-space: nowrap;background-color: rgba(0, 0, 0, .25);border-radius: 2px;text-overflow: ellipsis;overflow: hidden;color: #ffffff;">${duration} mins</td>
% endif % endif
% if movie['genres']: % if movie['genres']:
% for genre in movie['genres'][:2]: % for genre in movie['genres'][:]:
<span class="badge" title="${genre}" style="display: inline-block;min-width: 10px;padding: 3px 7px;font-size: 11px;line-height: 1;text-align: center;white-space: nowrap;vertical-align: middle;background-color: rgba(0, 0, 0, .25);border-radius: 2px;text-overflow: ellipsis;overflow: hidden;color: #ffffff;">${genre}</span> <td class="badge" title="${genre}" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 11px;vertical-align: middle;display: inline-block;min-width: 10px;margin-right: 4px;padding: 3px 7px;line-height: 1;text-align: center;white-space: nowrap;background-color: rgba(0, 0, 0, .25);border-radius: 2px;text-overflow: ellipsis;overflow: hidden;color: #ffffff;">${genre}</td>
% endfor % endfor
% endif % endif
</tr>
</table>
</td> </td>
% if movie['rating']: % if movie['rating']:
<% rating = int(round(float(movie['rating']) / 2)) %> <% rating = int(round(float(movie['rating']) / 2)) %>
<td class="star-rating-container" title="${int(float(movie['rating'])/0.1)}%" align="right" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: bottom;width: 60px;padding-right: 5px;"> <td class="star-rating-container" title="${int(float(movie['rating'])/0.1)}%" align="right" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;width: 65px;">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;">
<tr>
% for _ in range(rating): % for _ in range(rating):
<span class="star-rating full" style="font-size: 0.8rem;line-height: 1rem;width: 0.5rem;display: inline-block;color: #E5A00D;">&#9733;</span> <td class="star-rating full" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 0.8rem;vertical-align: bottom;margin-left: 4px;line-height: 1rem;width: 0.5rem;display: inline-block;color: #E5A00D;">&#9733;</td>
% endfor % endfor
% for _ in range(5-rating): % for _ in range(5-rating):
<span class="star-rating empty" style="font-size: 0.8rem;line-height: 1rem;width: 0.5rem;display: inline-block;color: #aaaaaa;">&#9734;</span> <td class="star-rating empty" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 0.8rem;vertical-align: bottom;margin-left: 4px;line-height: 1rem;width: 0.5rem;display: inline-block;color: #aaaaaa;">&#9734;</td>
% endfor % endfor
</tr>
</table>
</td> </td>
% endif % endif
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
% if not movie_b: % if not movie_b:
@ -776,12 +675,10 @@
% endif % endif
% endfor % endfor
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
</tr> </tr>
% endfor % endfor
</tbody>
</table> </table>
</td> </td>
</tr> </tr>
@ -803,12 +700,10 @@
<tr> <tr>
<td style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;"> <td style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;"> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;">
<tbody>
% for show_a, show_b in grouper(recently_added['show'], 2): % for show_a, show_b in grouper(recently_added['show'], 2):
<tr> <tr>
<td style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;"> <td style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;">
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;"> <table border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;">
<tbody>
<tr> <tr>
% for show in (show_a, show_b): % for show in (show_a, show_b):
% if show: % if show:
@ -826,11 +721,9 @@
%> %>
<td align="center" valign="top" class="card-instance show" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 12px;vertical-align: top;overflow: hidden;padding: 3px;width: 502px;min-width: 502px;max-width: 502px;height: 233px;"> <td align="center" valign="top" class="card-instance show" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 12px;vertical-align: top;overflow: hidden;padding: 3px;width: 502px;min-width: 502px;max-width: 502px;height: 233px;">
<table border="0" cellpadding="0" cellspacing="3" width="100%" class="card-background" style="background-image: url(${(base_url_image + show['art_hash']) if base_url_image else show['art_url']});border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;background-color: #282828;background-position: center;background-size: cover;background-repeat: no-repeat;background-clip: padding-box;border: 1px solid rgba(255,255,255,.1);"> <table border="0" cellpadding="0" cellspacing="3" width="100%" class="card-background" style="background-image: url(${(base_url_image + show['art_hash']) if base_url_image else show['art_url']});border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;background-color: #282828;background-position: center;background-size: cover;background-repeat: no-repeat;background-clip: padding-box;border: 1px solid rgba(255,255,255,.1);">
<tbody>
<tr> <tr>
<td class="card-poster-container" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;width: 152px;min-width: 152px;height: 227px;"> <td class="card-poster-container" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;width: 152px;min-width: 152px;height: 227px;">
<table border="0" cellpadding="0" cellspacing="0" class="card-poster" style="background-image: url(${(base_url_image + show['thumb_hash']) if base_url_image else show['poster_url']});border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;background-color: #3F4245;background-position: center;background-size: cover;background-repeat: no-repeat;background-clip: padding-box;border: 1px solid rgba(255,255,255,.1);"> <table border="0" cellpadding="0" cellspacing="0" class="card-poster" style="background-image: url(${(base_url_image + show['thumb_hash']) if base_url_image else show['poster_url']});border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;background-color: #3F4245;background-position: center;background-size: cover;background-repeat: no-repeat;background-clip: padding-box;border: 1px solid rgba(255,255,255,.1);">
<tbody>
<tr> <tr>
<td style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;"> <td style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;">
<a href="${parameters['pms_web_url']}#!/server/${parameters['pms_identifier']}/details?key=%2Flibrary%2Fmetadata%2F${link_rating_key}" title="${show['title']}" target="_blank" style="text-decoration: underline;"> <a href="${parameters['pms_web_url']}#!/server/${parameters['pms_identifier']}/details?key=%2Flibrary%2Fmetadata%2F${link_rating_key}" title="${show['title']}" target="_blank" style="text-decoration: underline;">
@ -838,12 +731,10 @@
</a> </a>
</td> </td>
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
<td class="card-info-container" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;padding-left: 4px;text-align: left;height: 227px;"> <td class="card-info-container" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;padding-left: 4px;text-align: left;height: 227px;">
<table border="0" cellpadding="0" cellspacing="0" class="card-info-container-table" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;height: 100%;"> <table border="0" cellpadding="0" cellspacing="0" class="card-info-container-table" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;height: 100%;">
<tbody>
<tr> <tr>
<td class="card-info-title nowrap" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 0.9rem;vertical-align: top;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;border-bottom: 1px solid rgba(255, 255, 255, .1);line-height: 1.2rem;padding: 5px;"> <td class="card-info-title nowrap" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 0.9rem;vertical-align: top;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;border-bottom: 1px solid rgba(255, 255, 255, .1);line-height: 1.2rem;padding: 5px;">
<a href="${parameters['pms_web_url']}#!/server/${parameters['pms_identifier']}/details?key=%2Flibrary%2Fmetadata%2F${link_rating_key}" title="${show['title']}" target="_blank" style="text-decoration: none;color: #ffffff;">${show['title']}</a> <a href="${parameters['pms_web_url']}#!/server/${parameters['pms_identifier']}/details?key=%2Flibrary%2Fmetadata%2F${link_rating_key}" title="${show['title']}" target="_blank" style="text-decoration: none;color: #ffffff;">${show['title']}</a>
@ -860,11 +751,10 @@
</p> </p>
<p class="nowrap mb5" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-weight: 400;margin: 0;margin-bottom: 5px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;max-width: 325px;color: #ffffff;"> <p class="nowrap mb5" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-weight: 400;margin: 0;margin-bottom: 5px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;max-width: 325px;color: #ffffff;">
% for i, season in enumerate(show['season'][:8]): % for i, season in enumerate(show['season'][:8]):
Season ${season['media_index']} &middot;
% if season['episode_count'] == 1: % if season['episode_count'] == 1:
Episode ${season['episode'][0]['media_index']} - ${season['episode'][0]['title']} Season ${season['media_index']} &middot; Episode ${season['episode'][0]['media_index']} - ${season['episode'][0]['title']}
% else: % else:
Episodes ${season['episode_range']} Season ${season['media_index']} &middot; Episodes ${season['episode_range']}
% endif % endif
% if i < min(show['season_count'], 7): % if i < min(show['season_count'], 7):
<br> <br>
@ -888,43 +778,47 @@
<tr> <tr>
<td class="card-info-footer nowrap" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 0.6rem;vertical-align: top;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;padding-top: 0px;padding-right: 5px;padding-bottom: 5px;padding-left: 5px;"> <td class="card-info-footer nowrap" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 0.6rem;vertical-align: top;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;padding-top: 0px;padding-right: 5px;padding-bottom: 5px;padding-left: 5px;">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;"> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;">
<tbody>
<tr> <tr>
<td class="badge-container" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;max-width: 265px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"> <td class="badge-container" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;max-width: 260px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;">
<tr>
% if show['year']: % if show['year']:
<span class="badge" title="${show['year']}" style="display: inline-block;min-width: 10px;padding: 3px 7px;font-size: 11px;line-height: 1;text-align: center;white-space: nowrap;vertical-align: middle;background-color: rgba(0, 0, 0, .25);border-radius: 2px;text-overflow: ellipsis;overflow: hidden;color: #ffffff;">${show['year']}</span> <td class="badge" title="${show['year']}" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 11px;vertical-align: middle;display: inline-block;min-width: 10px;margin-right: 4px;padding: 3px 7px;line-height: 1;text-align: center;white-space: nowrap;background-color: rgba(0, 0, 0, .25);border-radius: 2px;text-overflow: ellipsis;overflow: hidden;color: #ffffff;">${show['year']}</td>
% endif % endif
% if show['duration']: % if show['duration']:
<% duration = int(int(show['duration'])/60000) %> <% duration = int(int(show['duration'])/60000) %>
<span class="badge" title="${duration} mins" style="display: inline-block;min-width: 10px;padding: 3px 7px;font-size: 11px;line-height: 1;text-align: center;white-space: nowrap;vertical-align: middle;background-color: rgba(0, 0, 0, .25);border-radius: 2px;text-overflow: ellipsis;overflow: hidden;color: #ffffff;">${duration} mins</span> <td class="badge" title="${duration} mins" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 11px;vertical-align: middle;display: inline-block;min-width: 10px;margin-right: 4px;padding: 3px 7px;line-height: 1;text-align: center;white-space: nowrap;background-color: rgba(0, 0, 0, .25);border-radius: 2px;text-overflow: ellipsis;overflow: hidden;color: #ffffff;">${duration} mins</td>
% endif % endif
% if show['genres']: % if show['genres']:
% for genre in show['genres'][:2]: % for genre in show['genres'][:2]:
<span class="badge" title="${genre}" style="display: inline-block;min-width: 10px;padding: 3px 7px;font-size: 11px;line-height: 1;text-align: center;white-space: nowrap;vertical-align: middle;background-color: rgba(0, 0, 0, .25);border-radius: 2px;text-overflow: ellipsis;overflow: hidden;color: #ffffff;">${genre}</span> <td class="badge" title="${genre}" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 11px;vertical-align: middle;display: inline-block;min-width: 10px;margin-right: 4px;padding: 3px 7px;line-height: 1;text-align: center;white-space: nowrap;background-color: rgba(0, 0, 0, .25);border-radius: 2px;text-overflow: ellipsis;overflow: hidden;color: #ffffff;">${genre}</td>
% endfor % endfor
% endif % endif
</tr>
</table>
</td> </td>
% if show['rating']: % if show['rating']:
<% rating = int(round(float(show['rating']) / 2)) %> <% rating = int(round(float(show['rating']) / 2)) %>
<td class="star-rating-container" title="${int(float(show['rating'])/0.1)}%" align="right" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: bottom;width: 60px;padding-right: 5px;"> <td class="star-rating-container" title="${int(float(show['rating'])/0.1)}%" align="right" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;width: 65px;">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;">
<tr>
% for _ in range(rating): % for _ in range(rating):
<span class="star-rating full" style="font-size: 0.8rem;line-height: 1rem;width: 0.5rem;display: inline-block;color: #E5A00D;">&#9733;</span> <td class="star-rating full" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 0.8rem;vertical-align: bottom;margin-left: 4px;line-height: 1rem;width: 0.5rem;display: inline-block;color: #E5A00D;">&#9733;</td>
% endfor % endfor
% for _ in range(5-rating): % for _ in range(5-rating):
<span class="star-rating empty" style="font-size: 0.8rem;line-height: 1rem;width: 0.5rem;display: inline-block;color: #aaaaaa;">&#9734;</span> <td class="star-rating empty" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 0.8rem;vertical-align: bottom;margin-left: 4px;line-height: 1rem;width: 0.5rem;display: inline-block;color: #aaaaaa;">&#9734;</td>
% endfor % endfor
</tr>
</table>
</td> </td>
% endif % endif
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
% if not show_b: % if not show_b:
@ -933,12 +827,10 @@
% endif % endif
% endfor % endfor
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
</tr> </tr>
% endfor % endfor
</tbody>
</table> </table>
</td> </td>
</tr> </tr>
@ -960,12 +852,10 @@
<tr> <tr>
<td style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;"> <td style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;"> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;">
<tbody>
% for album_a, album_b in grouper([a for artist in recently_added['artist'] for a in artist['album']], 2): % for album_a, album_b in grouper([a for artist in recently_added['artist'] for a in artist['album']], 2):
<tr> <tr>
<td style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;"> <td style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;">
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;"> <table border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;">
<tbody>
<tr> <tr>
% for album in (album_a, album_b): % for album in (album_a, album_b):
% if album: % if album:
@ -974,11 +864,9 @@
% endif % endif
<td align="center" valign="top" class="card-instance album" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 12px;vertical-align: top;overflow: hidden;padding: 3px;width: 502px;min-width: 502px;max-width: 502px;height: 158px;"> <td align="center" valign="top" class="card-instance album" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 12px;vertical-align: top;overflow: hidden;padding: 3px;width: 502px;min-width: 502px;max-width: 502px;height: 158px;">
<table border="0" cellpadding="0" cellspacing="3" width="100%" class="card-background" style="background-image: url(${(base_url_image + album['art_hash']) if base_url_image else album['art_url']});border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;background-color: #282828;background-position: center;background-size: cover;background-repeat: no-repeat;background-clip: padding-box;border: 1px solid rgba(255,255,255,.1);"> <table border="0" cellpadding="0" cellspacing="3" width="100%" class="card-background" style="background-image: url(${(base_url_image + album['art_hash']) if base_url_image else album['art_url']});border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;background-color: #282828;background-position: center;background-size: cover;background-repeat: no-repeat;background-clip: padding-box;border: 1px solid rgba(255,255,255,.1);">
<tbody>
<tr> <tr>
<td class="card-poster-container" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;width: 152px;min-width: 152px;height: 152px;"> <td class="card-poster-container" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;width: 152px;min-width: 152px;height: 152px;">
<table border="0" cellpadding="0" cellspacing="0" class="card-poster" style="background-image: url(${(base_url_image + album['thumb_hash']) if base_url_image else album['poster_url']});border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;background-color: #3F4245;background-position: center;background-size: cover;background-repeat: no-repeat;background-clip: padding-box;border: 1px solid rgba(255,255,255,.1);"> <table border="0" cellpadding="0" cellspacing="0" class="card-poster" style="background-image: url(${(base_url_image + album['thumb_hash']) if base_url_image else album['poster_url']});border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;background-color: #3F4245;background-position: center;background-size: cover;background-repeat: no-repeat;background-clip: padding-box;border: 1px solid rgba(255,255,255,.1);">
<tbody>
<tr> <tr>
<td style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;"> <td style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;">
<a href="${parameters['pms_web_url']}#!/server/${parameters['pms_identifier']}/details?key=%2Flibrary%2Fmetadata%2F${album['rating_key']}" title="${album['title']}" target="_blank" style="text-decoration: underline;"> <a href="${parameters['pms_web_url']}#!/server/${parameters['pms_identifier']}/details?key=%2Flibrary%2Fmetadata%2F${album['rating_key']}" title="${album['title']}" target="_blank" style="text-decoration: underline;">
@ -986,12 +874,10 @@
</a> </a>
</td> </td>
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
<td class="card-info-container" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;padding-left: 4px;text-align: left;height: 152px;"> <td class="card-info-container" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;padding-left: 4px;text-align: left;height: 152px;">
<table border="0" cellpadding="0" cellspacing="0" class="card-info-container-table" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;height: 100%;"> <table border="0" cellpadding="0" cellspacing="0" class="card-info-container-table" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;height: 100%;">
<tbody>
<tr> <tr>
<td class="card-info-title nowrap" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 0.9rem;vertical-align: top;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;border-bottom: 1px solid rgba(255, 255, 255, .1);line-height: 1.2rem;padding: 5px;"> <td class="card-info-title nowrap" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 0.9rem;vertical-align: top;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;border-bottom: 1px solid rgba(255, 255, 255, .1);line-height: 1.2rem;padding: 5px;">
<a href="${parameters['pms_web_url']}#!/server/${parameters['pms_identifier']}/details?key=%2Flibrary%2Fmetadata%2F${album['rating_key']}" title="${album['title']}" target="_blank" style="text-decoration: none;color: #ffffff;">${album['title']}</a> <a href="${parameters['pms_web_url']}#!/server/${parameters['pms_identifier']}/details?key=%2Flibrary%2Fmetadata%2F${album['rating_key']}" title="${album['title']}" target="_blank" style="text-decoration: none;color: #ffffff;">${album['title']}</a>
@ -1012,39 +898,43 @@
<tr> <tr>
<td class="card-info-footer nowrap" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 0.6rem;vertical-align: top;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;padding-top: 0px;padding-right: 5px;padding-bottom: 5px;padding-left: 5px;"> <td class="card-info-footer nowrap" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 0.6rem;vertical-align: top;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;padding-top: 0px;padding-right: 5px;padding-bottom: 5px;padding-left: 5px;">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;"> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;">
<tbody>
<tr> <tr>
<td class="badge-container" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;max-width: 265px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"> <td class="badge-container" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;max-width: 260px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;">
<tr>
% if album['year']: % if album['year']:
<span class="badge" title="${album['year']}" style="display: inline-block;min-width: 10px;padding: 3px 7px;font-size: 11px;line-height: 1;text-align: center;white-space: nowrap;vertical-align: middle;background-color: rgba(0, 0, 0, .25);border-radius: 2px;text-overflow: ellipsis;overflow: hidden;color: #ffffff;">${album['year']}</span> <td class="badge" title="${album['year']}" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 11px;vertical-align: middle;display: inline-block;min-width: 10px;margin-right: 4px;padding: 3px 7px;line-height: 1;text-align: center;white-space: nowrap;background-color: rgba(0, 0, 0, .25);border-radius: 2px;text-overflow: ellipsis;overflow: hidden;color: #ffffff;">${album['year']}</td>
% endif % endif
% if album['genres']: % if album['genres']:
% for genre in album['genres'][:2]: % for genre in album['genres'][:2]:
<span class="badge" title="${genre}" style="display: inline-block;min-width: 10px;padding: 3px 7px;font-size: 11px;line-height: 1;text-align: center;white-space: nowrap;vertical-align: middle;background-color: rgba(0, 0, 0, .25);border-radius: 2px;text-overflow: ellipsis;overflow: hidden;color: #ffffff;">${genre}</span> <td class="badge" title="${genre}" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 11px;vertical-align: middle;display: inline-block;min-width: 10px;margin-right: 4px;padding: 3px 7px;line-height: 1;text-align: center;white-space: nowrap;background-color: rgba(0, 0, 0, .25);border-radius: 2px;text-overflow: ellipsis;overflow: hidden;color: #ffffff;">${genre}</td>
% endfor % endfor
% endif % endif
</tr>
</table>
</td> </td>
% if album['rating']: % if album['rating']:
<% rating = int(round(float(album['rating']) / 2)) %> <% rating = int(round(float(album['rating']) / 2)) %>
<td class="star-rating-container" title="${int(float(album['rating'])/0.1)}%" align="right" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: bottom;width: 60px;padding-right: 5px;"> <td class="star-rating-container" title="${int(float(album['rating'])/0.1)}%" align="right" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 14px;vertical-align: top;width: 65px;">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;">
<tr>
% for _ in range(rating): % for _ in range(rating):
<span class="star-rating full" style="font-size: 0.8rem;line-height: 1rem;width: 0.5rem;display: inline-block;color: #E5A00D;">&#9733;</span> <td class="star-rating full" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 0.8rem;vertical-align: bottom;margin-left: 4px;line-height: 1rem;width: 0.5rem;display: inline-block;color: #E5A00D;">&#9733;</td>
% endfor % endfor
% for _ in range(5-rating): % for _ in range(5-rating):
<span class="star-rating empty" style="font-size: 0.8rem;line-height: 1rem;width: 0.5rem;display: inline-block;color: #aaaaaa;">&#9734;</span> <td class="star-rating empty" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 0.8rem;vertical-align: bottom;margin-left: 4px;line-height: 1rem;width: 0.5rem;display: inline-block;color: #aaaaaa;">&#9734;</td>
% endfor % endfor
</tr>
</table>
</td> </td>
% endif % endif
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
% if not album_b: % if not album_b:
@ -1053,31 +943,23 @@
% endif % endif
% endfor % endfor
</tr> </tr>
</tbody>
</table> </table>
</td> </td>
</tr> </tr>
% endfor % endfor
</tbody>
</table> </table>
</td> </td>
</tr> </tr>
% endif % endif
<tr> <tr>
<td class="footer" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 12px;vertical-align: top;clear: both;margin-top: 10px;text-align: center;width: 100%;"> <td class="footer" style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-size: 12px;vertical-align: top;clear: both;margin-top: 10px;text-align: center;width: 100%;">
<!-- START FOOTER -->
<div class="footer-bar" style="margin-left: auto;margin-right: auto;width: 200px;border-top: 1px solid #E5A00D;margin-top: 25px;"></div> <div class="footer-bar" style="margin-left: auto;margin-right: auto;width: 200px;border-top: 1px solid #E5A00D;margin-top: 25px;"></div>
<div class="content-block powered-by" style="padding-bottom: 10px;padding-top: 10px;"> <div class="content-block powered-by" style="padding-bottom: 10px;padding-top: 10px;">
Newsletter generated by <a href="http://tautulli.com" target="_blank" style="text-decoration: underline;color: #fff;font-size: 12px;text-align: center;">Tautulli</a>. Newsletter generated by <a href="http://tautulli.com" target="_blank" style="text-decoration: underline;color: #fff;font-size: 12px;text-align: center;">Tautulli</a>.
</div> </div>
<!-- END FOOTER -->
</td> </td>
</tr> </tr>
<!-- END MAIN CONTENT AREA -->
</table> </table>
<!-- END CENTERED WHITE CONTAINER -->
</div> </div>
</td> </td>
</tr> </tr>

View file

@ -456,6 +456,7 @@ class Newsletter(object):
for line in self.newsletter.encode('utf-8').splitlines(): for line in self.newsletter.encode('utf-8').splitlines():
if '<!-- IGNORE SAVE -->' not in line: if '<!-- IGNORE SAVE -->' not in line:
n_file.write(line + '\r\n') n_file.write(line + '\r\n')
#n_file.write(line.strip())
logger.info(u"Tautulli Newsletters :: %s newsletter saved to '%s'" % (self.NAME, newsletter_file)) logger.info(u"Tautulli Newsletters :: %s newsletter saved to '%s'" % (self.NAME, newsletter_file))
except OSError as e: except OSError as e:
@ -464,18 +465,20 @@ class Newsletter(object):
def _send(self): def _send(self):
if self.config['formatted']: if self.config['formatted']:
newsletter_stripped = ''.join(l.strip() for l in self.newsletter.splitlines())
if self.email_config['notifier_id']: if self.email_config['notifier_id']:
return send_notification( return send_notification(
notifier_id=self.email_config['notifier_id'], notifier_id=self.email_config['notifier_id'],
subject=self.subject_formatted, subject=self.subject_formatted,
body=self.newsletter body=newsletter_stripped
) )
else: else:
email = EMAIL(config=self.email_config) email = EMAIL(config=self.email_config)
return email.notify( return email.notify(
subject=self.subject_formatted, subject=self.subject_formatted,
body=self.newsletter body=newsletter_stripped
) )
elif self.config['notifier_id']: elif self.config['notifier_id']:
return send_notification( return send_notification(