apps.php 5.6 KB

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