themes-details.html.twig 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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. {% set state = 'inactive' %}
  6. {% if (config.get('system.pages.theme') == theme.slug) %}{% set state = 'active' %}{% endif %}
  7. <div class="grav-update theme" data-gpm-theme="{{ admin.route }}">
  8. </div>
  9. <h1>
  10. {{ theme.name }}
  11. {% if admin.isTeamGrav(theme) %}
  12. <small><span class="info-reverse"><i class="fa fa-check-circle" title="{{ "PLUGIN_ADMIN.GRAV_OFFICIAL_THEME"|t }}"></i></span></small>
  13. {% endif %}
  14. {% if admin.isPremiumProduct(theme) %}
  15. <small><span class="badge warning premium"><i class="fa fa-star-o"></i> {{ "PLUGIN_ADMIN.PREMIUM_PRODUCT"|t }}</span></small>
  16. {% endif %}
  17. {% if theme.symlink %}
  18. <small class="hint--bottom" data-hint="{{ "PLUGIN_ADMIN.THEME_SYMBOLICALLY_LINKED"|t }}">
  19. <i class="fa fa-fw fa-link"></i>
  20. </small>
  21. {% endif %}
  22. <small>{{ theme.version ? 'v' ~ theme.version }}</small>
  23. {% if isTestingRelease %}<span class="gpm-testing">test release</span>{% endif %}
  24. </h1>
  25. <div class="gpm-item-info">
  26. <i class="gpm-item-icon fa fa-fw fa-{{ theme.icon }}"></i>
  27. <table>
  28. {% if theme.version %}
  29. <tr>
  30. <td>{{ "PLUGIN_ADMIN.VERSION"|t }}:</td>
  31. <td class="double">{{ theme.version }}</td>
  32. </tr>
  33. {% endif %}
  34. {% if theme.author %}
  35. <tr>
  36. <td>{{ "PLUGIN_ADMIN.AUTHOR"|t }}:</td>
  37. <td class="double">
  38. {% if theme.author.url %}
  39. <a href="{{ theme.author.url }}" target="_blank" rel="noopener noreferrer">{{ theme.author.name }}</a>
  40. {% else %}
  41. {{ theme.author.name }}
  42. {% endif %}
  43. {% if theme.author.email %}
  44. - <a href="mailto:{{ theme.author.email }}">{{ theme.author.email }}</a>
  45. {% endif %}
  46. </td>
  47. </tr>
  48. {% endif %}
  49. {% if theme.homepage %}
  50. <tr>
  51. <td>{{ "PLUGIN_ADMIN.HOMEPAGE"|t }}:</td>
  52. <td class="double"><a href="{{ theme.homepage }}" target="_blank" rel="noopener noreferrer">{{ theme.homepage }}</a></td>
  53. </tr>
  54. {% endif %}
  55. {% if theme.demo %}
  56. <tr>
  57. <td>{{ "PLUGIN_ADMIN.DEMO"|t }}:</td>
  58. <td class="double"><a href="{{ theme.demo }}" target="_blank" rel="noopener noreferrer">{{ theme.demo }}</a></td>
  59. </tr>
  60. {% endif %}
  61. {% if theme.bugs %}
  62. <tr>
  63. <td>{{ "PLUGIN_ADMIN.BUG_TRACKER"|t }}:</td>
  64. <td class="double"><a href="{{ theme.bugs }}" target="_blank" rel="noopener noreferrer">{{ theme.bugs }}</a></td>
  65. </tr>
  66. {% endif %}
  67. {% if theme.keywords %}
  68. <tr>
  69. <td>{{ "PLUGIN_ADMIN.KEYWORDS"|t }}:</td>
  70. <td class="double">
  71. {{ theme.keywords|join(', ') }}
  72. </td>
  73. </tr>
  74. {% endif %}
  75. {% if theme.license %}
  76. <tr>
  77. <td>{{ "PLUGIN_ADMIN.LICENSE"|t }}:</td>
  78. {% if theme.license|starts_with('http') %}
  79. <td class="double"><a href="{{ theme.license }}" target="_blank">{{ theme.license }}</a></td>
  80. {% else %}
  81. <td class="double">{{ theme.license }}</td>
  82. {% endif %}
  83. </tr>
  84. {% endif %}
  85. {% if theme.description %}
  86. <tr>
  87. <td>{{ "PLUGIN_ADMIN.DESCRIPTION"|t }}:</td>
  88. <td class="double">{{ theme.description_html|raw }}</td>
  89. </tr>
  90. {% endif %}
  91. {% if theme.readme or theme.homepage %}
  92. {% set readme_link = theme.readme ?: theme.docs|default(theme.homepage ~ '/blob/master/README.md') %}
  93. <tr>
  94. <td>{{ theme.readme ? "PLUGIN_ADMIN.README"|t : "PLUGIN_ADMIN.DOCS"|t }}:</td>
  95. <td class="double"><a href="{{ readme_link }}" target="_blank" rel="noopener noreferrer">{{ readme_link }}</a></td>
  96. </tr>
  97. {% endif %}
  98. {% if admin.gpm.findPackage(theme.slug, true).changelog %}
  99. <tr>
  100. <td>{{ "PLUGIN_ADMIN.CHANGELOG"|t }}:</td>
  101. <td class="double"><a class="button button-small" href="#" data-remodal-target="changelog" data-remodal-changelog="{{ admin_route('/changelog/slug:' ~ theme.slug) }}"><i class="fa fa-binoculars"></i> View Changelog</a></td>
  102. </tr>
  103. {% endif %}
  104. </table>
  105. </div>
  106. {% if installed %}
  107. {% if state == 'active' %}
  108. {% set data = admin.data('themes/' ~ admin.route) %}
  109. {% include 'partials/blueprints.html.twig' with { data: data, blueprints: data.blueprints } %}
  110. {% else %}
  111. <div class="theme" data-gpm-theme="{{ theme.slug }}" data-gpm-name="{{ theme.name }}">
  112. <div style="display:none;" class="gpm-name"><a>{{ theme.name }}</a></div>
  113. <form>
  114. <div class="form-field grid">
  115. <div class="form-label block size-1-3">
  116. <label>{{ "PLUGIN_ADMIN.ACTIVATION_REQUIRED"|t }}</label>
  117. </div>
  118. <div class="form-data block size-2-3">
  119. <a class="button gpm-actions" data-remodal-target="theme-switch-warn" href="{{ uri.addNonce(base_url_relative ~ '/themes/' ~ theme.slug ~ '/task' ~ config.system.param_sep ~ 'activate', 'admin-form', 'admin-nonce') }}">
  120. <i class="fa fa-power-off" aria-hidden="true"></i> {{ "PLUGIN_ADMIN.ACTIVATE"|t }} <strong>{{ theme.name }}</strong>
  121. </a>
  122. </div>
  123. </div>
  124. </form>
  125. </div>
  126. <div class="button-bar danger">
  127. <span class="danger-zone"></span>
  128. {% if not theme.symlink %}
  129. <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"|t }}</a>
  130. {% endif %}
  131. <a class="button" href="#" data-remodal-target="remove-package"><i class="fa fa-fw fa-warning"></i> {{ "PLUGIN_ADMIN.REMOVE_THEME"|t }}</a>
  132. </div>
  133. {% endif %}
  134. {% else %}
  135. <div class="button-bar success">
  136. {% if (theme.premium and not admin.license(theme.slug)) %}
  137. {% if not gumroad_loaded %}
  138. {% set gumroad_loaded = true %}
  139. <script src="//gumroad.com/js/gumroad.js"></script>
  140. {% endif %}
  141. <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>
  142. {% else %}
  143. <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"|t }}</a>
  144. {% endif %}
  145. </div>
  146. {% endif %}
  147. {% include 'partials/modal-switch-theme.html.twig' with {theme_name: theme.name} %}
  148. {% include 'partials/modal-changes-detected.html.twig' %}
  149. {% include 'partials/modal-add-package.html.twig' with { type: 'theme' } %}
  150. {% include 'partials/modal-update-packages.html.twig' with { type: 'theme' } %}
  151. {% include 'partials/modal-remove-package.html.twig' with { type: 'theme', package: theme } %}
  152. {% include 'partials/modal-reinstall-package.html.twig' with { type: 'theme', package: theme } %}
  153. {% include 'partials/modal-changelog.html.twig' with { package: theme} %}