apps.php 7.3 KB

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