tools-scheduler.html.twig 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <div class="scheduler-content">
  2. {% set data = admin.data('config/scheduler') %}
  3. {% set cron_status = grav.scheduler.isCrontabSetup() %}
  4. {% set user = grav.scheduler.whoami() %}
  5. {% if cron_status == 1 %}
  6. <div class="alert notice secondary-accent">
  7. <div id="show-instructions" class="button button-small"><i class="fa fa-clock-o"></i> {{ "PLUGIN_ADMIN.SCHEDULER_INSTALL_INSTRUCTIONS"|t }}</div>
  8. <i class="fa fa-check"></i> {{ "PLUGIN_ADMIN.SCHEDULER_INSTALLED_READY"|t }}
  9. </div>
  10. {% elseif cron_status == 2 %}
  11. <div class="alert warning"> {{ "PLUGIN_ADMIN.SCHEDULER_CRON_NA"|t([user])|raw }}</div>
  12. {% else %}
  13. <div class="alert warning"> {{ "PLUGIN_ADMIN.SCHEDULER_NOT_ENABLED"|t([user])|raw }}</div>
  14. {% endif %}
  15. <div class="alert notice"><i class="fa fa-exclamation-circle"></i> {{ "PLUGIN_ADMIN.SCHEDULER_WARNING"|t([user]) }}</div>
  16. <div id="cron-install" class="form-border overlay {{ cron_status == 1 ? 'hide' : ''}}">
  17. <pre><code>{{- grav.scheduler.getCronCommand()|trim -}}</code></pre>
  18. <p>{{ "PLUGIN_ADMIN.SCHEDULER_POST_INSTRUCTIONS"|t([user])|raw }}</p>
  19. </div>
  20. {% include 'partials/blueprints.html.twig' with { blueprints: data.blueprints, data: data } %}
  21. {% include 'partials/modal-changes-detected.html.twig' %}
  22. <script>
  23. $('#show-instructions').click(function() {
  24. $('#cron-install').toggleClass( "hide" );
  25. });
  26. </script>
  27. </div>