{% extends 'base.html' %} {% block content %} {% from '_helpers.html' import render_field, render_checkbox_field, render_button, render_time_schedule_form, playwright_warning, only_playwright_type_watches_warning, highlight_trigger_ignored_explainer, render_conditions_fieldlist_of_formfields_as_table, render_ternary_field %} {% from '_common_fields.html' import render_common_settings_form %} {% if playwright_enabled %} {% endif %} {% set has_tag_filters_extra="WARNING: Watch has tag/groups set with special filters\n" if has_special_tag_options else '' %}
{{ render_field(form.url, placeholder="https://...", required=true, class="m-d") }}
{{ _('Some sites use JavaScript to create the content, for this you should') }} {{ _('use the Chrome/WebDriver Fetcher') }}
{{ _('Variables are supported in the URL') }} ({{ _('help and examples here') }}).
{{ render_field(form.tags) }} {{ _('Organisational tag/group name used in the main listing page') }}
{{ render_field(form.processor) }}
{{ render_field(form.title, class="m-d", placeholder=watch.label) }} {{ _('Automatically uses the page title if found, you can also use your own title/description here') }}
{{ render_checkbox_field(form.time_between_check_use_default, class="use-default-timecheck") }}
{{ render_field(form.time_between_check, class="time-check-widget") }} {{ _('The interval/amount of time between each check.') }}
{{ render_time_schedule_form(form, available_timezones, timezone_default_config) }}

{{ render_checkbox_field(form.filter_failure_notification_send) }} {{ _('Sends a notification when the filter can no longer be seen on the page, good for knowing when the page changed and your filter will not work anymore.') }}
{{ render_field(form.history_snapshot_max_length, class="history_snapshot_max_length") }} {{ _('Limit collection of history snapshots for each watch to this number of history items.') }}
{{ _('Set to empty to use system settings default') }}
{{ render_ternary_field(form.use_page_title_in_list) }}
{% if capabilities.supports_request_type %}
{{ render_field(form.fetch_backend, class="fetch-backend") }}

{{ _('Use the') }} {{ _('Basic') }} {{ _('method (default) where your watched site doesn\'t need Javascript to render.') }}

{{ _('The') }} {{ _('Chrome/Javascript') }} {{ _('method requires a network connection to a running WebDriver+Chrome server, set by the ENV var \'WEBDRIVER_URL\'.') }}

{{ _('Tip:') }} {{ _('Connect using Bright Data and Oxylabs Proxies, find out more here.') }}
{% if form.proxy %}
{{ form.proxy.label }} {{ _('Check/Scan all') }}
{{ form.proxy(class="fetch-backend-proxy") }}
{{ _('Choose a proxy for this watch') }}
{% endif %}
{{ render_field(form.webdriver_delay) }}
{{ _('If you\'re having trouble waiting for the page to be fully rendered (text missing etc), try increasing the \'wait\' time here.') }}
{{ _('This will wait') }} n {{ _('seconds before extracting the text.') }} {% if using_global_webdriver_wait %}
{{ _('Using the current global default settings') }} {% endif %}
{% endif %}
{% if capabilities.supports_browser_steps %} {% if true %}

{{ _('Click here to Start') }}


{{ _('Please allow 10-15 seconds for the browser to connect.') }}
{{ _('Press "Play" to start.') }} (?) {{ render_field(form.browser_steps) }}
{% else %} {{ _('Visual Selector data is not ready, watch needs to be checked atleast once.') }} {% endif %} {% else %}

{{ _('Sorry, this functionality only works with fetchers that support interactive Javascript (so far only Playwright based fetchers)') }}
{{ _('You need to') }} {{ _('Set the fetch method') }} {{ _('to one that supports interactive Javascript.') }}

{% endif %}
{{ render_ternary_field(form.notification_muted, BooleanField=true) }}
{% if capabilities.supports_screenshots %}
{{ render_checkbox_field(form.notification_screenshot) }} {{ _('Use with caution!') }} {{ _('This will easily fill up your email storage quota or flood other storages.') }}
{% endif %}
{% if has_default_notification_urls %}
{{ _('Look out!') }} {{ _('There are') }} {{ _('system-wide notification URLs enabled') }}, {{ _('this form will override notification settings for this watch only') }} ‐ {{ _('an empty Notification URL list here will still send notifications.') }}
{% endif %} {{ _('Use system defaults') }} {{ render_common_settings_form(form, emailprefix, settings_application, extra_notification_token_placeholder_info) }}
{% if capabilities.supports_text_filters_and_triggers %}
{{ render_field(form.conditions_match_logic) }} {{ render_conditions_fieldlist_of_formfields_as_table(form.conditions) }}

