apps.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <?php
  2. style('settings', 'settings');
  3. vendor_script(
  4. 'core',
  5. [
  6. 'handlebars/handlebars',
  7. 'marked/marked.min',
  8. 'DOMPurify/dist/purify.min',
  9. ]
  10. );
  11. script(
  12. 'settings',
  13. [
  14. 'settings',
  15. 'apps',
  16. ]
  17. );
  18. /** @var array $_ */
  19. ?>
  20. <script id="categories-template" type="text/x-handlebars-template">
  21. {{#each this}}
  22. <li id="app-category-{{ident}}" data-category-id="{{ident}}" tabindex="0">
  23. <a href="#">{{displayName}}</a>
  24. </li>
  25. {{/each}}
  26. <?php if($_['appstoreEnabled']): ?>
  27. <li>
  28. <a class="app-external" target="_blank" rel="noreferrer" href="https://docs.nextcloud.org/server/12/developer_manual/"><?php p($l->t('Developer documentation'));?> ↗</a>
  29. </li>
  30. <?php endif; ?>
  31. </script>
  32. <script id="app-template" type="text/x-handlebars">
  33. <div class="section" id="app-{{id}}">
  34. {{#if preview}}
  35. <div class="app-image{{#if previewAsIcon}} app-image-icon{{/if}} hidden">
  36. </div>
  37. {{/if}}
  38. <h2 class="app-name">
  39. {{#if detailpage}}
  40. <a href="{{detailpage}}" target="_blank" rel="noreferrer">{{name}}</a>
  41. {{else}}
  42. {{name}}
  43. {{/if}}
  44. </h2>
  45. <div class="app-version"> {{version}}</div>
  46. {{#if profilepage}}<a href="{{profilepage}}" target="_blank" rel="noreferrer">{{/if}}
  47. <div class="app-author"><?php p($l->t('by %s', ['{{author}}']));?>
  48. {{#if licence}}
  49. (<?php p($l->t('%s-licensed', ['{{licence}}'])); ?>)
  50. {{/if}}
  51. </div>
  52. {{#if profilepage}}</a>{{/if}}
  53. <div class="app-level">
  54. {{{level}}}
  55. </div>
  56. {{#if ratingNumThresholdReached }}
  57. <div class="app-score">{{{score}}}</div>
  58. {{/if}}
  59. <div class="app-detailpage"></div>
  60. <div class="app-description-container hidden">
  61. <div class="app-description">{{{description}}}</div>
  62. <!--<div class="app-changed">{{changed}}</div>-->
  63. {{#if documentation}}
  64. <p class="documentation">
  65. <?php p($l->t("Documentation:"));?>
  66. {{#if documentation.user}}
  67. <span class="userDocumentation">
  68. <a id="userDocumentation" class="appslink" href="{{documentation.user}}" target="_blank" rel="noreferrer"><?php p($l->t('User documentation'));?> ↗</a>
  69. </span>
  70. {{/if}}
  71. {{#if documentation.admin}}
  72. <span class="adminDocumentation">
  73. <a id="adminDocumentation" class="appslink" href="{{documentation.admin}}" target="_blank" rel="noreferrer"><?php p($l->t('Admin documentation'));?> ↗</a>
  74. </span>
  75. {{/if}}
  76. {{#if documentation.developer}}
  77. <span class="developerDocumentation">
  78. <a id="developerDocumentation" class="appslink" href="{{documentation.developer}}" target="_blank" rel="noreferrer"><?php p($l->t('Developer documentation'));?> ↗</a>
  79. </span>
  80. {{/if}}
  81. </p>
  82. {{/if}}
  83. {{#if website}}
  84. <a id="userDocumentation" class="appslink" href="{{website}}" target="_blank" rel="noreferrer"><?php p($l->t('Visit website'));?> ↗</a>
  85. {{/if}}
  86. {{#if bugs}}
  87. <a id="adminDocumentation" class="appslink" href="{{bugs}}" target="_blank" rel="noreferrer"><?php p($l->t('Report a bug'));?> ↗</a>
  88. {{/if}}
  89. </div><!-- end app-description-container -->
  90. <div class="app-description-toggle-show" role="link"><?php p($l->t("Show description …"));?></div>
  91. <div class="app-description-toggle-hide hidden" role="link"><?php p($l->t("Hide description …"));?></div>
  92. <div class="app-dependencies update hidden">
  93. <p><?php p($l->t('This app has an update available.')); ?></p>
  94. </div>
  95. {{#if missingMinOwnCloudVersion}}
  96. <div class="app-dependencies">
  97. <p><?php p($l->t('This app has no minimum Nextcloud version assigned. This will be an error in the future.')); ?></p>
  98. </div>
  99. {{else}}
  100. {{#if missingMaxOwnCloudVersion}}
  101. <div class="app-dependencies">
  102. <p><?php p($l->t('This app has no maximum Nextcloud version assigned. This will be an error in the future.')); ?></p>
  103. </div>
  104. {{/if}}
  105. {{/if}}
  106. {{#unless canInstall}}
  107. <div class="app-dependencies">
  108. <p><?php p($l->t('This app cannot be installed because the following dependencies are not fulfilled:')); ?></p>
  109. <ul class="missing-dependencies">
  110. {{#each missingDependencies}}
  111. <li>{{this}}</li>
  112. {{/each}}
  113. </ul>
  114. </div>
  115. {{/unless}}
  116. <input class="update hidden" type="submit" value="<?php p($l->t('Update to %s', array('{{update}}'))); ?>" data-appid="{{id}}" />
  117. {{#if active}}
  118. <input class="enable" type="submit" data-appid="{{id}}" data-active="true" value="<?php p($l->t("Disable"));?>"/>
  119. <div class="groups-enable">
  120. <input type="checkbox" class="groups-enable__checkbox checkbox" id="groups_enable-{{id}}"/>
  121. <label for="groups_enable-{{id}}"><?php p($l->t('Enable only for specific groups')); ?></label>
  122. </div>
  123. <input type="hidden" id="group_select" title="<?php p($l->t('All')); ?>" style="width: 200px">
  124. {{else}}
  125. <input class="enable{{#if needsDownload}} needs-download{{/if}}" type="submit" data-appid="{{id}}" data-active="false" {{#unless canInstall}}disabled="disabled"{{/unless}} value="<?php p($l->t("Enable"));?>"/>
  126. {{/if}}
  127. {{#if canUnInstall}}
  128. <input class="uninstall" type="submit" value="<?php p($l->t('Uninstall app')); ?>" data-appid="{{id}}" />
  129. {{/if}}
  130. <div class="warning hidden"></div>
  131. </div>
  132. </script>
  133. <div id="app-navigation" class="icon-loading" data-category="<?php p($_['category']);?>">
  134. <ul id="apps-categories">
  135. </ul>
  136. </div>
  137. <div id="app-content">
  138. <svg class="app-filter">
  139. <defs><filter id="invertIcon"><feColorMatrix in="SourceGraphic" type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"></feColorMatrix></filter></defs>
  140. </svg>
  141. <div id="apps-list" class="icon-loading"></div>
  142. <div id="apps-list-empty" class="hidden emptycontent emptycontent-search">
  143. <div class="icon-search"></div>
  144. <h2><?php p($l->t('No apps found for your version')) ?></h2>
  145. </div>
  146. </div>