Zum Hauptinhalt springen

Form for entering the password

  • Input mask for the test mode password
  • Activating debug mode
  • Deactivating test mode
{{ if not $wsTestMode.active }}

  {{ var $cActionTestModeOn = $wsActions.create("TestModeOn") }}

  {{ if $cActionTestModeOn.error }}
    Errors occurred:
    {{ foreach $error in $cActionTestModeOn.errors }}
      {{ if $error.text }}
          {{= $error.text }}
        {{ else }}
          {{= $error.code }}
      {{ /if }}
    {{ /foreach }}
  {{ /if }}

  <form action="{{= $wsViews.current.url() }}" method="post">
    <input type="hidden" name="wscsrf" value="{{= $cActionTestModeOn.csrf }}">
    <input type="hidden" name="wsact" value="{{= $cActionTestModeOn.id }}">
    <input type="hidden" name="wstarget" value="/">
    
    <input type="password" name="password" placeholder="Password">
    <label for="password">Password</label>
    
    <input type="checkbox" name="debug" value="on" {{ if $wsTestMode.debug }} checked{{ /if }}>
    <label class="form-check-label wsCursorPointer">Debug</label>
    
    <button name="wsact" value="{{= $cActionTestModeOn.id }}">Activate test mode</button>
  </form>
  
  {{ else}}
 
 {{ var $cActionTestModeOff = $wsActions.create("TestModeOff") }}
  
  {{ if $cActionTestModeOff.error }}
    Errors occurred:
    {{ foreach $error in $cActionTestModeOff.errors }}
      {{ if $error.text }}
          {{= $error.text }}
        {{ else }}
          {{= $error.code }}
      {{ /if }}
    {{ /foreach }}
  {{ /if }}
  
  <form action="{{= $wsViews.current.url() }}" method="post">
    <input type="hidden" name="wscsrf" value="{{= $cActionTestModeOff.csrf }}">
    <input type="hidden" name="wsact" value="{{= $cActionTestModeOff.id }}">
    <input type="hidden" name="wstarget" value="/">
    <button name="wsact" value="{{= $cActionTestModeOff.id }}">Deactivate test mode</button>
  </form>
 
 
{{ /if }}

Change test mode

There is the option to end the test mode debugging function without ending the test mode at the same time.
{{ if not $wsTestMode.active }}
  ...  
{{ else}}
  ...
  {{ var $cActionTestModeChange = $wsActions.create("TestModeChange") }}

  {{ if $cActionTestModeChange.error }}
    Errors occurred:
    {{ foreach $error in $cActionTestModeChange.errors }}
      {{ if $error.text }}
          {{= $error.text }}
        {{ else }}
          {{= $error.code }}
      {{ /if }}
    {{ /foreach }}
  {{ /if }}

  <form action="{{= $wsViews.current.url() }}" method="post">
    <input type="hidden" name="wscsrf" value="{{= $cActionTestModeChange.csrf }}">
    <input type="hidden" name="wsact" value="{{= $cActionTestModeChange.id }}">
    <input type="hidden" name="wstarget" value="/">

    <input type="checkbox" name="debug" value="on" {{ if $wsTestMode.debug }} checked{{ /if }}>
    <label>Debug</label>
    <button name="wsact" value="{{= $cActionTestModeChange.id }}">Apply setting</button>
  </form>
{{ /if }}