{{ _('Use the verify (✓) button to test if a condition passes against the current snapshot.') }}

{{ _('Read a quick tutorial about') }} {{ _('using conditional web page changes here') }}.
{{ _('Activate preview') }}
{% if capabilities.supports_text_filters_and_triggers_elements %}
{{ _('Pro-tips:') }}
{% include "edit/include_subtract.html" %} {% endif %}

{{ _('Text filtering') }}

{{ _('Limit trigger/ignore/block/extract to;') }}
{{ render_checkbox_field(form.filter_text_added) }} {{ render_checkbox_field(form.filter_text_replaced) }} {{ render_checkbox_field(form.filter_text_removed) }} {{ _('Note: Depending on the length and similarity of the text on each line, the algorithm may consider an') }} {{ _('addition') }} {{ _('instead of') }} {{ _('replacement') }} {{ _('for example.') }}
 {{ _('So it\'s always better to select') }} {{ _('Added') }}+{{ _('Replaced') }} {{ _('when you\'re interested in new content.') }}
 {{ _('When content is merely moved in a list, it will also trigger an') }} {{ _('addition') }}, {{ _('consider enabling') }} {{ _('Only trigger when unique lines appear') }}
{{ render_checkbox_field(form.check_unique_lines) }} {{ _('Good for websites that just move the content around, and you want to know when NEW content is added, compares new lines against all history for this watch.') }}
{{ render_checkbox_field(form.remove_duplicate_lines) }} {{ _('Remove duplicate lines of text') }}
{{ render_checkbox_field(form.sort_text_alphabetically) }} {{ _('Helps reduce changes detected caused by sites shuffling lines around, combine with') }} {{ _('check unique lines') }} {{ _('below.') }}
{{ render_checkbox_field(form.trim_text_whitespace) }} {{ _('Remove any whitespace before and after each line of text') }}
{% include "edit/text-options.html" %}
{% endif %} {# rendered sub Template #} {% if extra_form_content %}
{{ extra_form_content|safe }}
{% endif %} {% if capabilities.supports_visual_selector %}
{% if capabilities.supports_screenshots and capabilities.supports_xpath_element_data %} {% if visual_selector_data_ready %} {{ _('The Visual Selector tool lets you select the') }} {{ _('text') }} {{ _('elements that will be used for the change detection. It automatically fills-in the filters in the "CSS/JSONPath/JQ/XPath Filters" box of the') }} {{ _('Filters & Triggers') }} {{ _('tab. Use') }} {{ _('Shift+Click') }} {{ _('to select multiple items.') }} {% if watch['processor'] == 'image_ssim_diff' %} {# @todo, integrate with image_ssim_diff selector better, use some extra form ? #}
{{ render_field(form.processor_config_bounding_box) }} {{ render_field(form.processor_config_selection_mode) }}
{% endif %}
{{ _('Clear selection') }} {{ _('One moment, fetching screenshot and element information..') }}
{{ _('Currently:') }} {{ _('Loading...') }}
{% else %} {{ _('Visual Selector data is not ready, watch needs to be checked atleast once.') }} {% endif %} {% else %}

{{ _('Sorry, this functionality only works with fetchers that support Javascript and screenshots (such as playwright etc).') }}
{{ _('You need to') }} {{ _('Set the fetch method') }} {{ _('to one that supports Javascript and screenshots.') }}

{% endif %}
{% endif %}
{{ _('Check count') }} {{ "{:,}".format( watch.check_count) }}
{{ _('Consecutive filter failures') }} {{ "{:,}".format( watch.consecutive_filter_failures) }}
{{ _('History length') }} {{ "{:,}".format(watch.history|length) }}
{{ _('Last fetch duration') }} {{ watch.fetch_time }}s
{{ _('Notification alert count') }} {{ watch.notification_alert_count }}
{{ _('Server type reply') }} {{ watch.get('remote_server_reply') }}
{% if ui_edit_stats_extras %}
{{ ui_edit_stats_extras|safe }}
{% endif %} {% if watch.history_n %}

{{ _('Download latest HTML snapshot') }} {{ _('Download watch data package') }}

{% endif %}
{{ render_button(form.save_button) }} {{ _('Delete') }} {% if watch.history_n %}{{ _('Clear History') }}{% endif %} {{ _('Clone & Edit') }} {{ _('RSS Feed for this watch') }}
{% endblock %}