themes-details.html.twig 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. {% set gpm = admin.gpm() %}
  2. {% set installed = gpm.isThemeInstalled(admin.route) %}
  3. {% set isTestingRelease = gpm.isTestingRelease(plugin.slug) %}
  4. <div class="grav-update theme" data-gpm-theme="{{ admin.route }}">
  5. </div>
  6. <h1>
  7. {{ theme.name|e }}
  8. {% if admin.isTeamGrav(theme) %}
  9. <small><span class="info-reverse"><i class="fa fa-check-circle" title="{{ "PLUGIN_ADMIN.GRAV_OFFICIAL_THEME"|tu }}"></i></span></small>
  10. {% endif %}
  11. {% if admin.isPremiumProduct(theme) %}
  12. <small><span class="badge warning premium"><i class="fa fa-star-o"></i> {{ "PLUGIN_ADMIN.PREMIUM_PRODUCT"|tu }}</span></small>
  13. {% endif %}
  14. {% if theme.symlink %}
  15. <small class="hint--bottom" data-hint="{{ "PLUGIN_ADMIN.THEME_SYMBOLICALLY_LINKED"|tu }}">
  16. <i class="fa fa-fw fa-link"></i>
  17. </small>
  18. {% endif %}
  19. <small>{{ theme.version ? 'v' ~ theme.version|e }}</small>
  20. {% if isTestingRelease %}<span class="gpm-testing">test release</span>{% endif %}
  21. </h1>
  22. <div class="gpm-item-info">
  23. <i class="gpm-item-icon fa fa-fw fa-{{ theme.icon }}"></i>
  24. <table>
  25. {% if theme.version %}
  26. <tr>
  27. <td>{{ "PLUGIN_ADMIN.VERSION"|tu }}:</td>
  28. <td class="double">{{ theme.version }}</td>
  29. </tr>
  30. {% endif %}
  31. {% if theme.author %}
  32. <tr>
  33. <td>{{ "PLUGIN_ADMIN.AUTHOR"|tu }}:</td>
  34. <td class="double">
  35. {% if theme.author.url %}
  36. <a href="{{ theme.author.url }}" target="_blank">{{ theme.author.name }}</a>
  37. {% else %}
  38. {{ theme.author.name }}
  39. {% endif %}
  40. {% if theme.author.email %}
  41. - <a href="mailto:{{ theme.author.email }}">{{ theme.author.email }}</a>
  42. {% endif %}
  43. </td>
  44. </tr>
  45. {% endif %}
  46. {% if theme.homepage %}
  47. <tr>
  48. <td>{{ "PLUGIN_ADMIN.HOMEPAGE"|tu }}:</td>
  49. <td class="double"><a href="{{ theme.homepage }}" target="_blank">{{ theme.homepage }}</a></td>
  50. </tr>
  51. {% endif %}
  52. {% if theme.demo %}
  53. <tr>
  54. <td>{{ "PLUGIN_ADMIN.DEMO"|tu }}:</td>
  55. <td class="double"><a href="{{ theme.demo }}" target="_blank">{{ theme.demo }}</a></td>
  56. </tr>
  57. {% endif %}
  58. {% if theme.bugs %}
  59. <tr>
  60. <td>{{ "PLUGIN_ADMIN.BUG_TRACKER"|tu }}:</td>
  61. <td class="double"><a href="{{ theme.bugs }}" target="_blank">{{ theme.bugs }}</a></td>
  62. </tr>
  63. {% endif %}
  64. {% if theme.keywords %}
  65. <tr>
  66. <td>{{ "PLUGIN_ADMIN.KEYWORDS"|tu }}:</td>
  67. <td class="double">
  68. {{ theme.keywords|join(', ') }}
  69. </td>
  70. </tr>
  71. {% endif %}
  72. {% if theme.license %}
  73. <tr>
  74. <td>{{ "PLUGIN_ADMIN.LICENSE"|tu }}:</td>
  75. <td class="double">{{ theme.license }}</td>
  76. </tr>
  77. {% endif %}
  78. {% if theme.description %}
  79. <tr>
  80. <td>{{ "PLUGIN_ADMIN.DESCRIPTION"|tu }}:</td>
  81. <td class="double">{{ theme.description_html|raw }}</td>
  82. </tr>
  83. {% endif %}
  84. {% if theme.readme or theme.homepage %}
  85. {% set readme_link = theme.readme ?: theme.homepage ~ '/blob/master/README.md' %}
  86. <tr>
  87. <td>{{ "PLUGIN_ADMIN.README"|tu }}:</td>
  88. <td class="double"><a href="{{ readme_link }}" target="_blank">{{ readme_link }}</a></td>
  89. </tr>
  90. {% endif %}
  91. </table>
  92. </div>
  93. {% if (installed) %}
  94. {% set data = admin.data('themes/' ~ admin.route) %}
  95. {% include 'partials/blueprints.html.twig' with { data: data, blueprints: data.blueprints } %}
  96. {% if (config.get('system.pages.theme') != admin.route) %}
  97. <div class="button-bar danger">
  98. <span class="danger-zone"></span>
  99. {% if not theme.symlink %}
  100. <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>
  101. {% endif %}
  102. <a class="button" href="#" data-remodal-target="remove-package"><i class="fa fa-fw fa-warning"></i> {{ "PLUGIN_ADMIN.REMOVE_THEME"|tu }}</a>
  103. </div>
  104. {% endif %}
  105. {% else %}
  106. <div class="button-bar success">
  107. <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>
  108. </div>
  109. {% endif %}
  110. {% include 'partials/modal-changes-detected.html.twig' %}
  111. {% include 'partials/modal-remove-package.html.twig' with { type: 'theme', package: theme } %}
  112. {% include 'partials/modal-add-package.html.twig' with { type: 'theme' } %}
  113. {% include 'partials/modal-update-packages.html.twig' with { type: 'theme' } %}
  114. {% include 'partials/modal-reinstall-package.html.twig' with { type: 'theme', package: theme } %}