mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 13:41:15 -07:00
Move newsletter filename setting and rename config tab
This commit is contained in:
parent
178bd89e7c
commit
62104c95e3
4 changed files with 153 additions and 146 deletions
|
@ -4093,3 +4093,8 @@ a:hover .overlay-refresh-image:hover {
|
||||||
a[data-tab-destination] {
|
a[data-tab-destination] {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
.modal-config-section {
|
||||||
|
margin-top: 10px !important;
|
||||||
|
padding-top: 10px;
|
||||||
|
border-top: 1px solid #444;
|
||||||
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
function initConfigCheckbox(elem, reverse = false) {
|
function initConfigCheckbox(elem, toggleElem = null, reverse = false) {
|
||||||
var config = $(elem).closest('div').next();
|
var config = toggleElem ? $(toggleElem) : $(elem).closest('div').next();
|
||||||
config.css('overflow', 'hidden');
|
config.css('overflow', 'hidden');
|
||||||
if ($(elem).is(":checked")) {
|
if ($(elem).is(":checked")) {
|
||||||
config.toggle(!reverse);
|
config.toggle(!reverse);
|
||||||
|
@ -7,7 +7,7 @@ function initConfigCheckbox(elem, reverse = false) {
|
||||||
config.toggle(reverse);
|
config.toggle(reverse);
|
||||||
}
|
}
|
||||||
$(elem).click(function () {
|
$(elem).click(function () {
|
||||||
var config = $(this).closest('div').next();
|
var config = toggleElem ? $(toggleElem) : $(this).closest('div').next();
|
||||||
if ($(this).is(":checked")) {
|
if ($(this).is(":checked")) {
|
||||||
config.slideToggleBool(!reverse);
|
config.slideToggleBool(!reverse);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<ul class="nav nav-tabs list-unstyled" role="tablist">
|
<ul class="nav nav-tabs list-unstyled" role="tablist">
|
||||||
<li role="presentation" class="active"><a href="#tabs-newsletter_config" aria-controls="tabs-newsletter_config" role="tab" data-toggle="tab">Configuration</a></li>
|
<li role="presentation" class="active"><a href="#tabs-newsletter_config" aria-controls="tabs-newsletter_config" role="tab" data-toggle="tab">Configuration</a></li>
|
||||||
<li role="presentation"><a href="#tabs-newsletter_agent" aria-controls="tabs-newsletter_agent" role="tab" data-toggle="tab">Notification Agent</a></li>
|
<li role="presentation"><a href="#tabs-newsletter_saving_sending" aria-controls="tabs-newsletter_saving_sending" role="tab" data-toggle="tab">Saving & Sending</a></li>
|
||||||
<li role="presentation"><a href="#tabs-newsletter_text" aria-controls="tabs-newsletter_text" role="tab" data-toggle="tab">Newsletter Text</a></li>
|
<li role="presentation"><a href="#tabs-newsletter_text" aria-controls="tabs-newsletter_text" role="tab" data-toggle="tab">Newsletter Text</a></li>
|
||||||
<li role="presentation"><a href="#tabs-test_newsletter" aria-controls="tabs-test_newsletter" role="tab" data-toggle="tab">Test Newsletter</a></li>
|
<li role="presentation"><a href="#tabs-test_newsletter" aria-controls="tabs-test_newsletter" role="tab" data-toggle="tab">Test Newsletter</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -70,7 +70,7 @@
|
||||||
<p class="help-block">Set the time frame to include in the newsletter. Note: Days uses calendar days (i.e. since midnight).</p>
|
<p class="help-block">Set the time frame to include in the newsletter. Note: Days uses calendar days (i.e. since midnight).</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-12" style="padding-top: 10px; border-top: 1px solid #444;">
|
<div class="col-md-12 modal-config-section">
|
||||||
<input type="hidden" id="newsletter_id" name="newsletter_id" value="${newsletter['id']}" />
|
<input type="hidden" id="newsletter_id" name="newsletter_id" value="${newsletter['id']}" />
|
||||||
<input type="hidden" id="agent_id" name="agent_id" value="${newsletter['agent_id']}" />
|
<input type="hidden" id="agent_id" name="agent_id" value="${newsletter['agent_id']}" />
|
||||||
% for item in newsletter['config_options']:
|
% for item in newsletter['config_options']:
|
||||||
|
@ -165,7 +165,7 @@
|
||||||
% endif
|
% endif
|
||||||
% endfor
|
% endfor
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-12" style="margin-top: 10px; padding-top: 10px; border-top: 1px solid #444;">
|
<div class="col-md-12 modal-config-section">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="id_name">Unique ID Name</label>
|
<label for="id_name">Unique ID Name</label>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -175,15 +175,6 @@
|
||||||
</div>
|
</div>
|
||||||
<p class="help-block">Optional: Enter a unique ID name to create a static URL to the last sent scheduled newsletter at <span class="inline-pre">${http_root}newsletter/id/<id_name></span>. Only letters (a-z), numbers (0-9), underscores (_) and hyphens (-) are allowed. Leave blank to disable.</p>
|
<p class="help-block">Optional: Enter a unique ID name to create a static URL to the last sent scheduled newsletter at <span class="inline-pre">${http_root}newsletter/id/<id_name></span>. Only letters (a-z), numbers (0-9), underscores (_) and hyphens (-) are allowed. Leave blank to disable.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
|
||||||
<label for="newsletter_config_filename">Filename</label>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<input type="text" class="form-control" id="newsletter_config_filename" name="newsletter_config_filename" value="${newsletter['config']['filename']}" size="30">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<p class="help-block">Optional: Enter the filename to use when saving the newsletter (ending with <span class="inline-pre">.html</span>). You may use any of the <a href="#newsletter-text-sub-modal" data-toggle="modal">newsletter text parameters</a>. Leave blank for default.</p>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="friendly_name">Description</label>
|
<label for="friendly_name">Description</label>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -196,17 +187,29 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div role="tabpanel" class="tab-pane" id="tabs-newsletter_agent">
|
<div role="tabpanel" class="tab-pane" id="tabs-newsletter_saving_sending">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
|
<label>Saving</label>
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" id="newsletter_config_save_only_checkbox" data-id="newsletter_config_save_only" class="checkboxes" value="1" ${checked(newsletter['config']['save_only'])}> Save Newsletter File Only
|
<input type="checkbox" id="newsletter_config_save_only_checkbox" data-id="newsletter_config_save_only" class="checkboxes" value="1" ${checked(newsletter['config']['save_only'])}> Save HTML File Only
|
||||||
</label>
|
</label>
|
||||||
<p class="help-block">Enable to save the newsletter file without sending it to any notification agent.</p>
|
<p class="help-block">Enable to save the newsletter HTML file without sending it to any notification agent.</p>
|
||||||
<input type="hidden" id="newsletter_config_save_only" name="newsletter_config_save_only" value="${newsletter['config']['save_only']}">
|
<input type="hidden" id="newsletter_config_save_only" name="newsletter_config_save_only" value="${newsletter['config']['save_only']}">
|
||||||
</div>
|
</div>
|
||||||
<div id="newsletter_agent_options">
|
<div class="form-group">
|
||||||
|
<label for="newsletter_config_filename">HTML File Name</label>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<input type="text" class="form-control" id="newsletter_config_filename" name="newsletter_config_filename" value="${newsletter['config']['filename']}" size="30">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p class="help-block">Optional: Enter the file name to use when saving the newsletter (ending with <span class="inline-pre">.html</span>). You may use any of the <a href="#newsletter-text-sub-modal" data-toggle="modal">newsletter text parameters</a>. Leave blank for default.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-12 modal-config-section" id="newsletter_agent_options">
|
||||||
|
<label>Sending</label>
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" id="newsletter_config_formatted_checkbox" data-id="newsletter_config_formatted" class="checkboxes" value="1" ${checked(newsletter['config']['formatted'])}> Send Newsletter as an HTML Formatted Email
|
<input type="checkbox" id="newsletter_config_formatted_checkbox" data-id="newsletter_config_formatted" class="checkboxes" value="1" ${checked(newsletter['config']['formatted'])}> Send Newsletter as an HTML Formatted Email
|
||||||
|
@ -260,9 +263,7 @@
|
||||||
Note: Self-hosted newsletters must be enabled under <a data-tab-destination="tabs-notifications" data-dismiss="modal" data-target="#newsletter_self_hosted">Newsletters</a> to include a link to the newsletter.
|
Note: Self-hosted newsletters must be enabled under <a data-tab-destination="tabs-notifications" data-dismiss="modal" data-target="#newsletter_self_hosted">Newsletters</a> to include a link to the newsletter.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div id="newsletter-email-config">
|
||||||
</div>
|
|
||||||
<div id="newsletter-email-config" class="col-md-12" style="padding-top: 10px; border-top: 1px solid #444;">
|
|
||||||
% for item in newsletter['email_config_options']:
|
% for item in newsletter['email_config_options']:
|
||||||
% if item['input_type'] == 'help':
|
% if item['input_type'] == 'help':
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
@ -358,6 +359,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div role="tabpanel" class="tab-pane" id="tabs-newsletter_text">
|
<div role="tabpanel" class="tab-pane" id="tabs-newsletter_text">
|
||||||
<label>Newsletter Text</label>
|
<label>Newsletter Text</label>
|
||||||
<p class="help-block">
|
<p class="help-block">
|
||||||
|
@ -488,7 +490,7 @@
|
||||||
function validateFilename() {
|
function validateFilename() {
|
||||||
var filename = $('#newsletter_config_filename').val();
|
var filename = $('#newsletter_config_filename').val();
|
||||||
if (filename !== '' && !(filename.endsWith('.html'))) {
|
if (filename !== '' && !(filename.endsWith('.html'))) {
|
||||||
showMsg('<i class="fa fa-times"></i> Failed to save newsletter. Invalid filename.', false, true, 5000, true);
|
showMsg('<i class="fa fa-times"></i> Failed to save newsletter. Invalid file name.', false, true, 5000, true);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
|
@ -532,7 +534,7 @@
|
||||||
var incl_libraries = $incl_libraries[0].selectize;
|
var incl_libraries = $incl_libraries[0].selectize;
|
||||||
incl_libraries.setValue(${json.dumps(next((c['value'] for c in newsletter['config_options'] if c['name'] == 'newsletter_config_incl_libraries'), [])) | n});
|
incl_libraries.setValue(${json.dumps(next((c['value'] for c in newsletter['config_options'] if c['name'] == 'newsletter_config_incl_libraries'), [])) | n});
|
||||||
|
|
||||||
initConfigCheckbox('#newsletter_config_save_only_checkbox', true);
|
initConfigCheckbox('#newsletter_config_save_only_checkbox', '#newsletter_agent_options', true);
|
||||||
|
|
||||||
function toggleEmailSelect () {
|
function toggleEmailSelect () {
|
||||||
if ($('#newsletter_config_formatted_checkbox').is(':checked')) {
|
if ($('#newsletter_config_formatted_checkbox').is(':checked')) {
|
||||||
|
|
|
@ -123,7 +123,7 @@
|
||||||
% endif
|
% endif
|
||||||
% endfor
|
% endfor
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-12" style="margin-top: 10px; padding-top: 10px; border-top: 1px solid #444;">
|
<div class="col-md-12 modal-config-section">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="friendly_name">Description</label>
|
<label for="friendly_name">Description</label>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue