Show local note on newsletter preview if image hosting enabled

This commit is contained in:
JonnyWong16 2018-05-07 18:26:40 -07:00
commit 1a12422908
2 changed files with 26 additions and 2 deletions

View file

@ -11,9 +11,10 @@
else: else:
base_url = '' base_url = ''
service = get_img_service()
if get_img_service(include_self=True) == 'self-hosted' and plexpy.CONFIG.HTTP_BASE_URL: if get_img_service(include_self=True) == 'self-hosted' and plexpy.CONFIG.HTTP_BASE_URL:
base_url_image = plexpy.CONFIG.HTTP_BASE_URL + plexpy.HTTP_ROOT + 'newsletter/image/' base_url_image = plexpy.CONFIG.HTTP_BASE_URL + plexpy.HTTP_ROOT + 'newsletter/image/'
elif preview: elif service and preview:
base_url_image = 'newsletter/image/' base_url_image = 'newsletter/image/'
else: else:
base_url_image = '' base_url_image = ''
@ -89,6 +90,14 @@
/* ------------------------------------- /* -------------------------------------
HEADER, FOOTER, MAIN HEADER, FOOTER, MAIN
------------------------------------- */ ------------------------------------- */
.local-preview-note {
text-align: center;
padding-top: 10px;
}
.local-preview-note p {
color: #282A2D;
font-size: 12px;
}
.main { .main {
background: #282A2D; background: #282A2D;
border-radius: 3px; border-radius: 3px;
@ -614,6 +623,9 @@
</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 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%;">
% if preview and 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;">Note: Local preview only - images have not been uploaded to ${service.capitalize()}</p></div> <!-- IGNORE SAVE -->
% endif
<table border="0" cellpadding="0" cellspacing="0" class="body" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;"> <table border="0" cellpadding="0" cellspacing="0" class="body" style="border-collapse: separate;mso-table-lspace: 0pt;mso-table-rspace: 0pt;width: 100%;">
<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;">

View file

@ -11,9 +11,10 @@
else: else:
base_url = '' base_url = ''
service = get_img_service()
if get_img_service(include_self=True) == 'self-hosted' and plexpy.CONFIG.HTTP_BASE_URL: if get_img_service(include_self=True) == 'self-hosted' and plexpy.CONFIG.HTTP_BASE_URL:
base_url_image = plexpy.CONFIG.HTTP_BASE_URL + plexpy.HTTP_ROOT + 'newsletter/image/' base_url_image = plexpy.CONFIG.HTTP_BASE_URL + plexpy.HTTP_ROOT + 'newsletter/image/'
elif preview: elif service and preview:
base_url_image = 'newsletter/image/' base_url_image = 'newsletter/image/'
else: else:
base_url_image = '' base_url_image = ''
@ -89,6 +90,14 @@
/* ------------------------------------- /* -------------------------------------
HEADER, FOOTER, MAIN HEADER, FOOTER, MAIN
------------------------------------- */ ------------------------------------- */
.local-preview-note {
text-align: center;
padding-top: 10px;
}
.local-preview-note p {
color: #282A2D;
font-size: 12px;
}
.main { .main {
background: #282A2D; background: #282A2D;
border-radius: 3px; border-radius: 3px;
@ -614,6 +623,9 @@
</style> </style>
</head> </head>
<body class=""> <body class="">
% if preview and service:
<div class="local-preview-note"><p>Note: Local preview only - images have not been uploaded to ${service.capitalize()}</p></div> <!-- IGNORE SAVE -->
% endif
<table border="0" cellpadding="0" cellspacing="0" class="body"> <table border="0" cellpadding="0" cellspacing="0" class="body">
<tr> <tr>
<td class="container"> <td class="container">