apps.php 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <?php
  2. style('settings', 'settings');
  3. vendor_style(
  4. 'core',
  5. [
  6. 'select2/select2',
  7. ]
  8. );
  9. vendor_script(
  10. 'core',
  11. [
  12. 'handlebars/handlebars',
  13. 'select2/select2'
  14. ]
  15. );
  16. script(
  17. 'settings',
  18. [
  19. 'settings',
  20. 'apps',
  21. ]
  22. );
  23. /** @var array $_ */
  24. ?>
  25. <script id="categories-template" type="text/x-handlebars-template">
  26. {{#each this}}
  27. <li id="app-category-{{ident}}" data-category-id="{{ident}}" tabindex="0">
  28. <a href="#">{{displayName}}</a>
  29. </li>
  30. {{/each}}
  31. <?php if($_['appstoreEnabled']): ?>
  32. <li>
  33. <a class="app-external" target="_blank" rel="noreferrer" href="https://docs.nextcloud.org/server/10/developer_manual/"><?php p($l->t('Developer documentation'));?> ↗</a>
  34. </li>
  35. <?php endif; ?>
  36. </script>
  37. <script id="app-template" type="text/x-handlebars">
  38. {{#if firstExperimental}}
  39. <div class="section apps-experimental">
  40. <h2><?php p($l->t('Experimental applications ahead')) ?></h2>
  41. <p>
  42. <?php p($l->t('Experimental apps are not checked for security issues, new or known to be unstable and under heavy development. Installing them can cause data loss or security breaches.')) ?>
  43. </p>
  44. </div>
  45. {{/if}}
  46. <div class="section" id="app-{{id}}">
  47. {{#if preview}}
  48. <div class="app-image{{#if previewAsIcon}} app-image-icon{{/if}} hidden">
  49. </div>
  50. {{/if}}
  51. <h2 class="app-name">
  52. {{#if detailpage}}
  53. <a href="{{detailpage}}" target="_blank" rel="noreferrer">{{name}}</a>
  54. {{else}}
  55. {{name}}
  56. {{/if}}
  57. </h2>
  58. <div class="app-version"> {{version}}</div>
  59. {{#if profilepage}}<a href="{{profilepage}}" target="_blank" rel="noreferrer">{{/if}}
  60. <div class="app-author"><?php p($l->t('by %s', ['{{author}}']));?>
  61. {{#if licence}}
  62. (<?php p($l->t('%s-licensed', ['{{licence}}'])); ?>)
  63. {{/if}}
  64. </div>
  65. {{#if profilepage}}</a>{{/if}}
  66. <div class="app-level">
  67. {{{level}}}
  68. </div>
  69. {{#if score}}
  70. <div class="app-score">{{{score}}}</div>
  71. {{/if}}
  72. <div class="app-detailpage"></div>
  73. <div class="app-description-container hidden">
  74. <div class="app-description"><pre>{{description}}</pre></div>
  75. <!--<div class="app-changed">{{changed}}</div>-->
  76. {{#if documentation}}
  77. <p class="documentation">
  78. <?php p($l->t("Documentation:"));?>
  79. {{#if documentation.user}}
  80. <span class="userDocumentation">
  81. <a id="userDocumentation" class="appslink" href="{{documentation.user}}" target="_blank" rel="noreferrer"><?php p($l->t('User documentation'));?> ↗</a>
  82. </span>
  83. {{/if}}
  84. {{#if documentation.admin}}
  85. <span class="adminDocumentation">
  86. <a id="adminDocumentation" class="appslink" href="{{documentation.admin}}" target="_blank" rel="noreferrer"><?php p($l->t('Admin documentation'));?> ↗</a>
  87. </span>
  88. {{/if}}
  89. {{#if documentation.developer}}
  90. <span class="developerDocumentation">
  91. <a id="developerDocumentation" class="appslink" href="{{documentation.developer}}" target="_blank" rel="noreferrer"><?php p($l->t('Developer documentation'));?> ↗</a>
  92. </span>
  93. {{/if}}
  94. </p>
  95. {{/if}}
  96. {{#if website}}
  97. <a id="userDocumentation" class="appslink" href="{{website}}" target="_blank" rel="noreferrer"><?php p($l->t('Visit website'));?> ↗</a>
  98. {{/if}}
  99. {{#if bugs}}
  100. <a id="adminDocumentation" class="appslink" href="{{bugs}}" target="_blank" rel="noreferrer"><?php p($l->t('Report a bug'));?> ↗</a>
  101. {{/if}}
  102. </div><!-- end app-description-container -->
  103. <div class="app-description-toggle-show" role="link"><?php p($l->t("Show description …"));?></div>
  104. <div class="app-description-toggle-hide hidden" role="link"><?php p($l->t("Hide description …"));?></div>
  105. <div class="app-dependencies update hidden">
  106. <p><?php p($l->t('This app has an update available.')); ?></p>
  107. </div>
  108. {{#if missingMinOwnCloudVersion}}
  109. <div class="app-dependencies">
  110. <p><?php p($l->t('This app has no minimum Nextcloud version assigned. This will be an error in the future.')); ?></p>
  111. </div>
  112. {{else}}
  113. {{#if missingMaxOwnCloudVersion}}
  114. <div class="app-dependencies">
  115. <p><?php p($l->t('This app has no maximum Nextcloud version assigned. This will be an error in the future.')); ?></p>
  116. </div>
  117. {{/if}}
  118. {{/if}}
  119. {{#unless canInstall}}
  120. <div class="app-dependencies">
  121. <p><?php p($l->t('This app cannot be installed because the following dependencies are not fulfilled:')); ?></p>
  122. <ul class="missing-dependencies">
  123. {{#each missingDependencies}}
  124. <li>{{this}}</li>
  125. {{/each}}
  126. </ul>
  127. </div>
  128. {{/unless}}
  129. <input class="update hidden" type="submit" value="<?php p($l->t('Update to %s', array('{{update}}'))); ?>" data-appid="{{id}}" />
  130. {{#if active}}
  131. <input class="enable" type="submit" data-appid="{{id}}" data-active="true" value="<?php p($l->t("Disable"));?>"/>
  132. <span class="groups-enable">
  133. <input type="checkbox" class="groups-enable__checkbox checkbox" id="groups_enable-{{id}}"/>
  134. <label for="groups_enable-{{id}}"><?php p($l->t('Enable only for specific groups')); ?></label>
  135. </span>
  136. <br />
  137. <input type="hidden" id="group_select" title="<?php p($l->t('All')); ?>" style="width: 200px">
  138. {{else}}
  139. <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"));?>"/>
  140. {{/if}}
  141. {{#if canUnInstall}}
  142. <input class="uninstall" type="submit" value="<?php p($l->t('Uninstall App')); ?>" data-appid="{{id}}" />
  143. {{/if}}
  144. <div class="warning hidden"></div>
  145. </div>
  146. </script>
  147. <div id="app-navigation" class="icon-loading" data-category="<?php p($_['category']);?>">
  148. <ul id="apps-categories">
  149. </ul>
  150. <div id="app-settings">
  151. <div id="app-settings-header">
  152. <button class="settings-button" data-apps-slide-toggle="#app-settings-content"></button>
  153. </div>
  154. <div id="app-settings-content" class="apps-experimental">
  155. <input type="checkbox" id="enable-experimental-apps" <?php if($_['experimentalEnabled']) { print_unescaped('checked="checked"'); }?> class="checkbox">
  156. <label for="enable-experimental-apps"><?php p($l->t('Enable experimental apps')) ?></label>
  157. <p>
  158. <small>
  159. <?php p($l->t('Experimental apps are not checked for security issues, new or known to be unstable and under heavy development. Installing them can cause data loss or security breaches.')) ?>
  160. </small>
  161. </p>
  162. </div>
  163. </div>
  164. </div>
  165. <div id="app-content">
  166. <svg height="0">
  167. <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>
  168. </svg>
  169. <div id="apps-list" class="icon-loading"></div>
  170. <div id="apps-list-empty" class="hidden emptycontent emptycontent-search">
  171. <div class="icon-search"></div>
  172. <h2><?php p($l->t('No apps found for your version')) ?></h2>
  173. </div>
  174. </div>