Watchdog channel – řádek kanálu hlídače

Zapnutí přepínače ukáže řadu intervalů, vypnutí ji skryje (čistě UI). Zamčený interval „Ihned“ vyšle cr:express-locked s detail.channel.

Čtyři kanály bez Expresu

  • E-mail
    jan.novak@email.cz
    E-mail
    Součást Realitního hlídače Expres
    Webpush
    Tento prohlížeč – Chrome, macOS
    Webpush
    Součást Realitního hlídače Expres
    WhatsApp
    Nové
    +420 777 123 456 – číslo není ověřené
    Mobilní aplikace
    Nové
    České reality – iPhone Jana
  •         {# Čtyři kanály bez Expresu: „Ihned“ je zamčené. Seznam obaluje .watchdog-channel-list. #}
    {% set intervals = [
      { value: "ihned", label: "Ihned" },
      { value: "daily", label: "Denně" },
      { value: "weekly", label: "Týdně" },
      { value: "monthly", label: "Měsíčně" },
    ] %}
    
    <form class="watchdog-channel-list" id="watchdog-channel-example-form">
      {% include "@Components/watchdog-channel/watchdog-channel.twig" with { props: {
        type: "email",
        id: "ex-channel-email",
        title: "E-mail",
        detail: "jan.novak@email.cz",
        enabled: true,
        interval: "daily",
        intervals: intervals,
        intervalLabel: "Posílat",
        expressActive: false,
        lockedHint: "Součást Realitního hlídače Expres"
      } } %}
      {% include "@Components/watchdog-channel/watchdog-channel.twig" with { props: {
        type: "webpush",
        id: "ex-channel-webpush",
        title: "Webpush",
        detail: "Tento prohlížeč – Chrome, macOS",
        enabled: true,
        interval: "daily",
        intervals: intervals,
        intervalLabel: "Posílat",
        expressActive: false,
        lockedHint: "Součást Realitního hlídače Expres"
      } } %}
      {% include "@Components/watchdog-channel/watchdog-channel.twig" with { props: {
        type: "whatsapp",
        id: "ex-channel-whatsapp",
        title: "WhatsApp",
        detail: "+420 777 123 456 – číslo není ověřené",
        detailWarning: true,
        isNew: true,
        newLabel: "Nové",
        enabled: false,
        interval: "daily",
        intervals: intervals,
        intervalLabel: "Posílat",
        expressActive: false,
        lockedHint: "Součást Realitního hlídače Expres"
      } } %}
      {% include "@Components/watchdog-channel/watchdog-channel.twig" with { props: {
        type: "app",
        id: "ex-channel-app",
        title: "Mobilní aplikace",
        detail: "České reality – iPhone Jana",
        isNew: true,
        newLabel: "Nové",
        enabled: false,
        interval: "daily",
        intervals: intervals,
        intervalLabel: "Posílat",
        expressActive: false,
        lockedHint: "Součást Realitního hlídače Expres"
      } } %}
    </form>
    
          
  •           
    
    <form class="watchdog-channel-list" id="watchdog-channel-example-form">
      <div class="watchdog-channel" data-watchdog-channel="email">
      <div class="watchdog-channel__head">
        <span class="watchdog-channel__icon" aria-hidden="true">
          <span class="icon">
          <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2.5" y="5" width="15" height="10" rx="1.5"/><path d="M3 6l7 5 7-5"/></svg>
      
      </span>
        </span>
        <div class="watchdog-channel__body">
          <div class="watchdog-channel__title-row">
            <span class="watchdog-channel__title">E-mail</span>
                  </div>
                  <div class="watchdog-channel__detail">jan.novak@email.cz</div>
              </div>
        <div class="watchdog-channel__switch">
                    <div class="switch switch--label-hidden">
      <input type="checkbox" id="ex-channel-email-enabled" name="channels[email][enabled]" value="1" checked="checked" data-watchdog-channel-toggle>
      <label class="f-label" for="ex-channel-email-enabled">
      <span class="f-label__title">E-mail</span>
    </label>
    </div>
        </div>
      </div>
          <div class="watchdog-channel__intervals" data-watchdog-channel-intervals>
          <fieldset class="chip-fieldset chip-fieldset--inline">
          <legend class="visually-hidden">E-mail</legend>
      
      <div class="chip-fieldset__list">
              <span class="chip-fieldset__inline-label" aria-hidden="true">Posílat</span>
                            <div class="chip chip--button chip--express is-locked">
      <input class="chip__input" type="radio" id="ex-channel-email-interval-ihned" name="channels[email][interval]" value="ihned" data-chip-locked aria-describedby="ex-channel-email-interval-ihned-hint" data-chip-channel="email">
      <label class="chip__label" for="ex-channel-email-interval-ihned">
              <span class="chip__icon">
            <span class="icon">
          <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path d="M11.5 2L5 11h4l-1 7 6.5-9h-4l1-7z"/></svg>
      
      </span>
          </span>
            <span class="chip__title">Ihned</span>
          </label>
      
          <span class="visually-hidden" id="ex-channel-email-interval-ihned-hint">Součást Realitního hlídače Expres</span>
      </div>
                      <div class="chip chip--button">
      <input class="chip__input" type="radio" id="ex-channel-email-interval-daily" name="channels[email][interval]" value="daily" checked="checked" data-chip-channel="email">
      <label class="chip__label" for="ex-channel-email-interval-daily">
            <span class="chip__title">Denně</span>
          </label>
      
      </div>
                    <div class="chip chip--button">
      <input class="chip__input" type="radio" id="ex-channel-email-interval-weekly" name="channels[email][interval]" value="weekly" data-chip-channel="email">
      <label class="chip__label" for="ex-channel-email-interval-weekly">
            <span class="chip__title">Týdně</span>
          </label>
      
      </div>
                    <div class="chip chip--button">
      <input class="chip__input" type="radio" id="ex-channel-email-interval-monthly" name="channels[email][interval]" value="monthly" data-chip-channel="email">
      <label class="chip__label" for="ex-channel-email-interval-monthly">
            <span class="chip__title">Měsíčně</span>
          </label>
      
      </div>
          </div>
    </fieldset>
        </div>
      </div>
      <div class="watchdog-channel" data-watchdog-channel="webpush">
      <div class="watchdog-channel__head">
        <span class="watchdog-channel__icon" aria-hidden="true">
          <span class="icon">
          <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2.5" y="4" width="15" height="11" rx="1.5"/><path d="M7 17h6M10 15v2"/></svg>
      
      </span>
        </span>
        <div class="watchdog-channel__body">
          <div class="watchdog-channel__title-row">
            <span class="watchdog-channel__title">Webpush</span>
                  </div>
                  <div class="watchdog-channel__detail">Tento prohlížeč – Chrome, macOS</div>
              </div>
        <div class="watchdog-channel__switch">
                    <div class="switch switch--label-hidden">
      <input type="checkbox" id="ex-channel-webpush-enabled" name="channels[webpush][enabled]" value="1" checked="checked" data-watchdog-channel-toggle>
      <label class="f-label" for="ex-channel-webpush-enabled">
      <span class="f-label__title">Webpush</span>
    </label>
    </div>
        </div>
      </div>
          <div class="watchdog-channel__intervals" data-watchdog-channel-intervals>
          <fieldset class="chip-fieldset chip-fieldset--inline">
          <legend class="visually-hidden">Webpush</legend>
      
      <div class="chip-fieldset__list">
              <span class="chip-fieldset__inline-label" aria-hidden="true">Posílat</span>
                            <div class="chip chip--button chip--express is-locked">
      <input class="chip__input" type="radio" id="ex-channel-webpush-interval-ihned" name="channels[webpush][interval]" value="ihned" data-chip-locked aria-describedby="ex-channel-webpush-interval-ihned-hint" data-chip-channel="webpush">
      <label class="chip__label" for="ex-channel-webpush-interval-ihned">
              <span class="chip__icon">
            <span class="icon">
          <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path d="M11.5 2L5 11h4l-1 7 6.5-9h-4l1-7z"/></svg>
      
      </span>
          </span>
            <span class="chip__title">Ihned</span>
          </label>
      
          <span class="visually-hidden" id="ex-channel-webpush-interval-ihned-hint">Součást Realitního hlídače Expres</span>
      </div>
                      <div class="chip chip--button">
      <input class="chip__input" type="radio" id="ex-channel-webpush-interval-daily" name="channels[webpush][interval]" value="daily" checked="checked" data-chip-channel="webpush">
      <label class="chip__label" for="ex-channel-webpush-interval-daily">
            <span class="chip__title">Denně</span>
          </label>
      
      </div>
                    <div class="chip chip--button">
      <input class="chip__input" type="radio" id="ex-channel-webpush-interval-weekly" name="channels[webpush][interval]" value="weekly" data-chip-channel="webpush">
      <label class="chip__label" for="ex-channel-webpush-interval-weekly">
            <span class="chip__title">Týdně</span>
          </label>
      
      </div>
                    <div class="chip chip--button">
      <input class="chip__input" type="radio" id="ex-channel-webpush-interval-monthly" name="channels[webpush][interval]" value="monthly" data-chip-channel="webpush">
      <label class="chip__label" for="ex-channel-webpush-interval-monthly">
            <span class="chip__title">Měsíčně</span>
          </label>
      
      </div>
          </div>
    </fieldset>
        </div>
      </div>
      <div class="watchdog-channel" data-watchdog-channel="whatsapp">
      <div class="watchdog-channel__head">
        <span class="watchdog-channel__icon" aria-hidden="true">
          <span class="icon">
          <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.5 16.5l1.1-3A6.4 6.4 0 013.5 10 6.5 6.5 0 1110 16.5a6.6 6.6 0 01-3.3-0.9l-3.2 0.9z"/></svg>
      
      </span>
        </span>
        <div class="watchdog-channel__body">
          <div class="watchdog-channel__title-row">
            <span class="watchdog-channel__title">WhatsApp</span>
                      <div class="badge --soft-gray --label">
      <span class="badge__title">Nové</span>
      </div>
                  </div>
                  <div class="watchdog-channel__detail watchdog-channel__detail--warning">+420 777 123 456 – číslo není ověřené</div>
              </div>
        <div class="watchdog-channel__switch">
                  <div class="switch switch--label-hidden">
      <input type="checkbox" id="ex-channel-whatsapp-enabled" name="channels[whatsapp][enabled]" value="1" data-watchdog-channel-toggle>
      <label class="f-label" for="ex-channel-whatsapp-enabled">
      <span class="f-label__title">WhatsApp</span>
    </label>
    </div>
        </div>
      </div>
          <div class="watchdog-channel__intervals" data-watchdog-channel-intervals hidden>
          <fieldset class="chip-fieldset chip-fieldset--inline">
          <legend class="visually-hidden">WhatsApp</legend>
      
      <div class="chip-fieldset__list">
              <span class="chip-fieldset__inline-label" aria-hidden="true">Posílat</span>
                            <div class="chip chip--button chip--express is-locked">
      <input class="chip__input" type="radio" id="ex-channel-whatsapp-interval-ihned" name="channels[whatsapp][interval]" value="ihned" data-chip-locked aria-describedby="ex-channel-whatsapp-interval-ihned-hint" data-chip-channel="whatsapp">
      <label class="chip__label" for="ex-channel-whatsapp-interval-ihned">
              <span class="chip__icon">
            <span class="icon">
          <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path d="M11.5 2L5 11h4l-1 7 6.5-9h-4l1-7z"/></svg>
      
      </span>
          </span>
            <span class="chip__title">Ihned</span>
          </label>
      
          <span class="visually-hidden" id="ex-channel-whatsapp-interval-ihned-hint">Součást Realitního hlídače Expres</span>
      </div>
                      <div class="chip chip--button">
      <input class="chip__input" type="radio" id="ex-channel-whatsapp-interval-daily" name="channels[whatsapp][interval]" value="daily" checked="checked" data-chip-channel="whatsapp">
      <label class="chip__label" for="ex-channel-whatsapp-interval-daily">
            <span class="chip__title">Denně</span>
          </label>
      
      </div>
                    <div class="chip chip--button">
      <input class="chip__input" type="radio" id="ex-channel-whatsapp-interval-weekly" name="channels[whatsapp][interval]" value="weekly" data-chip-channel="whatsapp">
      <label class="chip__label" for="ex-channel-whatsapp-interval-weekly">
            <span class="chip__title">Týdně</span>
          </label>
      
      </div>
                    <div class="chip chip--button">
      <input class="chip__input" type="radio" id="ex-channel-whatsapp-interval-monthly" name="channels[whatsapp][interval]" value="monthly" data-chip-channel="whatsapp">
      <label class="chip__label" for="ex-channel-whatsapp-interval-monthly">
            <span class="chip__title">Měsíčně</span>
          </label>
      
      </div>
          </div>
    </fieldset>
        </div>
      </div>
      <div class="watchdog-channel" data-watchdog-channel="app">
      <div class="watchdog-channel__head">
        <span class="watchdog-channel__icon" aria-hidden="true">
          <span class="icon">
          <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="6" y="2.5" width="8" height="15" rx="1.8"/><path d="M9 15.4h2"/></svg>
      
      </span>
        </span>
        <div class="watchdog-channel__body">
          <div class="watchdog-channel__title-row">
            <span class="watchdog-channel__title">Mobilní aplikace</span>
                      <div class="badge --soft-gray --label">
      <span class="badge__title">Nové</span>
      </div>
                  </div>
                  <div class="watchdog-channel__detail">České reality – iPhone Jana</div>
              </div>
        <div class="watchdog-channel__switch">
                  <div class="switch switch--label-hidden">
      <input type="checkbox" id="ex-channel-app-enabled" name="channels[app][enabled]" value="1" data-watchdog-channel-toggle>
      <label class="f-label" for="ex-channel-app-enabled">
      <span class="f-label__title">Mobilní aplikace</span>
    </label>
    </div>
        </div>
      </div>
          <div class="watchdog-channel__intervals" data-watchdog-channel-intervals hidden>
          <fieldset class="chip-fieldset chip-fieldset--inline">
          <legend class="visually-hidden">Mobilní aplikace</legend>
      
      <div class="chip-fieldset__list">
              <span class="chip-fieldset__inline-label" aria-hidden="true">Posílat</span>
                            <div class="chip chip--button chip--express is-locked">
      <input class="chip__input" type="radio" id="ex-channel-app-interval-ihned" name="channels[app][interval]" value="ihned" data-chip-locked aria-describedby="ex-channel-app-interval-ihned-hint" data-chip-channel="app">
      <label class="chip__label" for="ex-channel-app-interval-ihned">
              <span class="chip__icon">
            <span class="icon">
          <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path d="M11.5 2L5 11h4l-1 7 6.5-9h-4l1-7z"/></svg>
      
      </span>
          </span>
            <span class="chip__title">Ihned</span>
          </label>
      
          <span class="visually-hidden" id="ex-channel-app-interval-ihned-hint">Součást Realitního hlídače Expres</span>
      </div>
                      <div class="chip chip--button">
      <input class="chip__input" type="radio" id="ex-channel-app-interval-daily" name="channels[app][interval]" value="daily" checked="checked" data-chip-channel="app">
      <label class="chip__label" for="ex-channel-app-interval-daily">
            <span class="chip__title">Denně</span>
          </label>
      
      </div>
                    <div class="chip chip--button">
      <input class="chip__input" type="radio" id="ex-channel-app-interval-weekly" name="channels[app][interval]" value="weekly" data-chip-channel="app">
      <label class="chip__label" for="ex-channel-app-interval-weekly">
            <span class="chip__title">Týdně</span>
          </label>
      
      </div>
                    <div class="chip chip--button">
      <input class="chip__input" type="radio" id="ex-channel-app-interval-monthly" name="channels[app][interval]" value="monthly" data-chip-channel="app">
      <label class="chip__label" for="ex-channel-app-interval-monthly">
            <span class="chip__title">Měsíčně</span>
          </label>
      
      </div>
          </div>
    </fieldset>
        </div>
      </div>
    </form>
    
            

Schema

    {
  "props": {
    "type": {
      "type": "string",
      "description": "email | webpush | app | whatsapp – určuje ikonu, data-watchdog-channel a detail.channel eventu cr:express-locked"
    },
    "name": {
      "type": "string",
      "description": "Základ názvu polí; výchozí channels[]. Pole: [enabled] (checkbox, value 1) a [interval] (radio)"
    },
    "id": {
      "type": "string",
      "description": "Základ id polí; výchozí watchdog-channel-. Při více formulářích na stránce musí být unikátní."
    },
    "title": {
      "type": "string",
      "description": "Název kanálu, např. „E-mail“"
    },
    "detail": {
      "type": "string",
      "description": "Detail pod názvem: e-mail, „Tento prohlížeč – Chrome, macOS“, telefon… Texty se vypisují bez escapování (autoescape je vypnutý) – uživatelský obsah musí escapovat aplikace."
    },
    "detailWarning": {
      "type": "boolean",
      "description": "Detail ve varovné barvě (je potřeba akce, např. neověřené číslo)"
    },
    "isNew": {
      "type": "boolean",
      "description": "Zobrazí štítek newLabel vedle názvu"
    },
    "newLabel": {
      "type": "string",
      "description": "Text štítku, např. „Nové“"
    },
    "enabled": {
      "type": "boolean",
      "description": "Kanál je zapnutý; řada intervalů je vidět jen u zapnutého kanálu"
    },
    "switchLabel": {
      "type": "string",
      "description": "Popisek přepínače pro čtečky; výchozí = title"
    },
    "interval": {
      "type": "string",
      "description": "Vybraný interval (value z intervals), např. ihned | daily | weekly | monthly"
    },
    "intervals": {
      "type": "array of objects",
      "description": "{ value, label } – nabízené intervaly. Položka s value „ihned“ je zlatá s bleskem a bez Expresu zamčená."
    },
    "intervalLabel": {
      "type": "string",
      "description": "Popisek vlevo v řadě intervalů, např. „Posílat“ (na mobilu skrytý)"
    },
    "intervalLegend": {
      "type": "string",
      "description": "Skrytý popis skupiny intervalů pro čtečky; výchozí = title"
    },
    "expressActive": {
      "type": "boolean",
      "description": "Uživatel má Expres; bez něj je interval „ihned“ zamčený (jen pomůcka v UI, server musí ověřit sám)"
    },
    "lockedHint": {
      "type": "string",
      "description": "Text pro čtečky u zamčeného intervalu, např. „Součást Realitního hlídače Expres“"
    },
    "extraClass": {
      "type": "string",
      "description": "Extra CSS class"
    }
  }
}