apps.php 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <?php
  2. style('settings', 'settings');
  3. vendor_script(
  4. 'core',
  5. [
  6. 'marked/marked.min',
  7. ]
  8. );
  9. script(
  10. 'settings',
  11. [
  12. 'settings',
  13. 'apps',
  14. ]
  15. );
  16. /** @var array $_ */
  17. /** @var \OCP\IURLGenerator $urlGenerator */
  18. $urlGenerator = $_['urlGenerator'];
  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="#" class="icon-category-{{ident}}">{{displayName}}</a>
  24. <div class="app-navigation-entry-utils">
  25. <ul>
  26. <li class="app-navigation-entry-utils-counter">{{ counter }}</li>
  27. </ul>
  28. </div>
  29. </li>
  30. {{/each}}
  31. <?php if($_['appstoreEnabled']): ?>
  32. <li>
  33. <a class="app-external icon-info" target="_blank" rel="noreferrer noopener" href="<?php p($urlGenerator->linkToDocs('developer-manual')); ?>"><?php p($l->t('Developer documentation'));?> ↗</a>
  34. </li>
  35. <?php endif; ?>
  36. </script>
  37. <script id="app-template-installed" type="text/x-handlebars">
  38. {{#if newCategory}}
  39. <div class="apps-header">
  40. <div class="app-image"></div>
  41. <h2>{{categoryName}} <input class="enable" type="submit" data-bundleid="{{bundleId}}" data-active="true" value="<?php p($l->t('Enable all'));?>"/></h2>
  42. <div class="app-version"></div>
  43. <div class="app-level"></div>
  44. <div class="app-groups"></div>
  45. <div class="actions">&nbsp;</div>
  46. </div>
  47. {{/if}}
  48. <div class="section" id="app-{{id}}">
  49. <div class="app-image app-image-icon"></div>
  50. <div class="app-name">
  51. {{#if detailpage}}
  52. <a href="{{detailpage}}" target="_blank" rel="noreferrer noopener">{{name}}</a>
  53. {{else}}
  54. {{name}}
  55. {{/if}}
  56. </div>
  57. <div class="app-version">{{version}}</div>
  58. <div class="app-level">
  59. {{{level}}}{{#unless internal}}<a href="https://apps.nextcloud.com/apps/{{id}}" target="_blank"><?php p($l->t('View in store'));?> ↗</a>{{/unless}}
  60. </div>
  61. <div class="app-groups">
  62. {{#if active}}
  63. <div class="groups-enable">
  64. <input type="checkbox" class="groups-enable__checkbox checkbox" id="groups_enable-{{id}}"/>
  65. <label for="groups_enable-{{id}}"><?php p($l->t('Limit to groups')); ?></label>
  66. <input type="hidden" class="group_select" title="<?php p($l->t('All')); ?>">
  67. </div>
  68. {{/if}}
  69. </div>
  70. <div class="actions">
  71. <div class="warning hidden"></div>
  72. <input class="update hidden" type="submit" value="<?php p($l->t('Update to %s', array('{{update}}'))); ?>" data-appid="{{id}}" />
  73. {{#if canUnInstall}}
  74. <input class="uninstall" type="submit" value="<?php p($l->t('Remove')); ?>" data-appid="{{id}}" />
  75. {{/if}}
  76. {{#if active}}
  77. <input class="enable" type="submit" data-appid="{{id}}" data-active="true" value="<?php p($l->t("Disable"));?>"/>
  78. {{else}}
  79. <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"));?>"/>
  80. {{/if}}
  81. </div>
  82. </div>
  83. </script>
  84. <script id="app-template" type="text/x-handlebars">
  85. <div class="section" id="app-{{id}}">
  86. {{#if preview}}
  87. <div class="app-image{{#if previewAsIcon}} app-image-icon{{/if}} icon-loading">
  88. </div>
  89. {{/if}}
  90. <h2 class="app-name">
  91. {{#if detailpage}}
  92. <a href="{{detailpage}}" target="_blank" rel="noreferrer noopener">{{name}}</a>
  93. {{else}}
  94. {{name}}
  95. {{/if}}
  96. </h2>
  97. <div class="app-level">
  98. {{{level}}}
  99. </div>
  100. {{#if ratingNumThresholdReached }}
  101. <div class="app-score">{{{score}}}</div>
  102. {{/if}}
  103. <div class="app-detailpage"></div>
  104. <div class="app-description-container hidden">
  105. <div class="app-version">{{version}}</div>
  106. {{#if profilepage}}<a href="{{profilepage}}" target="_blank" rel="noreferrer noopener">{{/if}}
  107. <div class="app-author"><?php p($l->t('by %s', ['{{author}}']));?>
  108. {{#if licence}}
  109. (<?php p($l->t('%s-licensed', ['{{licence}}'])); ?>)
  110. {{/if}}
  111. </div>
  112. {{#if profilepage}}</a>{{/if}}
  113. <div class="app-description">{{{description}}}</div>
  114. <!--<div class="app-changed">{{changed}}</div>-->
  115. {{#if documentation}}
  116. <p class="documentation">
  117. <?php p($l->t("Documentation:"));?>
  118. {{#if documentation.user}}
  119. <span class="userDocumentation">
  120. <a id="userDocumentation" class="appslink" href="{{documentation.user}}" target="_blank" rel="noreferrer noopener"><?php p($l->t('User documentation'));?> ↗</a>
  121. </span>
  122. {{/if}}
  123. {{#if documentation.admin}}
  124. <span class="adminDocumentation">
  125. <a id="adminDocumentation" class="appslink" href="{{documentation.admin}}" target="_blank" rel="noreferrer noopener"><?php p($l->t('Admin documentation'));?> ↗</a>
  126. </span>
  127. {{/if}}
  128. {{#if documentation.developer}}
  129. <span class="developerDocumentation">
  130. <a id="developerDocumentation" class="appslink" href="{{documentation.developer}}" target="_blank" rel="noreferrer noopener"><?php p($l->t('Developer documentation'));?> ↗</a>
  131. </span>
  132. {{/if}}
  133. </p>
  134. {{/if}}
  135. {{#if website}}
  136. <a id="userDocumentation" class="appslink" href="{{website}}" target="_blank" rel="noreferrer noopener"><?php p($l->t('Visit website'));?> ↗</a>
  137. {{/if}}
  138. {{#if bugs}}
  139. <a id="adminDocumentation" class="appslink" href="{{bugs}}" target="_blank" rel="noreferrer noopener"><?php p($l->t('Report a bug'));?> ↗</a>
  140. {{/if}}
  141. </div><!-- end app-description-container -->
  142. <div class="app-description-toggle-show" role="link"><?php p($l->t("Show description …"));?></div>
  143. <div class="app-description-toggle-hide hidden" role="link"><?php p($l->t("Hide description …"));?></div>
  144. <div class="app-dependencies update hidden">
  145. <p><?php p($l->t('This app has an update available.')); ?></p>
  146. </div>
  147. {{#if missingMinOwnCloudVersion}}
  148. <div class="app-dependencies">
  149. <p><?php p($l->t('This app has no minimum Nextcloud version assigned. This will be an error in the future.')); ?></p>
  150. </div>
  151. {{else}}
  152. {{#if missingMaxOwnCloudVersion}}
  153. <div class="app-dependencies">
  154. <p><?php p($l->t('This app has no maximum Nextcloud version assigned. This will be an error in the future.')); ?></p>
  155. </div>
  156. {{/if}}
  157. {{/if}}
  158. {{#unless canInstall}}
  159. <div class="app-dependencies">
  160. <p><?php p($l->t('This app cannot be installed because the following dependencies are not fulfilled:')); ?></p>
  161. <ul class="missing-dependencies">
  162. {{#each missingDependencies}}
  163. <li>{{this}}</li>
  164. {{/each}}
  165. </ul>
  166. </div>
  167. {{/unless}}
  168. <input class="update hidden" type="submit" value="<?php p($l->t('Update to %s', array('{{update}}'))); ?>" data-appid="{{id}}" />
  169. {{#if active}}
  170. <input class="enable" type="submit" data-appid="{{id}}" data-active="true" value="<?php p($l->t("Disable"));?>"/>
  171. <div class="groups-enable">
  172. <input type="checkbox" class="groups-enable__checkbox checkbox" id="groups_enable-{{id}}"/>
  173. <label for="groups_enable-{{id}}"><?php p($l->t('Enable only for specific groups')); ?></label>
  174. </div>
  175. <input type="hidden" class="group_select" title="<?php p($l->t('All')); ?>" style="width: 200px">
  176. {{else}}
  177. <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"));?>"/>
  178. {{/if}}
  179. {{#if canUnInstall}}
  180. <input class="uninstall" type="submit" value="<?php p($l->t('Remove')); ?>" data-appid="{{id}}" />
  181. {{/if}}
  182. <div class="warning hidden"></div>
  183. </div>
  184. </script>
  185. <div id="app-navigation" class="icon-loading" data-category="<?php p($_['category']);?>">
  186. <ul id="apps-categories">
  187. </ul>
  188. </div>
  189. <div id="app-content" class="icon-loading">
  190. <div id="apps-list"></div>
  191. <div id="apps-list-empty" class="hidden emptycontent emptycontent-search">
  192. <div id="app-list-empty-icon" class="icon-search"></div>
  193. <h2><?php p($l->t('No apps found for your version')) ?></h2>
  194. </div>
  195. </div>