backups-button.html.twig 989 B

123456789101112131415161718192021
  1. <div class="button-group">
  2. {% set profiles = grav.backups.getBackupProfiles() %}
  3. {% set backup_url = uri.addNonce(base_url_relative ~ "/backup.json/id" ~ config.system.param_sep ~ "%BACKUP_ID/task" ~ config.system.param_sep ~ "backup", 'admin-form', 'admin-nonce') %}
  4. <button class="button" data-backup data-ajax="{{ backup_url|replace({'%BACKUP_ID':'0'}) }}">
  5. <i class="fa fa-life-ring"></i> {{ "PLUGIN_ADMIN.BACKUP_NOW"|t }}
  6. </button>
  7. <button type="button" class="button dropdown-toggle" data-toggle="dropdown">
  8. <i class="fa fa-caret-down"></i>
  9. </button>
  10. <ul class="dropdown-menu">
  11. {% for id, profile in profiles %}
  12. <li>
  13. <a data-backup data-ajax="{{ backup_url|replace({'%BACKUP_ID':id}) }}" class="button">{{ profile.name }}</a>
  14. </li>
  15. {% endfor %}
  16. <li>
  17. <a href="{{ admin_route('/tools/backups') }}" class="button">Backups Manager</a>
  18. </li>
  19. </ul>
  20. </div>