plugins-details.html.twig 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. {% set gpm = admin.gpm() %}
  2. {% set installed = gpm.isPluginInstalled(admin.route) %}
  3. {% set isTestingRelease = gpm.isTestingRelease(plugin.slug) %}
  4. {% set gumroad_loaded = false %}
  5. <div class="grav-update plugin" data-gpm-plugin="{{ admin.route }}">
  6. </div>
  7. <h1>
  8. {{ plugin.name|e }}
  9. {% if admin.isTeamGrav(plugin) %}
  10. <small><span class="info-reverse"><i class="fa fa-check-circle" title="{{ "PLUGIN_ADMIN.GRAV_OFFICIAL_PLUGIN"|tu }}"></i></span></small>
  11. {% endif %}
  12. {% if admin.isPremiumProduct(plugin) %}
  13. <small><span class="badge warning premium"><i class="fa fa-star-o"></i> {{ "PLUGIN_ADMIN.PREMIUM_PRODUCT"|tu }}</span></small>
  14. {% endif %}
  15. {% if plugin.symlink %}
  16. <small class="hint--bottom" data-hint="{{ "PLUGIN_ADMIN.PLUGIN_SYMBOLICALLY_LINKED"|tu }}">
  17. <i class="fa fa-fw fa-link"></i>
  18. </small>
  19. {% endif %}
  20. <small>{{ plugin.version ? 'v' ~ plugin.version|e }}</small>
  21. {% if isTestingRelease %}<span class="gpm-testing">test release</span>{% endif %}
  22. </h1>
  23. <div class="gpm-item-info">
  24. <i class="gpm-item-icon fa fa-fw fa-{{ plugin.icon }}"></i>
  25. {% include 'partials/plugin-data.html.twig' with { plugin: plugin } %}
  26. </div>
  27. {% if (installed) %}
  28. {% set data = admin.data('plugins/' ~ admin.route) %}
  29. {% include 'partials/blueprints.html.twig' with { data: data, blueprints: data.blueprints } %}
  30. {% if (plugin.form.fields.enabled.type != 'hidden' and plugin.form.fields.tabs.fields.login.fields.enabled.type != 'hidden') %}
  31. <div class="button-bar danger">
  32. <span class="danger-zone"></span>
  33. {% if not plugin.symlink %}
  34. <a class="button button-reinstall-package hidden" href="#" data-remodal-target="reinstall-package"><i class="fa fa-fw fa-repeat"></i> {{ "PLUGIN_ADMIN.REINSTALL_PLUGIN"|tu }}</a>
  35. {% endif %}
  36. <a class="button" href="#" data-remodal-target="remove-package"><i class="fa fa-fw fa-warning"></i> {{ "PLUGIN_ADMIN.REMOVE_PLUGIN"|tu }}</a>
  37. </div>
  38. {% endif %}
  39. {% else %}
  40. <div class="button-bar success">
  41. {% if (plugin.premium and not admin.license(plugin.slug)) %}
  42. {% if not gumroad_loaded %}
  43. {% set gumroad_loaded = true %}
  44. <script src="//gumroad.com/js/gumroad.js"></script>
  45. {% endif %}
  46. <a class="gumroad-button button" href="https://gum.co/{{ plugin.premium.product_permalink }}" target="_blank" data-gumroad-single-product="true"><i class="fa fa-shopping-cart"></i> {{ "Buy Now"|tu }}</a>
  47. {% else %}
  48. <a class="button" href="#" data-remodal-target="add-package" data-packages-slugs="{{ plugin.slug }}" data-plugin-action="start-package-installation"><i class="fa fa-plus"></i> {{ "PLUGIN_ADMIN.INSTALL_PLUGIN"|tu }}</a>
  49. {% endif %}
  50. </div>
  51. {% endif %}
  52. {% include 'partials/modal-changes-detected.html.twig' %}
  53. {% include 'partials/modal-add-package.html.twig' with { type: 'plugin' } %}
  54. {% include 'partials/modal-update-packages.html.twig' with { type: 'plugin' } %}
  55. {% include 'partials/modal-remove-package.html.twig' with { type: 'plugin', package: plugin } %}
  56. {% include 'partials/modal-reinstall-package.html.twig' with { type: 'plugin', package: plugin } %}