themes-list.html.twig 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <div class="grav-update themes"></div>
  2. {% if installing %}
  3. {% include 'partials/release-toggle.html.twig' %}
  4. {% endif %}
  5. {% include 'partials/list-sort.html.twig' with { list_view: 'themes' } %}
  6. <h1>
  7. {{ installing ? "PLUGIN_ADMIN.AVAILABLE_THEMES"|tu : "PLUGIN_ADMIN.INSTALLED_THEMES"|tu }}
  8. </h1>
  9. <form>
  10. <div class="gpm-search">
  11. <input type="text" placeholder="{{ "PLUGIN_ADMIN.RESOURCE_FILTER"|tu }}" data-gpm-filter>
  12. </div>
  13. </form>
  14. <div class="themes card-row grid fixed-blocks pure-g">
  15. {% for slug, theme in admin.themes(not installing).toArray|ksort %}
  16. {% set state = 'inactive' %}
  17. {% if (installing) %}{% set state = 'installing' %}{% endif %}
  18. {% if (config.get('system.pages.theme') == slug) %}{% set state = 'active' %}{% endif %}
  19. {% set isTestingRelease = admin.gpm.isTestingRelease(slug) %}
  20. {% set releaseDate = theme.date ?: admin.gpm.findPackage(slug, true).date %}
  21. <div class="theme card-item pure-u-1-3 {{ state }}-theme" data-gpm-theme="{{ slug|url_encode }}" data-gpm-name="{{ theme.name }}" data-gpm-release-date="{{ releaseDate }}" data-gpm-author="{{ theme.author.name }}" data-gpm-official="{{ admin.isTeamGrav(theme) ? '1' : '2' }}" data-gpm-updatable="{{ admin.gpm.isUpdatable(slug) ? '1' : '2' }}" data-gpm-enabled="{{ data.get('enabled') ? '1' : '2' }}" data-gpm-testing="{{ isTestingRelease ? '1' : '2' }}">
  22. <div class="gpm-name">
  23. <i class="fa fa-fw fa-{{ theme.icon }}"></i>
  24. <a href="{{ base_url_relative }}/themes/{{ slug|url_encode }}">{{ theme.name }}</a>
  25. {% if admin.isTeamGrav(theme) %}
  26. <small><span class="info-reverse"><i class="fa fa-check-circle" title="{{ "PLUGIN_ADMIN.GRAV_OFFICIAL_THEME"|tu }}"></i></span></small>
  27. {% endif %}
  28. {% if admin.isPremiumProduct(theme) %}
  29. <small><span class="badge warning premium"><i class="fa fa-star-o"></i> {{ "PLUGIN_ADMIN.PREMIUM_PRODUCT"|tu }}</span></small>
  30. {% endif %}
  31. {% if theme.symlink %}
  32. <span class="hint--bottom" data-hint="{{ "PLUGIN_ADMIN.THEME_SYMBOLICALLY_LINKED"|tu }}">
  33. <i class="fa fa-fw fa-link"></i>
  34. </span>
  35. {% endif %}
  36. <span class="gpm-version">v{{ theme.version }}</span>
  37. {% if isTestingRelease %}<span class="gpm-testing">test release</span>{% endif %}
  38. </div>
  39. <div class="gpm-screenshot">
  40. {% set thumb = installing ? '//getgrav.org/images/' ~ theme.screenshot : theme.thumbnail %}
  41. <a href="{{ base_url_relative }}/themes/{{ slug|url_encode }}"><img src="{{ thumb }}" /></a>
  42. </div>
  43. {% if (state == 'installing') %}
  44. <div class="gpm-actions">
  45. <a class="button" href="#" data-remodal-target="add-package" data-packages-slugs="{{ slug }}" data-theme-action="start-package-installation"><i class="fa fa-plus"></i> {{ "PLUGIN_ADMIN.INSTALL"|tu }}</a>
  46. </div>
  47. {% elseif state == 'active' %}
  48. <div class="gpm-actions">
  49. <i class="fa fa-star"></i> {{ "PLUGIN_ADMIN.ACTIVE_THEME"|tu }}
  50. </div>
  51. {% else %}
  52. <a data-remodal-target="theme-switch-warn" href="{{ uri.addNonce(base_url_relative ~ '/themes/' ~ slug ~ '/task' ~ config.system.param_sep ~ 'activate', 'admin-form', 'admin-nonce') }}" class="gpm-actions">
  53. {{ "PLUGIN_ADMIN.ACTIVATE"|tu }}
  54. </a>
  55. {% endif %}
  56. </div>
  57. {% else %}
  58. <tr><td>{{ "PLUGIN_ADMIN.OFFLINE_WARNING"|tu }}</td></tr>
  59. {% endfor %}
  60. </div>
  61. <div class="remodal theme-switcher" data-remodal-id="theme-switch-warn" data-remodal-options="hashTracking: false">
  62. <form>
  63. <h1>{{ "PLUGIN_ADMIN.SWITCHING_TO"|tu }} <strong>{theme_name}</strong></h1>
  64. <p class="bigger">
  65. {{ "PLUGIN_ADMIN.SWITCHING_TO_DESCRIPTION"|tu }}
  66. </p>
  67. <p class="bigger">
  68. {{ "PLUGIN_ADMIN.SWITCHING_TO_CONFIRMATION"|tu }} <strong>{theme_name}</strong>?
  69. </p>
  70. <br>
  71. <div class="button-bar">
  72. <button data-remodal-action="cancel" class="button secondary remodal-cancel"><i class="fa fa-fw fa-close"></i> {{ "PLUGIN_ADMIN.CANCEL"|tu }}</button>
  73. <a class="button continue" href="#"><i class="fa fa-fw fa-check"></i>{{ "PLUGIN_ADMIN.CONTINUE"|tu }}</a>
  74. </div>
  75. </form>
  76. </div>
  77. {% include 'partials/modal-add-package.html.twig' with { type: 'theme' } %}
  78. {% include 'partials/modal-update-packages.html.twig' with { type: 'theme' } %}