themes-details.html.twig 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. {% set gpm = admin.gpm() %}
  2. {% set installed = gpm.isThemeInstalled(admin.route) %}
  3. {% set isTestingRelease = gpm.isTestingRelease(theme.slug) %}
  4. {% set gumroad_loaded = false %}
  5. <div class="grav-update theme" data-gpm-theme="{{ admin.route }}">
  6. </div>
  7. <h1>
  8. {{ theme.name|e }}
  9. {% if admin.isTeamGrav(theme) %}
  10. <small><span class="info-reverse"><i class="fa fa-check-circle" title="{{ "PLUGIN_ADMIN.GRAV_OFFICIAL_THEME"|tu }}"></i></span></small>
  11. {% endif %}
  12. {% if admin.isPremiumProduct(theme) %}
  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 theme.symlink %}
  16. <small class="hint--bottom" data-hint="{{ "PLUGIN_ADMIN.THEME_SYMBOLICALLY_LINKED"|tu }}">
  17. <i class="fa fa-fw fa-link"></i>
  18. </small>
  19. {% endif %}
  20. <small>{{ theme.version ? 'v' ~ theme.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-{{ theme.icon }}"></i>
  25. <table>
  26. {% if theme.version %}
  27. <tr>
  28. <td>{{ "PLUGIN_ADMIN.VERSION"|tu }}:</td>
  29. <td class="double">{{ theme.version }}</td>
  30. </tr>
  31. {% endif %}
  32. {% if theme.author %}
  33. <tr>
  34. <td>{{ "PLUGIN_ADMIN.AUTHOR"|tu }}:</td>
  35. <td class="double">
  36. {% if theme.author.url %}
  37. <a href="{{ theme.author.url }}" target="_blank" rel="noopener noreferrer">{{ theme.author.name }}</a>
  38. {% else %}
  39. {{ theme.author.name }}
  40. {% endif %}
  41. {% if theme.author.email %}
  42. - <a href="mailto:{{ theme.author.email }}">{{ theme.author.email }}</a>
  43. {% endif %}
  44. </td>
  45. </tr>
  46. {% endif %}
  47. {% if theme.homepage %}
  48. <tr>
  49. <td>{{ "PLUGIN_ADMIN.HOMEPAGE"|tu }}:</td>
  50. <td class="double"><a href="{{ theme.homepage }}" target="_blank" rel="noopener noreferrer">{{ theme.homepage }}</a></td>
  51. </tr>
  52. {% endif %}
  53. {% if theme.demo %}
  54. <tr>
  55. <td>{{ "PLUGIN_ADMIN.DEMO"|tu }}:</td>
  56. <td class="double"><a href="{{ theme.demo }}" target="_blank" rel="noopener noreferrer">{{ theme.demo }}</a></td>
  57. </tr>
  58. {% endif %}
  59. {% if theme.bugs %}
  60. <tr>
  61. <td>{{ "PLUGIN_ADMIN.BUG_TRACKER"|tu }}:</td>
  62. <td class="double"><a href="{{ theme.bugs }}" target="_blank" rel="noopener noreferrer">{{ theme.bugs }}</a></td>
  63. </tr>
  64. {% endif %}
  65. {% if theme.keywords %}
  66. <tr>
  67. <td>{{ "PLUGIN_ADMIN.KEYWORDS"|tu }}:</td>
  68. <td class="double">
  69. {{ theme.keywords|join(', ') }}
  70. </td>
  71. </tr>
  72. {% endif %}
  73. {% if theme.license %}
  74. <tr>
  75. <td>{{ "PLUGIN_ADMIN.LICENSE"|tu }}:</td>
  76. {% if theme.license|starts_with('http') %}
  77. <td class="double"><a href="{{ theme.license }}" target="_blank">{{ theme.license }}</a></td>
  78. {% else %}
  79. <td class="double">{{ theme.license }}</td>
  80. {% endif %}
  81. </tr>
  82. {% endif %}
  83. {% if theme.description %}
  84. <tr>
  85. <td>{{ "PLUGIN_ADMIN.DESCRIPTION"|tu }}:</td>
  86. <td class="double">{{ theme.description_html|raw }}</td>
  87. </tr>
  88. {% endif %}
  89. {% if theme.readme or theme.homepage %}
  90. {% set readme_link = theme.readme ?: theme.docs|default(theme.homepage ~ '/blob/master/README.md') %}
  91. <tr>
  92. <td>{{ theme.readme ? "PLUGIN_ADMIN.README"|tu : "PLUGIN_ADMIN.DOCS"|tu }}:</td>
  93. <td class="double"><a href="{{ readme_link }}" target="_blank" rel="noopener noreferrer">{{ readme_link }}</a></td>
  94. </tr>
  95. {% endif %}
  96. </table>
  97. </div>
  98. {% if (installed) %}
  99. {% set data = admin.data('themes/' ~ admin.route) %}
  100. {% include 'partials/blueprints.html.twig' with { data: data, blueprints: data.blueprints } %}
  101. {% if (config.get('system.pages.theme') != admin.route) %}
  102. <div class="button-bar danger">
  103. <span class="danger-zone"></span>
  104. {% if not theme.symlink %}
  105. <a class="button button-reinstall-package hidden" href="#" data-remodal-target="reinstall-package"><i class="fa fa-fw fa-repeat"></i> {{ "PLUGIN_ADMIN.REINSTALL_THEME"|tu }}</a>
  106. {% endif %}
  107. <a class="button" href="#" data-remodal-target="remove-package"><i class="fa fa-fw fa-warning"></i> {{ "PLUGIN_ADMIN.REMOVE_THEME"|tu }}</a>
  108. </div>
  109. {% endif %}
  110. {% else %}
  111. <div class="button-bar success">
  112. {% if (theme.premium and not admin.license(theme.slug)) %}
  113. {% if not gumroad_loaded %}
  114. {% set gumroad_loaded = true %}
  115. <script src="//gumroad.com/js/gumroad.js"></script>
  116. {% endif %}
  117. <a class="gumroad-button button" href="https://gum.co/{{ theme.premium.permalink }}" target="_blank" data-gumroad-single-product="true"><i class="fa fa-shopping-cart"></i> {{ theme.premium.button|default('Purchase') }}</a>
  118. {% else %}
  119. <a class="button" href="#" data-remodal-target="add-package" data-packages-slugs="{{ theme.slug }}" data-theme-action="start-package-installation"><i class="fa fa-plus"></i> {{ "PLUGIN_ADMIN.INSTALL_THEME"|tu }}</a>
  120. {% endif %}
  121. </div>
  122. {% endif %}
  123. {% include 'partials/modal-changes-detected.html.twig' %}
  124. {% include 'partials/modal-add-package.html.twig' with { type: 'theme' } %}
  125. {% include 'partials/modal-update-packages.html.twig' with { type: 'theme' } %}
  126. {% include 'partials/modal-remove-package.html.twig' with { type: 'theme', package: theme } %}
  127. {% include 'partials/modal-reinstall-package.html.twig' with { type: 'theme', package: theme } %}